1 22 23 package org.jboss.web.tomcat.tc6.session; 24 25 33 public abstract class JBossCacheClusteredSession extends ClusteredSession 34 { 35 38 protected transient JBossCacheService proxy_; 39 40 46 public JBossCacheClusteredSession(JBossCacheManager manager) 47 { 48 super(manager, manager.getUseJK()); 49 establishProxy(); 50 } 51 52 58 public void initAfterLoad(AbstractJBossManager manager) 59 { 60 setManager(manager); 63 establishProxy(); 64 65 populateAttributes(); 68 69 this.activate(); 71 72 clearOutdated(); 74 } 75 76 79 protected void establishProxy() 80 { 81 if (proxy_ == null) 82 { 83 proxy_ = ((JBossCacheManager) manager).getCacheService(); 84 85 if (proxy_ == null) 87 { 88 throw new RuntimeException ("JBossCacheClusteredSession: Cache service is null."); 89 } 90 } 91 } 92 93 protected abstract void populateAttributes(); 94 95 103 public void recycle() 104 { 105 super.recycle(); 106 107 proxy_ = null; 108 } 109 110 113 public synchronized void processSessionRepl() 114 { 115 if (log.isTraceEnabled()) 117 { 118 log.trace("processSessionRepl(): session is dirty. Will increment " + 119 "version from: " + getVersion() + " and replicate."); 120 } 121 this.incrementVersion(); 122 proxy_.putSession(realId, this); 123 124 sessionAttributesDirty = false; 125 sessionMetadataDirty = false; 126 127 updateLastReplicated(); 128 } 129 130 135 protected void removeFromManager(boolean localCall, boolean localOnly) 136 { 137 if (localCall) 138 { 139 super.removeFromManager(localCall, localOnly); 140 } 141 } 142 143 144 protected Object removeAttributeInternal(String name, boolean localCall, boolean localOnly) 145 { 146 return removeJBossInternalAttribute(name, localCall, localOnly); 147 } 148 149 protected Object removeJBossInternalAttribute(String name) 150 { 151 throw new UnsupportedOperationException ("removeJBossInternalAttribute(String) " + 152 "is not supported by JBossCacheClusteredSession; use " + 153 "removeJBossInternalAttribute(String, boolean, boolean"); 154 } 155 156 protected abstract Object removeJBossInternalAttribute(String name, 157 boolean localCall, 158 boolean localOnly); 159 160 } 161 | Popular Tags |