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