use of org.apache.curator.framework.recipes.cache.NodeCacheExtended in project fabric8 by jboss-fuse.
the class EncryptedPropertyResolver method initialize.
/**
* When {@link FabricService} becomes available, we can initialize this {@link PlaceholderResolver}
* @param fabricService
*/
public void initialize(FabricService fabricService) {
this.fabricService = fabricService;
encryptor = getEncryptor(fabricService);
if (bundleContext != null) {
seRegistration = bundleContext.registerService(PBEStringEncryptor.class, encryptor, null);
BundleContext context = FrameworkUtil.getBundle(PersistenceManager.class).getBundleContext();
encryptingPersistenceManager = new EncryptingPersistenceManager(context, context.getProperty(ConfigurationManager.CM_CONFIG_DIR), encryptor);
originalPersistenceManager = inject(configAdmin, encryptingPersistenceManager);
passwordNodeCache = new NodeCacheExtended(fabricService.adapt(CuratorFramework.class), AUTHENTICATION_CRYPT_PASSWORD.getPath());
passwordNodeCache.getListenable().addListener(this);
alogrithmNodeCache = new NodeCacheExtended(fabricService.adapt(CuratorFramework.class), AUTHENTICATION_CRYPT_ALGORITHM.getPath());
alogrithmNodeCache.getListenable().addListener(this);
try {
passwordNodeCache.start();
alogrithmNodeCache.start();
} catch (Exception e) {
throw new FabricException(e);
}
}
}
use of org.apache.curator.framework.recipes.cache.NodeCacheExtended in project fabric8 by jboss-fuse.
the class FabricCxfRegistrationHandler method activate.
@Activate
void activate() throws Exception {
activateComponent();
if (mBeanServer == null) {
mBeanServer = ManagementFactory.getPlatformMBeanServer();
}
if (mBeanServer != null) {
Object handback = null;
mBeanServer.addNotificationListener(MBeanServerDelegate.DELEGATE_NAME, listener, filter, handback);
this.registeredListener = true;
}
String id = getCurrentContainer().getId();
String zkPath = ZkPath.CONFIG_CONTAINER.getPath(id);
versionNodeMonitor = new NodeCacheExtended(curator.get(), zkPath);
versionNodeMonitor.getListenable().addListener(this);
versionNodeMonitor.start();
replay();
}
Aggregations