Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2014 JBoss by Red Hat.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.jbpm.services.cdi.impl;
 
 import  javax.enterprise.context.ApplicationScoped;
 import  javax.enterprise.event.Event;
 import  javax.enterprise.inject.Instance;
 import  javax.enterprise.inject.spi.BeanManager;
 import  javax.inject.Inject;
 import  javax.persistence.EntityManagerFactory;
 import  javax.persistence.PersistenceUnit;
 
 import  org.jbpm.kie.services.impl.KModuleDeploymentService;
 import  org.jbpm.kie.services.impl.KModuleDeploymentUnit;
 import  org.jbpm.process.audit.event.AuditEventBuilder;
 import  org.jbpm.services.api.DefinitionService;
 import  org.jbpm.services.api.DeploymentEvent;
 import  org.jbpm.services.api.RuntimeDataService;
 import  org.jbpm.services.api.model.DeployedUnit;
 import  org.jbpm.services.api.model.DeploymentUnit;
 import  org.kie.api.runtime.KieContainer;
 import  org.kie.api.runtime.manager.RegisterableItemsFactory;
 import  org.kie.api.runtime.manager.RuntimeManagerFactory;
 import  org.kie.internal.identity.IdentityProvider;
 
 @ApplicationScoped
 public class DeploymentServiceCDIImpl extends KModuleDeploymentService {
 
 	
     @Inject
     private BeanManager beanManager
     @Inject
     @Deploy
     protected Event<DeploymentEvent> deploymentEvent;
     @Inject
     @Undeploy
     protected Event<DeploymentEvent> undeploymentEvent;
     
     @Inject
     
     @PostConstruct
     public void onInit() {
     	super.onInit();
     }
     
 	public void notifyOnDeploy(DeploymentUnit unit, DeployedUnit deployedUnit) {
 		if ( != null) {
             .fire(new DeploymentEvent(unit.getIdentifier(), deployedUnit));
         }
 	}
 	public void notifyOnUnDeploy(DeploymentUnit unit, DeployedUnit deployedUnit) {
 		if ( != null && deployedUnit != null) {
             .fire(new DeploymentEvent(unit.getIdentifier(), deployedUnit));
         }
 	}
 	
 	@Inject
 	public void setBpmn2Service(DefinitionService bpmn2Service) {
 
 		super.setBpmn2Service(bpmn2Service);
 	}
 	
 	@Inject
 	public void setManagerFactory(RuntimeManagerFactory managerFactory) {
 
 		super.setManagerFactory(managerFactory);
 	}
 	
 	@Inject
     @PersistenceUnit(unitName = "org.jbpm.domain")
 	public void setEmf(EntityManagerFactory emf) {
 
		super.setEmf(emf);
	}
	@Inject
	public void setRuntimeDataService(RuntimeDataService runtimeDataService) {
		super.setRuntimeDataService(runtimeDataService);
	}
	@Inject
	public void setIdentityProvider(IdentityProvider identityProvider) {
		super.setIdentityProvider(new IdentityProviderCDIWrapper(identityProvider, backupProviders));
	}
	protected RegisterableItemsFactory getRegisterableItemsFactory(AuditEventBuilder auditLoggerBuilder, KieContainer kieContainer,
			KModuleDeploymentUnit unit) {
        
        return InjectableRegisterableItemsFactory.getFactory(auditLoggerBuilderkieContainer,
                    unit.getKsessionName());
        
	}
New to GrepCode? Check out our FAQ X