X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.management%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fmanagement%2FISessionContextProviderSource.java;fp=bundles%2Forg.simantics.db.management%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fmanagement%2FISessionContextProviderSource.java;h=6c0337861b37b98822886f9b2fc0ada63cf40fa9;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.management/src/org/simantics/db/management/ISessionContextProviderSource.java b/bundles/org.simantics.db.management/src/org/simantics/db/management/ISessionContextProviderSource.java new file mode 100644 index 000000000..6c0337861 --- /dev/null +++ b/bundles/org.simantics.db.management/src/org/simantics/db/management/ISessionContextProviderSource.java @@ -0,0 +1,62 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.db.management; + + +/** + * @author Tuukka Lehtonen + */ +public interface ISessionContextProviderSource { + + /** + * @param context the context object of the requested ISessionContextProvider + * @return null if there is no provider for the specified context + */ + ISessionContextProvider get(Object context); + + /** + * @return the currently active session context provider. Must always return + * a valid provider. + */ + ISessionContextProvider getActive(); + + /** + * @return all currently existing session context providers + */ + ISessionContextProvider[] getAll(); + + /** + * Used for manually installing ISessionContextProvider for a specified + * context handle object. + * + * @param context the context handle to associate the session context + * provider to. This same argument needs to be used with + * {@link #get(Object)} when retrieving your session context + * provider. + * @param provider the session context provider to associate with the + * specified context + */ + void put(Object context, ISessionContextProvider provider); + + /** + * Used for manually removing an (context, provider) association from this + * source. Only associations created with + * {@link #put(Object, ISessionContextProvider)} can be removed with this + * method. + * + * @param context the context handle to associate the session context + * provider to. + * @return the dissociated session context provider + */ + ISessionContextProvider remove(Object context); + +}