01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.terracotta.session.util;
05:
06: import com.terracotta.session.Session;
07:
08: public class MockLifecycleEventMgr implements LifecycleEventMgr {
09:
10: private Session sess;
11: private String name;
12: private Object val;
13: private String lastMethod;
14:
15: public void clear() {
16: sess = null;
17: name = null;
18: val = null;
19: lastMethod = null;
20: }
21:
22: public void fireSessionCreatedEvent(Session s) {
23: this .lastMethod = "fireSessionCreatedEvent";
24: this .sess = s;
25: }
26:
27: public void fireSessionDestroyedEvent(Session s) {
28: this .lastMethod = "fireSessionDestroyedEvent";
29: this .sess = s;
30: }
31:
32: public void unbindAttribute(Session s, String n, Object ov) {
33: this .lastMethod = "unbindAttribute";
34: this .sess = s;
35: this .name = n;
36: this .val = ov;
37: }
38:
39: public void bindAttribute(Session s, String n, Object o) {
40: this .lastMethod = "bindAttribute";
41: this .sess = s;
42: this .name = n;
43: this .val = o;
44: }
45:
46: public void removeAttribute(Session s, String n, Object o) {
47: this .lastMethod = "removeAttribute";
48: this .sess = s;
49: this .name = n;
50: this .val = o;
51: }
52:
53: public void replaceAttribute(Session s, String n, Object o,
54: Object newVal) {
55: this .lastMethod = "replaceAttribute";
56: this .sess = s;
57: this .name = n;
58: this .val = o;
59: }
60:
61: public void setAttribute(Session s, String n, Object o) {
62: this .lastMethod = "setAttribute";
63: this .sess = s;
64: this .name = n;
65: this .val = o;
66: }
67:
68: public String getLastMethod() {
69: return lastMethod;
70: }
71:
72: public String getName() {
73: return name;
74: }
75:
76: public Object getValue() {
77: return val;
78: }
79:
80: public Session getSession() {
81: return sess;
82: }
83:
84: }
|