Search in sources :

Example 6 with BundleFunctionLoader

use of org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader in project whirr by apache.

the class Activator method start.

/**
 * Called when this bundle is started so the Framework can perform the
 * bundle-specific activities necessary to start this bundle. This method
 * can be used to register services or to allocate any resources that this
 * bundle needs.
 * <p/>
 * <p/>
 * This method must complete and return to its caller in a timely manner.
 *
 * @param context The execution context of the bundle being started.
 * @throws Exception If this method throws an exception, this
 *                   bundle is marked as stopped and the Framework will remove this
 *                   bundle's listeners, unregister all services registered by this
 *                   bundle, and release all services used by this bundle.
 */
@Override
public void start(BundleContext context) throws Exception {
    // Initialize OSGi based FunctionLoader
    functionLoader = new BundleFunctionLoader(context);
    functionLoader.start();
    Properties props = new Properties();
    props.put("name", "zookeeper");
    registration = context.registerService(ClusterActionHandler.class.getName(), clusterActionHandler, props);
}
Also used : BundleFunctionLoader(org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader) Properties(java.util.Properties)

Example 7 with BundleFunctionLoader

use of org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader in project whirr by apache.

the class Activator method start.

/**
 * Called when this bundle is started so the Framework can perform the
 * bundle-specific activities necessary to start this bundle. This method
 * can be used to register services or to allocate any resources that this
 * bundle needs.
 * <p/>
 * <p/>
 * This method must complete and return to its caller in a timely manner.
 *
 * @param context The execution context of the bundle being started.
 * @throws Exception If this method throws an exception, this
 *                   bundle is marked as stopped and the Framework will remove this
 *                   bundle's listeners, unregister all services registered by this
 *                   bundle, and release all services used by this bundle.
 */
@Override
public void start(BundleContext context) throws Exception {
    // Initialize OSGi based FunctionLoader
    functionLoader = new BundleFunctionLoader(context);
    functionLoader.start();
    Properties props = new Properties();
    props.put("name", "mahout-client");
    registration = context.registerService(ClusterActionHandler.class.getName(), clusterActionHandler, props);
}
Also used : BundleFunctionLoader(org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader) Properties(java.util.Properties)

Example 8 with BundleFunctionLoader

use of org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader in project whirr by apache.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    functionLoader = new BundleFunctionLoader(context);
    functionLoader.start();
    Properties clientProps = new Properties();
    clientProps.put("name", KerberosClientHandler.ROLE);
    clientRegistration = context.registerService(ClusterActionHandler.class.getName(), clientActionHandler, clientProps);
    Properties serverProps = new Properties();
    serverProps.put("name", KerberosServerHandler.ROLE);
    serverRegistration = context.registerService(ClusterActionHandler.class.getName(), serverClusterActionHandler, serverProps);
}
Also used : BundleFunctionLoader(org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader) Properties(java.util.Properties)

Example 9 with BundleFunctionLoader

use of org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader in project whirr by apache.

the class Activator method start.

/**
 * Called when this bundle is started so the Framework can perform the
 * bundle-specific activities necessary to start this bundle. This method
 * can be used to register services or to allocate any resources that this
 * bundle needs.
 * <p/>
 * <p/>
 * This method must complete and return to its caller in a timely manner.
 *
 * @param context The execution context of the bundle being started.
 * @throws Exception If this method throws an exception, this
 *                   bundle is marked as stopped and the Framework will remove this
 *                   bundle's listeners, unregister all services registered by this
 *                   bundle, and release all services used by this bundle.
 */
@Override
public void start(BundleContext context) throws Exception {
    // Initialize OSGi based FunctionLoader
    functionLoader = new BundleFunctionLoader(context);
    functionLoader.start();
    factoryRegistration = context.registerService(ClusterActionHandlerFactory.class.getName(), actionHandlerFactory, null);
    Properties props = new Properties();
    props.put("name", "puppet-install");
    handlerRegistration = context.registerService(ClusterActionHandler.class.getName(), clusterActionHandler, props);
}
Also used : BundleFunctionLoader(org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader) Properties(java.util.Properties)

Example 10 with BundleFunctionLoader

use of org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader in project whirr by apache.

the class Activator method start.

/**
 * Called when this bundle is started so the Framework can perform the
 * bundle-specific activities necessary to start this bundle. This method
 * can be used to register services or to allocate any resources that this
 * bundle needs.
 * <p/>
 * <p/>
 * This method must complete and return to its caller in a timely manner.
 *
 * @param context The execution context of the bundle being started.
 * @throws Exception If this method throws an exception, this
 *                   bundle is marked as stopped and the Framework will remove this
 *                   bundle's listeners, unregister all services registered by this
 *                   bundle, and release all services used by this bundle.
 */
@Override
public void start(BundleContext context) throws Exception {
    // Initialize OSGi based FunctionLoader
    functionLoader = new BundleFunctionLoader(context);
    functionLoader.start();
    Properties masterProps = new Properties();
    masterProps.put("name", "hbase-master");
    masterRegistration = context.registerService(ClusterActionHandler.class.getName(), masterClusterActionHandler, masterProps);
    Properties regionServerProps = new Properties();
    regionServerProps.put("name", "hbase-regionserver");
    regionServerRegistration = context.registerService(ClusterActionHandler.class.getName(), regionServerClusterActionHandler, regionServerProps);
    Properties restServerProps = new Properties();
    restServerProps.put("name", "hbase-restserver");
    restServerRegistration = context.registerService(ClusterActionHandler.class.getName(), restServerClusterActionHandler, restServerProps);
    Properties avroServerProps = new Properties();
    avroServerProps.put("name", "hbase-avroserver");
    avroServerRegistration = context.registerService(ClusterActionHandler.class.getName(), avroServerClusterActionHandler, avroServerProps);
    Properties thriftServerProps = new Properties();
    thriftServerProps.put("name", "hbase-thriftserver");
    thriftServerRegistration = context.registerService(ClusterActionHandler.class.getName(), thriftServerClusterActionHandler, thriftServerProps);
}
Also used : BundleFunctionLoader(org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader) Properties(java.util.Properties)

Aggregations

BundleFunctionLoader (org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader)17 Properties (java.util.Properties)16 ByonClusterController (org.apache.whirr.ByonClusterController)1 ClusterController (org.apache.whirr.ClusterController)1 ClusterActionHandler (org.apache.whirr.service.ClusterActionHandler)1 ComputeService (org.jclouds.compute.ComputeService)1 ServiceReference (org.osgi.framework.ServiceReference)1 ServiceTracker (org.osgi.util.tracker.ServiceTracker)1