public SCAActivator(Configuration environment) {
super(TYPES);
// Determine the cache name
String cacheName = "cluster";
Configuration cacheNameConfig = environment.getFirstChild(CACHE_NAME_PROPERTY);
if (cacheNameConfig != null) {
cacheName = cacheNameConfig.getValue();
}
// If a cache config is specified in the component configuration, then we
// are managing the creation of the cache. If not, then we look up a
// cache manager and try to resolve the cache.
Configuration cacheFileConfig = environment.getFirstChild(CACHE_CONFIG_PROPERTY);
if (cacheFileConfig != null && cacheFileConfig.getValue() != null) {
Configuration jgroupsConfig = environment.getFirstChild(JGROUPS_CONFIG_PROPERTY);
createCache(cacheFileConfig.getValue(), cacheName, jgroupsConfig != null ? jgroupsConfig.getValue() : null);
} else {
lookupCache(cacheName);
}
// Configure a registry client to use the specified cache
if (_cache != null) {
_registry = new InfinispanRegistry(_cache);
} else {
SCALogger.ROOT_LOGGER.unableToResolveCacheContainer(cacheName);
}
Configuration bridgeRemoteTxConfig = environment.getFirstChild(DISABLE_REMOTE_TRANSACTION_PROPERTY);
if (bridgeRemoteTxConfig != null) {
_disableRemoteTransaction = Boolean.parseBoolean(bridgeRemoteTxConfig.getValue());
}
}