Search in sources :

Example 86 with Activate

use of org.osgi.service.component.annotations.Activate in project bndtools by bndtools.

the class GitHubWorkspaceTemplateLoader method activate.

@Activate
void activate() {
    if (promiseFactory == null) {
        localExecutor = Executors.newCachedThreadPool();
        promiseFactory = new PromiseFactory(localExecutor);
    }
}
Also used : PromiseFactory(org.osgi.util.promise.PromiseFactory) Activate(org.osgi.service.component.annotations.Activate)

Example 87 with Activate

use of org.osgi.service.component.annotations.Activate in project smarthome by eclipse.

the class FolderObserver method activate.

@Activate
public void activate(ComponentContext ctx) {
    Dictionary<String, Object> config = ctx.getProperties();
    Enumeration<String> keys = config.keys();
    while (keys.hasMoreElements()) {
        String foldername = keys.nextElement();
        if (!StringUtils.isAlphanumeric(foldername)) {
            // properties
            continue;
        }
        String[] fileExts = ((String) config.get(foldername)).split(",");
        File folder = getFile(foldername);
        if (folder.exists() && folder.isDirectory()) {
            folderFileExtMap.put(foldername, fileExts);
        } else {
            logger.warn("Directory '{}' does not exist in '{}'. Please check your configuration settings!", foldername, ConfigConstants.getConfigFolder());
        }
    }
    addModelsToRepo();
    super.activate();
}
Also used : File(java.io.File) Activate(org.osgi.service.component.annotations.Activate)

Example 88 with Activate

use of org.osgi.service.component.annotations.Activate in project smarthome by eclipse.

the class SemanticsMetadataProvider method activate.

@Activate
protected void activate() {
    initRelations();
    for (Item item : itemRegistry.getAll()) {
        processItem(item);
    }
    itemRegistry.addRegistryChangeListener(this);
}
Also used : GroupItem(org.eclipse.smarthome.core.items.GroupItem) Item(org.eclipse.smarthome.core.items.Item) Activate(org.osgi.service.component.annotations.Activate)

Example 89 with Activate

use of org.osgi.service.component.annotations.Activate in project smarthome by eclipse.

the class ThingManagerImpl method activate.

@Activate
protected synchronized void activate(ComponentContext componentContext) {
    readyService.registerTracker(this, new ReadyMarkerFilter().withType(XML_THING_TYPE));
    for (ThingHandlerFactory factory : thingHandlerFactories) {
        handleThingHandlerFactoryAddition(getBundleName(factory));
    }
    thingRegistry.addThingTracker(this);
    active = true;
}
Also used : ReadyMarkerFilter(org.eclipse.smarthome.core.service.ReadyMarkerFilter) ThingHandlerFactory(org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory) Activate(org.osgi.service.component.annotations.Activate)

Example 90 with Activate

use of org.osgi.service.component.annotations.Activate in project smarthome by eclipse.

the class MapDbStorageService method activate.

@Activate
public void activate() {
    dbFolderName = ConfigConstants.getUserDataFolder() + File.separator + dbFolderName;
    File folder = new File(dbFolderName);
    if (!folder.exists()) {
        folder.mkdirs();
    }
    File dbFile = new File(dbFolderName, DB_FILE_NAME);
    db = DBMaker.newFileDB(dbFile).closeOnJvmShutdown().make();
    logger.debug("Opened MapDB file at '{}'.", dbFile.getAbsolutePath());
}
Also used : File(java.io.File) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

Activate (org.osgi.service.component.annotations.Activate)100 BundleContext (org.osgi.framework.BundleContext)13 File (java.io.File)8 OsgiWhiteboard (org.apache.jackrabbit.oak.osgi.OsgiWhiteboard)7 IOException (java.io.IOException)6 Hashtable (java.util.Hashtable)6 ResourceResolver (org.apache.sling.api.resource.ResourceResolver)5 FinderPath (com.liferay.portal.kernel.dao.orm.FinderPath)4 ArrayList (java.util.ArrayList)4 Properties (java.util.Properties)3 ServiceReference (org.osgi.framework.ServiceReference)3 PromiseFactory (org.osgi.util.promise.PromiseFactory)3 ServerStartupObserver (org.wso2.carbon.core.ServerStartupObserver)3 JsonObject (com.google.gson.JsonObject)2 Date (java.util.Date)2 Dictionary (java.util.Dictionary)2 ObjectName (javax.management.ObjectName)2 Whiteboard (org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard)2 WhiteboardExecutor (org.apache.jackrabbit.oak.spi.whiteboard.WhiteboardExecutor)2 LoginException (org.apache.sling.api.resource.LoginException)2