Search in sources :

Example 36 with Activate

use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.

the class FabricJaasRealm method activate.

@Activate
void activate(BundleContext bundleContext, Map<String, Object> configuration) {
    Map<String, Object> options = new HashMap<String, Object>();
    options.putAll(configuration);
    options.put(BundleContext.class.getName(), bundleContext);
    options.put(ProxyLoginModule.PROPERTY_MODULE, ZK_LOGIN_MODULE);
    options.put(ProxyLoginModule.PROPERTY_BUNDLE, Long.toString(bundleContext.getBundle().getBundleId()));
    enties.add(new AppConfigurationEntry(ProxyLoginModule.class.getName(), AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, options));
    activateComponent();
}
Also used : AppConfigurationEntry(javax.security.auth.login.AppConfigurationEntry) HashMap(java.util.HashMap) BundleContext(org.osgi.framework.BundleContext) Activate(org.apache.felix.scr.annotations.Activate)

Example 37 with Activate

use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.

the class AutoScaleController method activate.

@Activate
void activate() {
    CuratorFramework curator = this.curator.get();
    enableMasterZkCache(curator);
    group = new ZooKeeperGroup<AutoScalerNode>(curator, ZkPath.AUTO_SCALE_CLUSTER.getPath(), AutoScalerNode.class);
    group.add(this);
    group.update(createState());
    group.start();
    activateComponent();
}
Also used : CuratorFramework(org.apache.curator.framework.CuratorFramework) Activate(org.apache.felix.scr.annotations.Activate)

Example 38 with Activate

use of org.apache.felix.scr.annotations.Activate 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();
}
Also used : NodeCacheExtended(org.apache.curator.framework.recipes.cache.NodeCacheExtended) Activate(org.apache.felix.scr.annotations.Activate)

Example 39 with Activate

use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.

the class ClusterBootstrapManager method activate.

@Activate
void activate() throws Exception {
    StandardMBean mbean = new StandardMBean(this, ClusterBootstrapManagerMBean.class);
    JMXUtils.registerMBean(mbean, mbeanServer.get(), OBJECT_NAME);
    activateComponent();
}
Also used : StandardMBean(javax.management.StandardMBean) Activate(org.apache.felix.scr.annotations.Activate)

Example 40 with Activate

use of org.apache.felix.scr.annotations.Activate in project fabric8 by jboss-fuse.

the class ClusterServiceManager method activate.

@Activate
void activate() throws Exception {
    StandardMBean mbean = new StandardMBean(this, ClusterServiceManagerMBean.class);
    JMXUtils.registerMBean(mbean, mbeanServer.get(), OBJECT_NAME);
    activateComponent();
}
Also used : StandardMBean(javax.management.StandardMBean) Activate(org.apache.felix.scr.annotations.Activate)

Aggregations

Activate (org.apache.felix.scr.annotations.Activate)153 ConfigurationException (org.osgi.service.cm.ConfigurationException)31 ServiceTracker (org.osgi.util.tracker.ServiceTracker)20 BundleContext (org.osgi.framework.BundleContext)19 File (java.io.File)15 OsgiWhiteboard (org.apache.jackrabbit.oak.osgi.OsgiWhiteboard)12 URL (java.net.URL)11 Hashtable (java.util.Hashtable)11 ServiceReference (org.osgi.framework.ServiceReference)11 ServiceTrackerCustomizer (org.osgi.util.tracker.ServiceTrackerCustomizer)9 HashSet (java.util.HashSet)8 IOException (java.io.IOException)7 HashMap (java.util.HashMap)7 Map (java.util.Map)6 Session (javax.jcr.Session)5 StandardMBean (javax.management.StandardMBean)5 Whiteboard (org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard)5 Filter (org.osgi.framework.Filter)5 InputStream (java.io.InputStream)4 ArrayList (java.util.ArrayList)4