01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it)
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.romaframework.core.flow;
17:
18: import java.io.Serializable;
19: import java.util.HashMap;
20: import java.util.Map;
21:
22: /**
23: * Data class containing the user context to be saved in session. It implements Serializable interface to allow clustering.
24: *
25: * @author Luca Garulli (luca.garulli@assetdata.it)
26: */
27: public class ControllerContext implements Serializable {
28:
29: private static final long serialVersionUID = 1L;
30:
31: private String activeArea;
32: private Map<String, Object> objects = new HashMap<String, Object>();
33:
34: public String getActiveArea() {
35: return activeArea;
36: }
37:
38: public void setActiveArea(String lastArea) {
39: this .activeArea = lastArea;
40: }
41:
42: public Map<String, Object> getObjects() {
43: return objects;
44: }
45:
46: public void removeObject(String iKey) {
47: objects.remove(iKey);
48: }
49:
50: @Override
51: public String toString() {
52: StringBuilder buffer = new StringBuilder();
53: buffer.append("LastArea: ");
54: buffer.append(activeArea);
55: buffer.append(" Objects: ");
56: buffer.append(objects.size());
57: return buffer.toString();
58: }
59: }
|