Search in sources :

Example 1 with WorkflowTenantMgtListener

use of org.wso2.carbon.identity.workflow.mgt.listener.WorkflowTenantMgtListener in project carbon-identity-framework by wso2.

the class WorkflowMgtServiceComponent method activate.

@Activate
protected void activate(ComponentContext context) {
    try {
        BundleContext bundleContext = context.getBundleContext();
        WorkflowManagementService workflowService = new WorkflowManagementServiceImpl();
        bundleContext.registerService(WorkflowManagementService.class, workflowService, null);
        AbstractEventHandler workflowPendingUserAuthnHandler = new WorkflowPendingUserAuthnHandler();
        bundleContext.registerService(AbstractEventHandler.class, workflowPendingUserAuthnHandler, null);
        WorkflowServiceDataHolder.getInstance().setWorkflowService(workflowService);
        WorkflowServiceDataHolder.getInstance().setBundleContext(bundleContext);
        ServiceRegistration serviceRegistration = context.getBundleContext().registerService(WorkflowListener.class.getName(), new WorkflowAuditLogger(), null);
        context.getBundleContext().registerService(WorkflowExecutorManagerListener.class.getName(), new WorkflowExecutorAuditLogger(), null);
        context.getBundleContext().registerService(TenantMgtListener.class.getName(), new WorkflowTenantMgtListener(), null);
        if (serviceRegistration != null) {
            if (log.isDebugEnabled()) {
                log.debug("WorkflowAuditLogger registered.");
            }
        } else {
            log.error("Workflow Audit Logger could not be registered.");
        }
        if (System.getProperty(WFConstant.KEYSTORE_SYSTEM_PROPERTY_ID) == null) {
            System.setProperty(WFConstant.KEYSTORE_SYSTEM_PROPERTY_ID, ServerConfiguration.getInstance().getFirstProperty(WFConstant.KEYSTORE_CARBON_CONFIG_PATH));
        }
        if (System.getProperty(WFConstant.KEYSTORE_PASSWORD_SYSTEM_PROPERTY_ID) == null) {
            System.setProperty(WFConstant.KEYSTORE_PASSWORD_SYSTEM_PROPERTY_ID, ServerConfiguration.getInstance().getFirstProperty(WFConstant.KEYSTORE_PASSWORD_CARBON_CONFIG_PATH));
        }
    } catch (Throwable e) {
        log.error("Failed to start the WorkflowMgtServiceComponent", e);
    }
}
Also used : WorkflowAuditLogger(org.wso2.carbon.identity.workflow.mgt.listener.WorkflowAuditLogger) WorkflowPendingUserAuthnHandler(org.wso2.carbon.identity.workflow.mgt.handler.WorkflowPendingUserAuthnHandler) WorkflowListener(org.wso2.carbon.identity.workflow.mgt.listener.WorkflowListener) WorkflowManagementService(org.wso2.carbon.identity.workflow.mgt.WorkflowManagementService) TenantMgtListener(org.wso2.carbon.stratos.common.listeners.TenantMgtListener) WorkflowTenantMgtListener(org.wso2.carbon.identity.workflow.mgt.listener.WorkflowTenantMgtListener) WorkflowTenantMgtListener(org.wso2.carbon.identity.workflow.mgt.listener.WorkflowTenantMgtListener) AbstractEventHandler(org.wso2.carbon.identity.event.handler.AbstractEventHandler) WorkflowExecutorManagerListener(org.wso2.carbon.identity.workflow.mgt.listener.WorkflowExecutorManagerListener) WorkflowExecutorAuditLogger(org.wso2.carbon.identity.workflow.mgt.listener.WorkflowExecutorAuditLogger) BundleContext(org.osgi.framework.BundleContext) WorkflowManagementServiceImpl(org.wso2.carbon.identity.workflow.mgt.WorkflowManagementServiceImpl) ServiceRegistration(org.osgi.framework.ServiceRegistration) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

BundleContext (org.osgi.framework.BundleContext)1 ServiceRegistration (org.osgi.framework.ServiceRegistration)1 Activate (org.osgi.service.component.annotations.Activate)1 AbstractEventHandler (org.wso2.carbon.identity.event.handler.AbstractEventHandler)1 WorkflowManagementService (org.wso2.carbon.identity.workflow.mgt.WorkflowManagementService)1 WorkflowManagementServiceImpl (org.wso2.carbon.identity.workflow.mgt.WorkflowManagementServiceImpl)1 WorkflowPendingUserAuthnHandler (org.wso2.carbon.identity.workflow.mgt.handler.WorkflowPendingUserAuthnHandler)1 WorkflowAuditLogger (org.wso2.carbon.identity.workflow.mgt.listener.WorkflowAuditLogger)1 WorkflowExecutorAuditLogger (org.wso2.carbon.identity.workflow.mgt.listener.WorkflowExecutorAuditLogger)1 WorkflowExecutorManagerListener (org.wso2.carbon.identity.workflow.mgt.listener.WorkflowExecutorManagerListener)1 WorkflowListener (org.wso2.carbon.identity.workflow.mgt.listener.WorkflowListener)1 WorkflowTenantMgtListener (org.wso2.carbon.identity.workflow.mgt.listener.WorkflowTenantMgtListener)1 TenantMgtListener (org.wso2.carbon.stratos.common.listeners.TenantMgtListener)1