use of org.osgi.service.component.annotations.Activate in project carbon-apimgt by wso2.
the class ApimgtNotificationServiceComponent method activate.
@Activate
protected void activate(ComponentContext ctxt) {
ctxt.getBundleContext().registerService(KeyManagerEventHandler.class, new DefaultKeyManagerEventHandlerImpl(), null);
ctxt.getBundleContext().registerService(EventHandler.class, new WebhooksSubscriptionEventHandler(), null);
ctxt.getBundleContext().registerService(EventHandler.class, new WebhooksDeliveryEventHandler(), null);
ctxt.getBundleContext().registerService(NotificationEventService.class, new NotificationEventService(), null);
}
use of org.osgi.service.component.annotations.Activate in project carbon-apimgt by wso2.
the class ExtendedHTTPEventAdapterServiceDS method activate.
@Activate
protected void activate(ComponentContext context) {
ExtendedHTTPEventAdapterFactory extendedHttpEventAdaptorFactory = new ExtendedHTTPEventAdapterFactory();
BundleContext bundleContext = context.getBundleContext();
bundleContext.registerService(OutputEventAdapterFactory.class.getName(), extendedHttpEventAdaptorFactory, null);
if (log.isDebugEnabled()) {
log.debug("Successfully deployed the Extended Http event adaptor service");
}
}
use of org.osgi.service.component.annotations.Activate in project flow by vaadin.
the class Activator method activate.
@Activate
void activate() throws NamespaceException {
BundleContext context = FrameworkUtil.getBundle(Activator.class).getBundleContext();
context.registerService(Servlet.class, new FixedViewServlet(), createProperties("/view/*", false));
context.registerService(Servlet.class, new FixedViewServlet(), createProperties("/context/*", false));
context.registerService(Servlet.class, new FixedRouterServlet(), createProperties("/new-router-session/*", false));
context.registerService(Servlet.class, new FixedProductionModeViewServlet(), createProperties("/view-production/*", true));
context.registerService(Servlet.class, new FixedProductionModeTimingDataViewServlet(), createProperties("/view-production-timing/*", true));
context.registerService(Servlet.class, new FixedLogoutWithNotificationServlet(), createProperties("/logout-with-notification/*", false));
context.registerService(Servlet.class, new FixedRouterLayoutCustomScopeServlet(), createProperties("/router-layout-custom-scope/*", false));
registerPlainJsResource(context);
String contextName = registerCustomContext(context);
registerCustomContextServlet(context, contextName);
}
use of org.osgi.service.component.annotations.Activate in project openems by OpenEMS.
the class JsonPersistenceManager method activate.
@Activate
void activate() {
// Load default configuration
loadDefaultConfig();
// read Json from file
JsonObject jConfig;
try {
jConfig = ConfigUtils.readConfigFromFile(configFile);
} catch (Exception e) {
log.error(e.getMessage());
return;
}
// parse config + fill configMap
parseJsonToConfigMap(jConfig);
}
use of org.osgi.service.component.annotations.Activate in project fuse-karaf by jboss-fuse.
the class PatchServiceImpl method activate.
@Activate
void activate(ComponentContext componentContext) throws IOException {
// Use system bundle' bundle context to avoid running into
// "Invalid BundleContext" exceptions when updating bundles
bundleContext = componentContext.getBundleContext().getBundle(0).getBundleContext();
pool = Executors.newFixedThreadPool(1, ThreadUtils.namedThreadFactory("patch-service"));
String dir = this.bundleContext.getProperty(PATCH_LOCATION);
if (dir != null) {
patchDir = new File(dir);
} else {
patchDir = new File(bundleContext.getProperty("karaf.home"), "patches");
LOG.info("Can't find {} property, defaulting to {}", PATCH_LOCATION, patchDir.getCanonicalPath());
}
if (!patchDir.isDirectory()) {
Utils.mkdirs(patchDir);
if (!patchDir.isDirectory()) {
throw new PatchException("Unable to create patch folder");
}
}
this.karafHome = new File(bundleContext.getProperty("karaf.home"));
this.repository = new File(bundleContext.getProperty("karaf.default.repository"));
helper = new OSGiPatchHelper(karafHome, bundleContext);
load(true);
bootTracker = new BootDoneTracker(bundleContext);
bootTracker.open();
}
Aggregations