use of io.fabric8.api.CreateEnsembleOptions in project fabric8 by jboss-fuse.
the class GitDataStoreImplTestSupport method createGitDataStore.
protected GitDataStoreImpl createGitDataStore() throws Exception {
RuntimeProperties runtimeProperties = createMockRuntimeProperties();
CreateEnsembleOptions ensembleOptions = CreateEnsembleOptions.builder().zookeeperPassword("admin").build();
recursiveDelete(runtimeProperties.getDataPath().toFile());
BootstrapConfiguration.DataStoreOptions options = new BootstrapConfiguration.DataStoreOptions("root", new File("target/test-container"), zkURL, ensembleOptions);
runtimeProperties.putRuntimeAttribute(DataStoreTemplate.class, new DataStoreBootstrapTemplate(options));
FabricGitServiceImpl fabricGitService = new FabricGitServiceImpl();
fabricGitService.bindRuntimeProperties(runtimeProperties);
fabricGitService.activate();
ComponentConfigurer componentConfigurer = new ComponentConfigurer();
componentConfigurer.activate(null);
ZkDataStoreImpl zkDataStore = new ZkDataStoreImpl() {
@Override
public String getDefaultVersion() {
return "1.0";
}
};
zkDataStore.bindCurator(curator);
zkDataStore.bindRuntimeProperties(runtimeProperties);
zkDataStore.activateComponent();
final GitDataStoreImpl gitDataStore = new GitDataStoreImpl();
gitDataStore.bindConfigurer(componentConfigurer);
gitDataStore.bindGitService(fabricGitService);
gitDataStore.bindRuntimeProperties(runtimeProperties);
gitDataStore.bindGitProxyService(new GitProxyRegistrationHandler());
gitDataStore.bindCurator(curator);
gitDataStore.bindDataStore(zkDataStore);
gitDataStore.activate(new HashMap<String, Object>());
return gitDataStore;
}
use of io.fabric8.api.CreateEnsembleOptions in project fabric8 by jboss-fuse.
the class ZooKeeperClusterBootstrapImpl method startBundles.
private void startBundles(CreateEnsembleOptions options) throws BundleException {
BundleUtils bundleUtils = new BundleUtils(bundleContext);
Bundle agentBundle = bundleUtils.findBundle("io.fabric8.fabric-agent");
if (agentBundle != null && options.isAgentEnabled()) {
agentBundle.start();
}
// Bundle webBundle = bundleUtils.findBundle("org.ops4j.pax.web.pax-web-jetty");
// if (webBundle != null) {
// webBundle.start();
// }
}
use of io.fabric8.api.CreateEnsembleOptions in project fabric8 by jboss-fuse.
the class ClusterBootstrapManager method createCluster.
@Override
public void createCluster(Map<String, Object> options) {
assertValid();
RuntimeProperties sysprops = runtimeProperties.get();
CreateEnsembleOptions createEnsembleOptions = ClusterBootstrapManager.getCreateEnsembleOptions(sysprops, options);
bootstrap.get().create(createEnsembleOptions);
}
use of io.fabric8.api.CreateEnsembleOptions in project fabric8 by jboss-fuse.
the class ClusterServiceManager method removeFromCluster.
@Override
public void removeFromCluster(List<String> containers, Map<String, Object> options) {
assertValid();
RuntimeProperties sysprops = runtimeProperties.get();
CreateEnsembleOptions createEnsembleOptions = ClusterBootstrapManager.getCreateEnsembleOptions(sysprops, options);
removeFromCluster(containers, createEnsembleOptions);
}
use of io.fabric8.api.CreateEnsembleOptions in project fabric8 by jboss-fuse.
the class ZooKeeperClusterBootstrapImpl method activate.
@Activate
void activate(BundleContext bundleContext, Map<String, ?> configuration) throws Exception {
this.bundleContext = bundleContext;
this.configurer.configure(configuration, this);
BootstrapConfiguration bootConfig = bootstrapConfiguration.get();
CreateEnsembleOptions options = bootConfig.getBootstrapOptions();
if (options.isEnsembleStart()) {
startBundles(options);
}
activateComponent();
}
Aggregations