1 4 package com.terracotta.session.util; 5 6 import com.terracotta.session.Session; 7 8 public class MockLifecycleEventMgr implements LifecycleEventMgr { 9 10 private Session sess; 11 private String name; 12 private Object val; 13 private String lastMethod; 14 15 16 public void clear() { 17 sess = null; 18 name = null; 19 val = null; 20 lastMethod = null; 21 } 22 23 public void fireSessionCreatedEvent(Session s) { 24 this.lastMethod = "fireSessionCreatedEvent"; 25 this.sess = s; 26 } 27 28 public void fireSessionDestroyedEvent(Session s) { 29 this.lastMethod = "fireSessionDestroyedEvent"; 30 this.sess = s; 31 } 32 33 public void unbindAttribute(Session s, String n, Object ov) { 34 this.lastMethod = "unbindAttribute"; 35 this.sess = s; 36 this.name = n; 37 this.val = ov; 38 } 39 40 public void bindAttribute(Session s, String n, Object o) { 41 this.lastMethod = "bindAttribute"; 42 this.sess = s; 43 this.name = n; 44 this.val = o; 45 } 46 47 public void removeAttribute(Session s, String n, Object o) { 48 this.lastMethod = "removeAttribute"; 49 this.sess = s; 50 this.name = n; 51 this.val = o; 52 } 53 54 public void replaceAttribute(Session s, String n, Object o, 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 } 85 | Popular Tags |