@Override
  public void init(Configuration environment) {
    super.init(environment);

    // Determine the cache name
    _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);
    }

    Configuration bridgeRemoteTxConfig =
        environment.getFirstChild(DISABLE_REMOTE_TRANSACTION_PROPERTY);
    if (bridgeRemoteTxConfig != null) {
      _disableRemoteTransaction = Boolean.parseBoolean(bridgeRemoteTxConfig.getValue());
    }
  }
Beispiel #2
0
 /** {@inheritDoc} */
 @Override
 public void destroy() {
   ResourceChangeService.stop(this);
   super.destroy();
 }
Beispiel #3
0
 /** {@inheritDoc} */
 @Override
 public void init(Configuration config) {
   super.init(config);
   ResourceChangeService.start(this);
 }