]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db.management/src/org/simantics/db/management/SingleSessionContextProviderSource.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.db.management / src / org / simantics / db / management / SingleSessionContextProviderSource.java
1 /*******************************************************************************
2  * Copyright (c) 2013 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.management;
13
14 /**
15  * @author Kalle Kondelin
16  */
17 public class SingleSessionContextProviderSource implements ISessionContextProviderSource {
18
19         ISessionContextProvider provider;
20
21         public SingleSessionContextProviderSource(ISessionContextProvider provider) {
22                 this.provider = provider;
23         }
24
25         @Override
26         public ISessionContextProvider remove(Object context) {
27                 throw new java.lang.UnsupportedOperationException();
28         }
29
30         @Override
31         public void put(Object context, ISessionContextProvider provider) {
32                 throw new java.lang.UnsupportedOperationException();
33         }
34
35         @Override
36         public ISessionContextProvider[] getAll() {
37                 return new ISessionContextProvider[] { provider };
38         }
39
40         @Override
41         public ISessionContextProvider getActive() {
42                 return provider;
43         }
44
45         @Override
46         public ISessionContextProvider get(Object context) {
47                 return provider;
48         }
49
50 }