/******************************************************************************* * Copyright (c) 2013 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 Kalle Kondelin */ public class SingleSessionContextProviderSource implements ISessionContextProviderSource { ISessionContextProvider provider; public SingleSessionContextProviderSource(ISessionContextProvider provider) { this.provider = provider; } @Override public ISessionContextProvider remove(Object context) { throw new java.lang.UnsupportedOperationException(); } @Override public void put(Object context, ISessionContextProvider provider) { throw new java.lang.UnsupportedOperationException(); } @Override public ISessionContextProvider[] getAll() { return new ISessionContextProvider[] { provider }; } @Override public ISessionContextProvider getActive() { return provider; } @Override public ISessionContextProvider get(Object context) { return provider; } }