Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jbpm.services.cdi.impl.store;
 
 import  javax.enterprise.context.ApplicationScoped;
 import  javax.inject.Inject;
 
 import  org.jbpm.kie.services.impl.store.DeploymentStore;
import  org.jbpm.kie.services.impl.store.DeploymentSyncInvoker;
import  org.jbpm.kie.services.impl.store.DeploymentSynchronizer;
import  org.jbpm.services.api.DeploymentService;
import  org.jbpm.shared.services.impl.TransactionalCommandService;
import  org.kie.internal.runtime.cdi.BootOnLoad;
@BootOnLoad
@ApplicationScoped
public class DeploymentSyncManager {
	@Inject
	private DeploymentService deploymentService;
	@Inject
	private TransactionalCommandService commandService;
	private DeploymentSyncInvoker invoker;
	private DeploymentSynchronizer synchronizer;
	public void configureAndStart() {
    	try {
    		InitialContext.doLookup("java:module/DeploymentSynchronizerCDInvoker");
    	} catch (Exception e) {
    		
    		DeploymentStore store = new DeploymentStore();
    		store.setCommandService();
    		
    		 = new DeploymentSynchronizer();
    		.setDeploymentService();
    		.setDeploymentStore(store);
            
             = new DeploymentSyncInvoker();
            .start();
    	}
	}
	public void cleanup() {
		if ( != null) {
			.stop();
		}
	}
New to GrepCode? Check out our FAQ X