/* 132 */ this.log = Logger.getLogger(getClass().getName() + "." + this.tableName);
/* */
/* 134 */ this.schema = schema;
/* 135 */ this.tableId = tableId;
/* */
/* 137 */ EntityMetaData entityMetaData = (EntityMetaData)entity.getContainer().getBeanMetaData();
/* 138 */ ConfigurationMetaData containerConf = entityMetaData.getContainerConfiguration();
/* 139 */ this.dontFlushCreated = containerConf.isInsertAfterEjbPostCreate();
/* */
/* 142 */ Element cacheConf = containerConf.getContainerCacheConf();
/* 143 */ Element cachePolicy = cacheConf == null ? null : MetaData.getOptionalChild(cacheConf, "cache-policy-conf");
/* */ int maxCapacity;
/* */ int minCapacity;
/* */ int maxCapacity;
/* 147 */ if (cachePolicy != null)
/* */ {
/* 149 */ String str = MetaData.getOptionalChildContent(cachePolicy, "min-capacity");
/* 150 */ int minCapacity = str == null ? 1000 : Integer.parseInt(str);
/* 151 */ str = MetaData.getOptionalChildContent(cachePolicy, "max-capacity");
/* 152 */ maxCapacity = str == null ? 10000 : Integer.parseInt(str);
/* */ }
/* */ else
/* */ {
/* 156 */ minCapacity = 1000;
/* 157 */ maxCapacity = 10000;
/* */ }
/* */
/* 160 */ Element otherConf = cacheConf == null ? null : MetaData.getOptionalChild(cacheConf, "cache-policy-conf-other");
/* */ boolean invalidable;
/* */ int partitionsTotal;
/* */ Element batchCommitStrategy;
/* */ boolean invalidable;
/* 165 */ if (otherConf != null)
/* */ {
/* 167 */ String str = MetaData.getOptionalChildContent(otherConf, "partitions");
/* 168 */ int partitionsTotal = str == null ? 10 : Integer.parseInt(str);
/* 169 */ Element batchCommitStrategy = MetaData.getOptionalChild(otherConf, "batch-commit-strategy");
/* 170 */ invalidable = MetaData.getOptionalChild(otherConf, "invalidable") != null;
/* */ }
/* */ else
/* */ {
/* 174 */ partitionsTotal = 10;
/* 175 */ batchCommitStrategy = null;
/* 176 */ invalidable = false;
/* */ }
/* */
/* 179 */ if (cachePolicy != null)
/* */ {
/* 181 */ this.cache = new PartitionedTableCache(minCapacity, maxCapacity, partitionsTotal);
/* */
/* 183 */ String periodStr = MetaData.getOptionalChildContent(cachePolicy, "overager-period");
/* 184 */ String maxAgeStr = MetaData.getOptionalChildContent(cachePolicy, "max-bean-age");
/* 185 */ if (((periodStr != null) && (maxAgeStr == null)) || ((maxAgeStr != null) && (periodStr == null)))
/* */ {
/* 187 */ throw new DeploymentException("Failed to initialize age-out thread for entity " + entity.getEntityName() + ": overager-period or max-bean-age is missing!");
/* */ }
/* */
/* 191 */ if ((periodStr != null) && (maxAgeStr != null))
/* */ {
/* 193 */ long period = Long.parseLong(periodStr);
/* 194 */ long maxAge = Long.parseLong(maxAgeStr);
/* 195 */ ((PartitionedTableCache)this.cache).initOverager(period, maxAge, entity.getEntityName() + " overager");
/* */
/* 197 */ if (this.log.isTraceEnabled())
/* */ {
/* 199 */ this.log.trace("initialized age-out thread for " + entity.getEntityName() + ": overager-period=" + period + ", max-bean-age=" + maxAge);
/* */ }
/* */
/* */ }
/* */
/* 204 */ MBeanServer server = MBeanServerLocator.locateJBoss();
/* 205 */ this.serviceController = ((ServiceControllerMBean)MBeanProxyExt.create(ServiceControllerMBean.class, ServiceControllerMBean.OBJECT_NAME, server));
/* */ try
/* */ {
/* 211 */ this.cacheName = new ObjectName("jboss.cmp:service=tablecache,ejbname=" + metadata.getName() + ",table=" + this.tableName);
/* */
/* 213 */ server.registerMBean(this.cache, this.cacheName);
/* 214 */ this.serviceController.create(this.cacheName);
/* */ }
/* */ catch (Exception e)
/* */ {
/* 218 */ throw new DeploymentException("Failed to register table cache for " + this.tableName, e);
/* */ }
/* */ }
/* */ else
/* */ {
/* 223 */ this.cache = Cache.NONE;
/* */ }
/* */
/* 226 */ if (invalidable)
/* */ {
/* 228 */ String groupName = entityMetaData.getDistributedCacheInvalidationConfig().getInvalidationGroupName();
/* 229 */ String imName = entityMetaData.getDistributedCacheInvalidationConfig().getInvalidationManagerName();
/* */
/* 231 */ InvalidationManagerMBean im = (InvalidationManagerMBean)Registry.lookup(imName);
/* 232 */ InvalidationGroup invalidationGroup = im.getInvalidationGroup(groupName);
/* */
/* 234 */ this.cacheInvalidator = new CacheInvalidator(this.cache, entity.getContainer().getTransactionManager(), invalidationGroup);