]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedContextImpl.java
Clean up directories
[gpl/argeo-slc.git] / runtime / org.argeo.slc.detached / src / main / java / org / argeo / slc / detached / DetachedContextImpl.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
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 package org.argeo.slc.detached;
17
18 import java.util.ArrayList;
19 import java.util.List;
20 import java.util.Map;
21 import java.util.Set;
22 import java.util.TreeMap;
23 import java.util.Vector;
24
25 public class DetachedContextImpl implements DetachedContext {
26 private List executedPaths = new Vector();
27 private String currentPath;
28 private Map dynamicRefs = new TreeMap();
29
30 public String getCurrentPath() {
31 return currentPath;
32 }
33
34 public void setDynamicRef(String ref, Object obj) {
35 dynamicRefs.put(ref, obj);
36 }
37
38 public Object getDynamicRef(String ref) {
39 if (dynamicRefs.containsKey(ref))
40 return dynamicRefs.get(ref);
41 else
42 return null;
43 }
44
45 public List getExecutedPaths() {
46 return new ArrayList(executedPaths);
47 }
48
49 public String toString() {
50 StringBuffer buf = new StringBuffer(getClass().getName());
51 buf.append(" currentPath=").append(currentPath);
52 buf.append(" executedPaths=").append(executedPaths);
53 return buf.toString();
54 }
55
56 public Set getDynamicRefKeys() {
57 return dynamicRefs.keySet();
58 }
59 }