--- /dev/null
+/*******************************************************************************\r
+ * Copyright (c) 2013 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.db.management;\r
+\r
+/**\r
+ * @author Kalle Kondelin\r
+ */\r
+public class SingleSessionContextProviderSource implements ISessionContextProviderSource {\r
+\r
+ ISessionContextProvider provider;\r
+\r
+ public SingleSessionContextProviderSource(ISessionContextProvider provider) {\r
+ this.provider = provider;\r
+ }\r
+\r
+ @Override\r
+ public ISessionContextProvider remove(Object context) {\r
+ throw new java.lang.UnsupportedOperationException();\r
+ }\r
+\r
+ @Override\r
+ public void put(Object context, ISessionContextProvider provider) {\r
+ throw new java.lang.UnsupportedOperationException();\r
+ }\r
+\r
+ @Override\r
+ public ISessionContextProvider[] getAll() {\r
+ return new ISessionContextProvider[] { provider };\r
+ }\r
+\r
+ @Override\r
+ public ISessionContextProvider getActive() {\r
+ return provider;\r
+ }\r
+\r
+ @Override\r
+ public ISessionContextProvider get(Object context) {\r
+ return provider;\r
+ }\r
+\r
+}\r