Java Code Examples for org.osgi.service.component.annotations.Activate

The following examples show how to use org.osgi.service.component.annotations.Activate. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: micro-integrator   Source File: DataServicesDSComponent.java    License: Apache License 2.0 6 votes vote down vote up
@Activate
    protected void activate(ComponentContext ctxt) {
        try {
            BundleContext bundleContext = ctxt.getBundleContext();
            bundleContext.registerService(Axis2ConfigurationContextObserver.class.getName(),
                                          new DSAxis2ConfigurationContextObserver(), null);
//            bundleContext.registerService(DSDummyService.class.getName(), new DSDummyService(), null);
//            bundleContext.registerService(TransactionManagerDummyService.class.getName(),
//                                          new TransactionManagerDummyService(), null);

            log.debug("Data Services bundle is activated ");
        } catch (Throwable e) {
            log.error(e.getMessage(), e);
            /* don't throw exception */
        }
    }
 
Example 2
@Activate
public void activate(ComponentContext context) {

    try {
        BundleContext bundleContext = context.getBundleContext();

        if (isCryptoServiceEnabled()) {
            registerServiceImplementations(bundleContext);
        } else {
            if (log.isInfoEnabled()) {
                log.debug("Crypto service is NOT enabled. "
                                  + "Therefore the key resolver and crypto provider implementations will NOT be registered.");
            }
        }

        if (log.isDebugEnabled()) {
            log.debug("'org.wso2.carbon.crypto.provider' bundle has been activated.");
        }

    } catch (Exception e) {
        String errorMessage =
                "An error occurred while activating 'org.wso2.carbon.crypto.provider' " + "component.";
        log.error(errorMessage, e);
    }
}
 
Example 3
@Activate
protected void activate(ComponentContext context) throws Exception {

    try {
        initialized = true;
        SynapseEnvironmentService synEnvService = synapseEnvironmentServices
                .get(Constants.SUPER_TENANT_ID);
        if (synEnvService != null) {
            context.getBundleContext()
                    .registerService(TaskManagementService.class.getName(), new StartupAdminService(), null);
            registerDeployer(synEnvService.getConfigurationContext().getAxisConfiguration(),
                             synEnvService.getSynapseEnvironment());
        } else {
            log.error("Couldn't initialize the StartupManager, SynapseEnvironment service and/or "
                              + "TaskDescriptionRepositoryService not found");
        }
    } catch (Throwable t) {
        log.error("Couldn't initialize the StartupManager, SynapseEnvironment service and/or "
                          + "TaskDescriptionRepositoryService not found");
    }
}
 
Example 4
@Activate
protected void activate(ComponentContext ctxt) {

    this.compCtx = ctxt;
    // Check whether statistic collecting is globally enabled
    checkPublishingEnabled();
    if (!flowStatisticsEnabled) {
        activated = false;
        if (log.isDebugEnabled()) {
            log.debug("DAS Message Flow Publishing Component not-activated");
        }
        return;
    }
    int tenantId = Constants.SUPER_TENANT_ID;
    SynapseEnvironmentService synapseEnvService = synapseEnvServices.get(tenantId);
    // Create observer store for super-tenant
    createStores(synapseEnvService);
    activated = true;
    if (log.isDebugEnabled()) {
        log.debug("DAS Message Flow Publishing Component activate");
    }
}
 
Example 5
@Activate
protected void activate(ComponentContext ctxt) {

    WebsocketTransportService WebsocketTransport;
    SecureWebsocketTransportService SecureWebsocketTransport;
    if (log.isDebugEnabled()) {
        log.debug("Websocket Transport bundle is activated");
    }
    try {
        if (contextService == null) {
            throw new Exception("ConfigurationContext is not found while loading websocket transport bundle");
        }

        WebsocketTransport = new WebsocketTransportService();
        SecureWebsocketTransport = new SecureWebsocketTransportService();
        ctxt.getBundleContext().registerService(TransportService.class.getName(), WebsocketTransport, null);
        ctxt.getBundleContext().registerService(TransportService.class.getName(), SecureWebsocketTransport, null);
        if (log.isDebugEnabled()) {
            log.debug("Successfully registered the ws(s) transport service");
        }
    } catch (Throwable e) {
        log.error("Error while activating Websocket transport management bundle", e);
    }
}
 
Example 6
Source Project: ngsdn-tutorial   Source File: MainComponent.java    License: Apache License 2.0 6 votes vote down vote up
@Activate
protected void activate() {
    appId = coreService.registerApplication(APP_NAME);

    // Wait to remove flow and groups from previous executions.
    waitPreviousCleanup();

    compCfgService.preSetProperty("org.onosproject.net.flow.impl.FlowRuleManager",
                                  "fallbackFlowPollFrequency", "4", false);
    compCfgService.preSetProperty("org.onosproject.net.group.impl.GroupManager",
                                  "fallbackGroupPollFrequency", "3", false);
    compCfgService.preSetProperty("org.onosproject.provider.host.impl.HostLocationProvider",
                                  "requestIpv6ND", "true", false);
    compCfgService.preSetProperty("org.onosproject.provider.lldp.impl.LldpLinkProvider",
                                  "useBddp", "false", false);

    configRegistry.registerConfigFactory(fabricConfigFactory);
    log.info("Started");
}
 
Example 7
Source Project: onos-p4-tutorial   Source File: MainComponent.java    License: Apache License 2.0 6 votes vote down vote up
@Activate
protected void activate() {
    appId = coreService.registerApplication(APP_NAME);

    // Wait to remove flow and groups from previous executions.
    waitPreviousCleanup();

    compCfgService.preSetProperty("org.onosproject.net.flow.impl.FlowRuleManager",
                                  "fallbackFlowPollFrequency", "4", false);
    compCfgService.preSetProperty("org.onosproject.net.group.impl.GroupManager",
                                  "fallbackGroupPollFrequency", "3", false);
    compCfgService.preSetProperty("org.onosproject.provider.host.impl.HostLocationProvider",
                                  "requestIpv6ND", "true", false);

    configRegistry.registerConfigFactory(srv6ConfigFactory);
    log.info("Started");
}
 
Example 8
Source Project: onos-p4-tutorial   Source File: MainComponent.java    License: Apache License 2.0 6 votes vote down vote up
@Activate
protected void activate() {
    appId = coreService.registerApplication(APP_NAME);

    // Wait to remove flow and groups from previous executions.
    waitPreviousCleanup();

    compCfgService.preSetProperty("org.onosproject.net.flow.impl.FlowRuleManager",
                                  "fallbackFlowPollFrequency", "4", false);
    compCfgService.preSetProperty("org.onosproject.net.group.impl.GroupManager",
                                  "fallbackGroupPollFrequency", "3", false);
    compCfgService.preSetProperty("org.onosproject.provider.host.impl.HostLocationProvider",
                                  "requestIpv6ND", "true", false);

    configRegistry.registerConfigFactory(srv6ConfigFactory);
    log.info("Started");
}
 
Example 9
Source Project: sling-whiteboard   Source File: SAML2ConfigServiceImpl.java    License: Apache License 2.0 6 votes vote down vote up
@Activate
protected void activate(final AuthenticationHandlerSAML2Config config, ComponentContext componentContext) {
    this.path = config.path();
    this.saml2SessAttr = config.saml2SessionAttr();
    this.saml2SPEnabled = config.saml2SPEnabled();
    this.saml2IDPDestination = config.saml2IDPDestination();
    this.uidAttrName = config.saml2userIDAttr();
    this.samlUserHome = config.saml2userHome();
    this.groupMembershipName = config.saml2groupMembershipAttr();
    this.entityID = config.entityID();
    this.jksFileLocation = config.jksFileLocation();
    this.jksStorePassword = config.jksStorePassword();
    this.spKeysAlias = config.spKeysAlias();
    this.spKeysPassword = config.spKeysPassword();
    this.idpCertAlias = config.idpCertAlias();
    this.acsPath = config.acsPath();
    this.syncAttrs = config.syncAttrs();
}
 
Example 10
@Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 10, TimeUnit.MINUTE);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 11
@Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 45, TimeUnit.SECOND);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 12
@Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 1, TimeUnit.DAY);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 13
@Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 4, TimeUnit.HOUR);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 14
@Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 12, TimeUnit.HOUR);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 15
@Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 10, TimeUnit.MINUTE);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 16
@Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 1, TimeUnit.DAY);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 17
/**
 * Adds the URL paths for all custom core JSPs to a list when the module is
 * activated.
 *
 * @param bundleContext the bundle context from which to get the custom
 *        JSP's bundle
 */
@Activate
protected void activate(BundleContext bundleContext) {
	_bundle = bundleContext.getBundle();

	_customJsps = new ArrayList<>();

	Enumeration<URL> entries = _bundle.findEntries(
		getCustomJspDir(), "*.jsp", true);

	while (entries.hasMoreElements()) {
		URL url = entries.nextElement();

		_customJsps.add(url.getPath());
	}
}
 
Example 18
/**
	   * activate: Called whenever the properties for the component change (ala Config Admin)
	   * or OSGi is activating the component.
	   * @param properties The properties map from Config Admin.
	   * @throws SchedulerException in case of error.
	   */
	  @Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 10, TimeUnit.MINUTE);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 19
/**
	   * activate: Called whenever the properties for the component change (ala Config Admin)
	   * or OSGi is activating the component.
	   * @param properties The properties map from Config Admin.
	   * @throws SchedulerException in case of error.
	   */
	  @Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 10, TimeUnit.MINUTE);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 20
/**
	   * activate: Called whenever the properties for the component change (ala Config Admin)
	   * or OSGi is activating the component.
	   * @param properties The properties map from Config Admin.
	   * @throws SchedulerException in case of error.
	   */
	  @Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 10, TimeUnit.MINUTE);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 21
Source Project: opencps-v2   Source File: Hourly.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
/**
	   * activate: Called whenever the properties for the component change (ala Config Admin)
	   * or OSGi is activating the component.
	   * @param properties The properties map from Config Admin.
	   * @throws SchedulerException in case of error.
	   */
	  @Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 1, TimeUnit.HOUR);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 22
Source Project: opencps-v2   Source File: Daily.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
/**
	   * activate: Called whenever the properties for the component change (ala Config Admin)
	   * or OSGi is activating the component.
	   * @param properties The properties map from Config Admin.
	   * @throws SchedulerException in case of error.
	   */
	  @Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 1, TimeUnit.DAY);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 23
Source Project: opencps-v2   Source File: OneMinute.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
/**
	   * activate: Called whenever the properties for the component change (ala Config Admin)
	   * or OSGi is activating the component.
	   * @param properties The properties map from Config Admin.
	   * @throws SchedulerException in case of error.
	   */
	  @Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 1, TimeUnit.MINUTE);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 24
/**
	   * activate: Called whenever the properties for the component change (ala Config Admin)
	   * or OSGi is activating the component.
	   * @param properties The properties map from Config Admin.
	   * @throws SchedulerException in case of error.
	   */
	  @Activate
	  @Modified
	  protected void activate(Map<String,Object> properties) throws SchedulerException {
		  String listenerClass = getClass().getName();
		  Trigger jobTrigger = _triggerFactory.createTrigger(listenerClass, listenerClass, new Date(), null, 15, TimeUnit.MINUTE);

		  _schedulerEntryImpl = new SchedulerEntryImpl(getClass().getName(), jobTrigger);
		  _schedulerEntryImpl = new StorageTypeAwareSchedulerEntryImpl(_schedulerEntryImpl, StorageType.MEMORY_CLUSTERED);
		  
//		  _schedulerEntryImpl.setTrigger(jobTrigger);

		  if (_initialized) {
			  deactivate();
		  }

	    _schedulerEngineHelper.register(this, _schedulerEntryImpl, DestinationNames.SCHEDULER_DISPATCH);
	    _initialized = true;
	  }
 
Example 25
Source Project: micro-integrator   Source File: ServiceComponent.java    License: Apache License 2.0 5 votes vote down vote up
@Activate
protected void activate(ComponentContext ctxt) {
    try {
        engagePoxSecurity();
        String lazyInit = System.getProperty(SecurityConstants.MI_SECURITY_USERMGT_LAZY_INIT);
        if (lazyInit == null || Boolean.parseBoolean(lazyInit)) {
            log.debug("Initializing Security parameters lazily");
        } else {
            log.debug("Initializing Security parameters eagerly");
            initSecurityParams();
        }
    } catch (Throwable e) {
        log.error("Failed to activate Micro Integrator security bundle ", e);
    }
}
 
Example 26
Source Project: micro-integrator   Source File: CryptoImplComponent.java    License: Apache License 2.0 5 votes vote down vote up
@Activate
public void activate(ComponentContext context) {

    try {
        BundleContext bundleContext = context.getBundleContext();

        cryptoServiceRegistration = bundleContext
                .registerService(CryptoService.class, this.defaultCryptoService, null);

        if (log.isDebugEnabled()) {
            log.debug(String.format("'%s' has been registered as an implementation of '%s'",
                                    defaultCryptoService.getClass().getCanonicalName(),
                                    CryptoService.class.getCanonicalName()));
        }

        privateKeyRetrieverRegistration = bundleContext
                .registerService(PrivateKeyRetriever.class, this.defaultCryptoService, null);

        if (log.isDebugEnabled()) {
            log.debug(String.format("'%s' has been registered as an implementation of '%s'",
                                    defaultCryptoService.getClass().getCanonicalName(),
                                    PrivateKeyRetriever.class.getCanonicalName()));
            log.debug("'org.wso2.carbon.crypto.impl' bundle has been activated.");
        }

    } catch (Exception e) {
        String errorMessage = "An error occurred while activating org.wso2.carbon.crypto.impl component";
        log.error(errorMessage, e);
    }
}
 
Example 27
Source Project: micro-integrator   Source File: NtaskService.java    License: Apache License 2.0 5 votes vote down vote up
@Activate
protected void activate(ComponentContext context) {

    try {

        logger.debug("ntask-integration bundle is activated.");
    } catch (Throwable e) {
        logger.error("Could not activate NTaskService. Error: " + e.getMessage(), e);
    }
}
 
Example 28
@Activate
protected void activate(ComponentContext ctx) throws Exception {

    log.debug("Activating Inbound Endpoint Persistence service....!");

    BundleContext bndCtx = ctx.getBundleContext();
    bndCtx.registerService(InboundEndpointPersistenceService.class.getName(),
                           new InboundEndpointPersistenceServiceImpl(), null);
}
 
Example 29
@Activate
protected void activate(ComponentContext ctx) throws Exception {

    log.debug("Activating Inbound Endpoint service....!");

    BundleContext bndCtx = ctx.getBundleContext();
    bndCtx.registerService(InboundEndpointService.class.getName(), new InboundEndpointServiceImpl(), null);
}
 
Example 30
@Activate
protected synchronized void activate(ComponentContext ctx) {
	this.ctx = ctx;
	if (log.isDebugEnabled()) {
		log.debug("DataSourceServiceComponent activated");
	}
       /** Attempting to load the DatasourceRepository implementation class defined in carbon.xml
       .* If it is not there it will use default implementation
        */
       String carbonDataSourceRepositoryClassName =
	        MicroIntegratorBaseUtils.getServerConfiguration().getFirstProperty(
                       DATA_SOURCE_REPO_CLASS_TAG);
       if(carbonDataSourceRepositoryClassName!=null){
           try {
               carbonDataSourceRepositoryClass=(Class<DataSourceRepository>) this.getClass()
                       .getClassLoader().loadClass
                               (carbonDataSourceRepositoryClassName);
           } catch (ClassNotFoundException e) {
               log.warn("The specified DataSourceRepositoryClass "
                       + carbonDataSourceRepositoryClassName + " is not there in the class " +
                       "path.Using the default DataSourceRepositoryClass ", e);
           }
       }
	/* if the user data sources are already initialized before setting the ctx,
	 * that means the services aren't registered yet, so we should do it now */
	if (this.tenantUserDataSourcesInitialized) {
		this.registerServices();
	}
}