Search in sources :

Example 1 with OsgiWhiteboard

use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.

the class DocumentDiscoveryLiteService method activate.

/**
     * On activate the DocumentDiscoveryLiteService tries to start the
     * background job
     */
@Activate
public void activate(ComponentContext context) {
    logger.trace("activate: start");
    // set the ClusterStateChangeListener with the DocumentNodeStore
    this.documentNodeStore = (DocumentNodeStore) nodeStore;
    documentNodeStore.setClusterStateChangeListener(this);
    // retrieve the clusterId
    clusterNodeId = documentNodeStore.getClusterId();
    // start the background worker
    backgroundWorker = new BackgroundWorker();
    Thread th = new Thread(backgroundWorker, "DocumentDiscoveryLiteService-BackgroundWorker-[" + clusterNodeId + "]");
    th.setDaemon(true);
    th.start();
    // register the Descriptors - for Oak to pass it upwards
    if (context != null) {
        OsgiWhiteboard whiteboard = new OsgiWhiteboard(context.getBundleContext());
        whiteboard.register(Descriptors.class, new DiscoveryLiteDescriptor(), Collections.emptyMap());
    }
    logger.trace("activate: end");
}
Also used : OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) Activate(org.apache.felix.scr.annotations.Activate)

Example 2 with OsgiWhiteboard

use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.

the class ConsolidatedDataStoreCacheStats method activate.

@Activate
private void activate(BundleContext context) {
    Whiteboard wb = new OsgiWhiteboard(context);
    List<DataStoreCacheStatsMBean> allStats = cachingDataStore.getStats();
    for (DataStoreCacheStatsMBean stat : allStats) {
        registrations.add(registerMBean(wb, CacheStatsMBean.class, stat, CacheStatsMBean.TYPE, stat.getName()));
        cacheStats.add(stat);
    }
    registrations.add(registerMBean(wb, ConsolidatedDataStoreCacheStatsMBean.class, this, ConsolidatedDataStoreCacheStatsMBean.TYPE, "Consolidated DataStore Cache statistics"));
}
Also used : ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) ConsolidatedDataStoreCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean) CacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean) Whiteboard(org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) Activate(org.apache.felix.scr.annotations.Activate)

Example 3 with OsgiWhiteboard

use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.

the class BlobMigration method activate.

@Activate
private void activate(BundleContext ctx) {
    Whiteboard wb = new OsgiWhiteboard(ctx);
    migrator = new BlobMigrator((SplitBlobStore) splitBlobStore, nodeStore);
    mbeanReg = registerMBean(wb, BlobMigrationMBean.class, this, BlobMigrationMBean.TYPE, OP_NAME);
}
Also used : SplitBlobStore(org.apache.jackrabbit.oak.spi.blob.split.SplitBlobStore) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) Whiteboard(org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) Activate(org.apache.felix.scr.annotations.Activate)

Example 4 with OsgiWhiteboard

use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.

the class ConsolidatedCacheStats method activate.

@Activate
private void activate(BundleContext context) {
    Whiteboard wb = new OsgiWhiteboard(context);
    cacheStats = wb.track(CacheStatsMBean.class);
    persistentCacheStats = wb.track(PersistentCacheStatsMBean.class);
    mbeanReg = registerMBean(wb, ConsolidatedCacheStatsMBean.class, this, ConsolidatedCacheStatsMBean.TYPE, "Consolidated Cache statistics");
}
Also used : OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) PersistentCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.PersistentCacheStatsMBean) ConsolidatedCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedCacheStatsMBean) CacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean) PersistentCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.PersistentCacheStatsMBean) ConsolidatedCacheStatsMBean(org.apache.jackrabbit.oak.api.jmx.ConsolidatedCacheStatsMBean) Whiteboard(org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) Activate(org.apache.felix.scr.annotations.Activate)

Example 5 with OsgiWhiteboard

use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.

the class S3DataStoreStats method activate.

@Activate
private void activate(BundleContext context) {
    Whiteboard wb = new OsgiWhiteboard(context);
    mbeanReg = registerMBean(wb, S3DataStoreStatsMBean.class, this, S3DataStoreStatsMBean.TYPE, "S3 DataStore statistics");
}
Also used : S3DataStoreStatsMBean(org.apache.jackrabbit.oak.blob.cloud.s3.stats.S3DataStoreStatsMBean) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) Whiteboard(org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard) Activate(org.apache.felix.scr.annotations.Activate)

Aggregations

OsgiWhiteboard (org.apache.jackrabbit.oak.osgi.OsgiWhiteboard)19 Activate (org.apache.felix.scr.annotations.Activate)15 Whiteboard (org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard)9 WhiteboardExecutor (org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardExecutor)3 Hashtable (java.util.Hashtable)2 CacheStatsMBean (org.apache.jackrabbit.oak.api.jmx.CacheStatsMBean)2 BundleContext (org.osgi.framework.BundleContext)2 ThreadFactoryBuilder (com.google.common.util.concurrent.ThreadFactoryBuilder)1 File (java.io.File)1 HashMap (java.util.HashMap)1 Executor (java.util.concurrent.Executor)1 ThreadFactory (java.util.concurrent.ThreadFactory)1 MalformedObjectNameException (javax.management.MalformedObjectNameException)1 ObjectName (javax.management.ObjectName)1 Oak (org.apache.jackrabbit.oak.Oak)1 ConsolidatedCacheStatsMBean (org.apache.jackrabbit.oak.api.jmx.ConsolidatedCacheStatsMBean)1 ConsolidatedDataStoreCacheStatsMBean (org.apache.jackrabbit.oak.api.jmx.ConsolidatedDataStoreCacheStatsMBean)1 PersistentCacheStatsMBean (org.apache.jackrabbit.oak.api.jmx.PersistentCacheStatsMBean)1 S3DataStoreStatsMBean (org.apache.jackrabbit.oak.blob.cloud.s3.stats.S3DataStoreStatsMBean)1 Jcr (org.apache.jackrabbit.oak.jcr.Jcr)1