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);
}
}
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();
}
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);
}
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;
}
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());
}
Aggregations