public class KModuleDeploymentService extends AbstractDeploymentService
Modifier and Type | Field and Description |
---|---|
protected DefinitionService |
bpmn2Service |
protected XPathExpression |
caseIdXPathExpression |
protected org.kie.api.executor.ExecutorService |
executorService |
protected FormManagerService |
formManagerService |
protected static org.slf4j.Logger |
logger |
protected DeploymentDescriptorMerger |
merger |
protected XPathExpression |
processIdXPathExpression |
deploymentsMap, emf, identityProvider, listeners, managerFactory, runtimeDataService
Constructor and Description |
---|
KModuleDeploymentService() |
Modifier and Type | Method and Description |
---|---|
void |
activate(String deploymentId)
Activates given deployment by making sure it will be available for execution.
|
protected void |
addClassToDeployedUnit(Class deploymentClass,
DeployedUnitImpl deployedUnit) |
protected org.kie.api.runtime.manager.RuntimeEnvironmentBuilder |
boostrapRuntimeEnvironmentBuilder(KModuleDeploymentUnit deploymentUnit,
DeployedUnit deployedUnit,
org.kie.api.runtime.KieContainer kieContainer,
org.kie.internal.runtime.conf.MergeMode mode)
This creates and fills a
RuntimeEnvironmentBuilder instance, which is later used when creating services. |
void |
deactivate(String deploymentId)
Deactivates given deployment by making it only available for already running instances.
|
void |
deploy(DeploymentUnit unit)
Performs deployment operation of given
unit . |
protected String |
getCaseId(String processSource) |
protected Object |
getInstanceFromModel(org.kie.internal.runtime.conf.ObjectModel model,
org.kie.api.runtime.KieContainer kieContainer,
Map<String,Object> contaxtParams) |
protected String |
getProcessId(String processSource) |
protected org.kie.api.runtime.manager.RegisterableItemsFactory |
getRegisterableItemsFactory(AuditEventBuilder auditLoggerBuilder,
org.kie.api.runtime.KieContainer kieContainer,
KModuleDeploymentUnit unit) |
void |
onInit() |
protected void |
processClassloader(org.kie.api.runtime.KieContainer kieContainer,
DeployedUnitImpl deployedUnit)
This processes the deployment dependencies, which are made available by the
KieContainer ClassLoader . |
protected void |
processResources(org.drools.compiler.kie.builder.impl.InternalKieModule module,
Collection<String> files,
org.kie.api.runtime.KieContainer kieContainer,
DeploymentUnit unit,
DeployedUnitImpl deployedUnit,
org.kie.api.builder.ReleaseId releaseId,
Map<String,ProcessDescriptor> processes)
Goes through all files in a deployment, and processes them so that they are then ready
for use after deployment.
|
void |
setBpmn2Service(DefinitionService bpmn2Service) |
void |
setExecutorService(org.kie.api.executor.ExecutorService executorService) |
void |
setFormManagerService(FormManagerService formManagerService) |
void |
setMerger(DeploymentDescriptorMerger merger) |
void |
undeploy(DeploymentUnit unit,
Function<DeploymentUnit,Boolean> beforeUndeploy)
Performs undeployment operation of given
unit aborting existing process instances if needed. |
addListener, commonDeploy, getDeployedUnit, getDeployedUnits, getDeploymentsMap, getEmf, getListeners, getManagerFactory, getRuntimeDataService, getRuntimeManager, isDeployed, notifyOnActivate, notifyOnDeactivate, notifyOnDeploy, notifyOnUnDeploy, removeListener, setEmf, setIdentityProvider, setManagerFactory, setRuntimeDataService, setupAuditLogger, shutdown, undeploy
protected static org.slf4j.Logger logger
protected DefinitionService bpmn2Service
protected DeploymentDescriptorMerger merger
protected FormManagerService formManagerService
protected org.kie.api.executor.ExecutorService executorService
protected XPathExpression processIdXPathExpression
protected XPathExpression caseIdXPathExpression
public void onInit()
public void deploy(DeploymentUnit unit)
DeploymentService
unit
.deploy
in interface DeploymentService
deploy
in class AbstractDeploymentService
unit
- deployment unit to be deployed to runtimeprotected org.kie.api.runtime.manager.RegisterableItemsFactory getRegisterableItemsFactory(AuditEventBuilder auditLoggerBuilder, org.kie.api.runtime.KieContainer kieContainer, KModuleDeploymentUnit unit)
public void undeploy(DeploymentUnit unit, Function<DeploymentUnit,Boolean> beforeUndeploy)
DeploymentService
unit
aborting existing process instances if needed.undeploy
in interface DeploymentService
undeploy
in class AbstractDeploymentService
unit
- deployment unit to be undeployed from runtimebeforeUndeploy
- a function to run custom actions before undeploying a given DeploymentUnit
. It should return if the unit can be deployed or not
determining if the deployment can continue.protected org.kie.api.runtime.manager.RuntimeEnvironmentBuilder boostrapRuntimeEnvironmentBuilder(KModuleDeploymentUnit deploymentUnit, DeployedUnit deployedUnit, org.kie.api.runtime.KieContainer kieContainer, org.kie.internal.runtime.conf.MergeMode mode)
RuntimeEnvironmentBuilder
instance, which is later used when creating services.
A lot of the logic here is used to process the information in the DeploymentDescriptor
instance, which is
part of the DeploymentUnit
.deploymentUnit
- The KModuleDeploymentUnit
, which is filled by the methoddeployedUnit
- The DeployedUnit
, which is also filled by the methodkieContainer
- The KieContainer
, which contains information needed to fill the above two argumentsmode
- The MergeMode
used to resolve conflicts in the DeploymentDescriptor
.RuntimeEnvironmentBuilder
instance ready for useprotected Object getInstanceFromModel(org.kie.internal.runtime.conf.ObjectModel model, org.kie.api.runtime.KieContainer kieContainer, Map<String,Object> contaxtParams)
protected void processResources(org.drools.compiler.kie.builder.impl.InternalKieModule module, Collection<String> files, org.kie.api.runtime.KieContainer kieContainer, DeploymentUnit unit, DeployedUnitImpl deployedUnit, org.kie.api.builder.ReleaseId releaseId, Map<String,ProcessDescriptor> processes)
module
- The InternalKieModule
, necessary to get form contentfiles
- The List
of file (names) to process.kieContainer
- The KieContainer
, necesary in order to load classesdeploymentUnit
- The DeploymentUnit
, necessary to get the deployment iddeployedUnit
- The DeployedUnit
, which contains the results of actions hereprotected void addClassToDeployedUnit(Class deploymentClass, DeployedUnitImpl deployedUnit)
protected void processClassloader(org.kie.api.runtime.KieContainer kieContainer, DeployedUnitImpl deployedUnit)
KieContainer
ClassLoader
.kieContainer
- The KieContainer
, used to get the ClassLoader
deployedUnit
- The DeployedUnitImpl
, used to store the classes loadedpublic void setBpmn2Service(DefinitionService bpmn2Service)
public void setMerger(DeploymentDescriptorMerger merger)
public void setFormManagerService(FormManagerService formManagerService)
public void setExecutorService(org.kie.api.executor.ExecutorService executorService)
public void activate(String deploymentId)
DeploymentService
public void deactivate(String deploymentId)
DeploymentService
Copyright © 2001–2019 JBoss by Red Hat. All rights reserved.