]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedContextImpl.java
bdda969b2431bd456f91a1f966a94c2fb785c8ea
[gpl/argeo-slc.git] / runtime / org.argeo.slc.detached / src / main / java / org / argeo / slc / detached / DetachedContextImpl.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.detached;
18
19 import java.util.ArrayList;
20 import java.util.List;
21 import java.util.Map;
22 import java.util.Set;
23 import java.util.TreeMap;
24 import java.util.Vector;
25
26 public class DetachedContextImpl implements DetachedContext {
27 private List executedPaths = new Vector();
28 private String currentPath;
29 private Map dynamicRefs = new TreeMap();
30
31 public String getCurrentPath() {
32 return currentPath;
33 }
34
35 public void setDynamicRef(String ref, Object obj) {
36 dynamicRefs.put(ref, obj);
37 }
38
39 public Object getDynamicRef(String ref) {
40 if (dynamicRefs.containsKey(ref))
41 return dynamicRefs.get(ref);
42 else
43 return null;
44 }
45
46 public List getExecutedPaths() {
47 return new ArrayList(executedPaths);
48 }
49
50 public String toString() {
51 StringBuffer buf = new StringBuffer(getClass().getName());
52 buf.append(" currentPath=").append(currentPath);
53 buf.append(" executedPaths=").append(executedPaths);
54 return buf.toString();
55 }
56
57 public Set getDynamicRefKeys() {
58 return dynamicRefs.keySet();
59 }
60 }