1 16 package org.mortbay.j2ee.session; 17 18 20 import java.rmi.RemoteException ; 21 22 import org.jfox.ioc.logger.Logger; 23 24 26 27 30 public class SubscribingInterceptor 31 extends StateInterceptor 32 { 33 protected static final Logger _log=Logger.getLogger(SubscribingInterceptor.class); 34 35 protected AbstractReplicatedStore 36 getStore() 37 { 38 AbstractReplicatedStore store=null; 39 try 40 { 41 store=(AbstractReplicatedStore)getManager().getStore(); 42 } 43 catch (Exception e) 44 { 45 _log.error("could not get AbstractReplicatedStore"); 46 } 47 48 return store; 49 } 50 51 53 56 public void 57 start() 58 { 59 try 60 { 61 AbstractReplicatedStore store = getStore(); 62 if (store != null) 63 getStore().subscribe(getId(), this); 64 } 65 catch (RemoteException e) 66 { 67 _log.error("could not get my ID", e); 68 } 69 } 70 71 public void 72 stop() 73 { 74 try 75 { 76 AbstractReplicatedStore store = getStore(); 77 if (store != null) 78 store.unsubscribe(getId()); 79 } 80 catch (RemoteException e) 81 { 82 _log.error("could not get my ID", e); 83 } 84 } 85 } 86 | Popular Tags |