/** * Create a new TimestampsRegionImpl. * * @param jbcCache The JBC cache instance to use to store the timestamps data * @param regionName The name of the region (within the JBC cache) * @param regionPrefix Any region prefix to apply * @param properties The configuration properties. */ public TimestampsRegionImpl(Cache jbcCache, String regionName, String regionPrefix, Properties properties) { super(jbcCache, regionName, regionPrefix, null); jbcCache.addCacheListener(this); populateLocalCache(); }
/** * Create a new TimestampsRegionImpl. * * @param jbcCache The JBC cache instance to use to store the timestamps data * @param regionName The name of the region (within the JBC cache) * @param regionPrefix Any region prefix to apply * @param properties The configuration properties. */ public TimestampsRegionImpl(Cache jbcCache, String regionName, String regionPrefix, Properties properties) { super(jbcCache, regionName, regionPrefix, null); jbcCache.addCacheListener(this); populateLocalCache(); }
/** * Create a new ClusteredConccurentTimestampsRegionImpl. * * @param jbcCache * @param regionName * @param regionPrefix * TODO * @param metadata */ public ClusteredConcurrentTimestampsRegionImpl(Cache jbcCache, String regionName, String regionPrefix, Properties properties) { super(jbcCache, regionName, regionPrefix, null); jbcCache.addCacheListener(this); populateLocalCache(); }
/** * Create a new ClusteredConccurentTimestampsRegionImpl. * * @param jbcCache * @param regionName * @param regionPrefix * TODO * @param metadata */ public ClusteredConcurrentTimestampsRegionImpl(Cache jbcCache, String regionName, String regionPrefix, Properties properties) { super(jbcCache, regionName, regionPrefix, null); jbcCache.addCacheListener(this); populateLocalCache(); }
/** * Allows direct injection of the underlying cache. * * @param cache */ public void setCache(Cache<K, V> cache) { if (cacheStatus != CacheStatus.INSTANTIATED && cacheStatus != CacheStatus.CREATING && cacheStatus != CacheStatus.DESTROYED) { throw new IllegalStateException("Cannot set underlying cache after call to create()"); } this.cache = (CacheSPI<K, V>) cache; this.config = (cache == null ? null : cache.getConfiguration()); synchronized (listenerCount) { if (listenerCount.get() > 0 && cache != null) { cache.addCacheListener(cacheNotificationListener); } } }
private void createCacheListeners() { sipCacheListener_ = new SipCacheListener( jBossCacheService.cacheWrapper_, manager, jBossCacheService.combinedPath_, Util.getReplicationGranularity(manager), sipApplicationName, sipApplicationNameHashed); if (log_.isDebugEnabled()) { log_.debug("DistributedCacheConvergedSipManagerDelegate.start() : sipCacheListener " + sipCacheListener_); } jBossCacheService.getCache().addCacheListener(sipCacheListener_); if (manager.isPassivationEnabled()) { log_.debug("Passivation is enabled"); sipPassivationListener_ = new SipPassivationListener( manager, jBossCacheService.combinedPath_, sipApplicationNameHashed); jBossCacheService.getCache().addCacheListener( sipPassivationListener_); } }
cluster.getMobicentsCache().getJBossCache().addCacheListener(listener);
public void init() throws SipCacheException { String pojoConfigurationPath = configProperties.getProperty(JBOSS_CACHE_CONFIG_PATH, DEFAULT_FILE_CONFIG_PATH); if (clusteredlogger.isLoggingEnabled(StackLogger.TRACE_INFO)) { clusteredlogger.logInfo( "Mobicents JAIN SIP JBoss Cache Configuration path is : " + pojoConfigurationPath); } try { cache = new DefaultCacheFactory<String, SIPDialog>().createCache(pojoConfigurationPath); cache.create(); cacheListener = new JBossJainSipCacheListener(clusteredSipStack); cache.addCacheListener(cacheListener); } catch (Exception e) { throw new SipCacheException("Couldn't init JBoss Cache", e); } }
public BasicRegionAdapter(Cache jbcCache, String regionName, String regionPrefix) { this.log = LoggerFactory.getLogger(getClass()); this.jbcCache = jbcCache; this.transactionManager = jbcCache.getConfiguration().getRuntimeConfig().getTransactionManager(); this.regionName = regionName; this.regionFqn = createRegionFqn(regionName, regionPrefix); this.internalFqn = CacheHelper.getInternalFqn(regionFqn); this.optimistic = jbcCache.getConfiguration().getNodeLockingScheme() == NodeLockingScheme.OPTIMISTIC; this.memberId = jbcCache.getLocalAddress(); this.replication = CacheHelper.isClusteredReplication(jbcCache); this.jbcCache.addCacheListener(this); synchronized (currentView) { List view = jbcCache.getMembers(); if (view != null) { currentView.addAll(view); } } activateLocalClusterNode(); log.debug("Created Region for " + regionName + " -- regionPrefix is " + regionPrefix); }