1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.db.management;
\r
16 * @author Tuukka Lehtonen
\r
18 public interface ISessionContextProviderSource {
\r
21 * @param context the context object of the requested ISessionContextProvider
\r
22 * @return <code>null</code> if there is no provider for the specified context
\r
24 ISessionContextProvider get(Object context);
\r
27 * @return the currently active session context provider. Must always return
\r
30 ISessionContextProvider getActive();
\r
33 * @return all currently existing session context providers
\r
35 ISessionContextProvider[] getAll();
\r
38 * Used for manually installing ISessionContextProvider for a specified
\r
39 * context handle object.
\r
41 * @param context the context handle to associate the session context
\r
42 * provider to. This same argument needs to be used with
\r
43 * {@link #get(Object)} when retrieving your session context
\r
45 * @param provider the session context provider to associate with the
\r
48 void put(Object context, ISessionContextProvider provider);
\r
51 * Used for manually removing an (context, provider) association from this
\r
52 * source. Only associations created with
\r
53 * {@link #put(Object, ISessionContextProvider)} can be removed with this
\r
56 * @param context the context handle to associate the session context
\r
58 * @return the dissociated session context provider
\r
60 ISessionContextProvider remove(Object context);
\r