public class ProcessStoreImpl extends java.lang.Object implements ProcessStore
JDBC-based implementation of a process store. Also provides an "in-memory" store by way of HSQL database.
The philsophy here is to keep things simple. Process store operations are relatively infrequent. Performance of the public
methods is not a concern. However, note that the ProcessConf objects returned by the class are
going to be used from within the engine runtime, and hence their performance needs to be very good. Similarly, these objects
should be immutable so as not to confuse the engine.
Note the way that the database is used in this class, it is more akin to a recovery log, this is intentional: we want to start
up, load stuff from the database and then pretty much forget about it when it comes to reads.
| Modifier and Type | Field and Description |
|---|---|
protected java.io.File |
_configDir |
protected java.io.File |
_deployDir |
| Constructor and Description |
|---|
ProcessStoreImpl() |
ProcessStoreImpl(EndpointReferenceContext eprContext,
javax.sql.DataSource inMemDs)
Constructor that hardwires OpenJPA on a new in-memory database.
|
ProcessStoreImpl(EndpointReferenceContext eprContext,
javax.sql.DataSource ds,
java.lang.String persistenceType,
OdeConfigProperties props,
boolean createDatamodel) |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<javax.xml.namespace.QName,org.w3c.dom.Node> |
calcInitialProperties(java.util.Properties properties,
TDeployment.Process dd)
Create a property mapping based on the initial values in the deployment descriptor.
|
static javax.sql.DataSource |
createInternalDS(java.lang.String guid) |
java.util.Collection<javax.xml.namespace.QName> |
deploy(java.io.File deploymentUnitDirectory) |
java.util.Collection<javax.xml.namespace.QName> |
deploy(java.io.File deploymentUnitDirectory,
boolean autoincrementVersion)
Deploys a process.
|
java.util.Collection<javax.xml.namespace.QName> |
deploy(java.io.File deploymentUnitDirectory,
boolean activate,
java.lang.String duName,
boolean autoincrementVersion)
Deploys a process.
|
protected void |
finalize() |
protected java.io.File |
findDeployDir(DeploymentUnitDAO dudao) |
protected void |
fireEvent(ProcessStoreEvent pse) |
java.io.File |
getConfigDir() |
long |
getCurrentVersion() |
java.io.File |
getDeployDir() |
java.util.Collection<java.lang.String> |
getPackages() |
ProcessConf |
getProcessConfiguration(javax.xml.namespace.QName processId) |
java.util.List<javax.xml.namespace.QName> |
getProcesses() |
java.util.List<javax.xml.namespace.QName> |
listProcesses(java.lang.String packageName) |
protected java.util.List<ProcessConfImpl> |
load(DeploymentUnitDAO dudao)
Load a deployment unit record stored in the db into memory.
|
protected boolean |
load(java.lang.String duName)
Make sure that the deployment unit is loaded.
|
void |
loadAll()
Load all the deployment units out of the store.
|
void |
refreshSchedules(java.lang.String packageName) |
void |
registerListener(ProcessStoreListener psl) |
void |
setConfigDir(java.io.File configDir) |
void |
setDeployDir(java.io.File depDir) |
void |
setExtensionValidators(java.util.Map<javax.xml.namespace.QName,ExtensionValidator> extensionValidators) |
void |
setProperty(javax.xml.namespace.QName pid,
javax.xml.namespace.QName propName,
org.w3c.dom.Node value) |
void |
setProperty(javax.xml.namespace.QName pid,
javax.xml.namespace.QName propName,
java.lang.String value) |
void |
setRetiredPackage(java.lang.String packageName,
boolean retired) |
void |
setState(javax.xml.namespace.QName pid,
ProcessState state) |
void |
shutdown() |
static void |
shutdownInternalDB(javax.sql.DataSource ds) |
java.util.Collection<javax.xml.namespace.QName> |
undeploy(java.io.File dir) |
java.util.Collection<javax.xml.namespace.QName> |
undeploy(java.lang.String duName) |
void |
unregisterListener(ProcessStoreListener psl) |
protected java.io.File _deployDir
protected java.io.File _configDir
public ProcessStoreImpl()
public ProcessStoreImpl(EndpointReferenceContext eprContext, javax.sql.DataSource ds, java.lang.String persistenceType, OdeConfigProperties props, boolean createDatamodel)
public ProcessStoreImpl(EndpointReferenceContext eprContext, javax.sql.DataSource inMemDs)
public void shutdown()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic java.util.Collection<javax.xml.namespace.QName> deploy(java.io.File deploymentUnitDirectory,
boolean autoincrementVersion)
public java.util.Collection<javax.xml.namespace.QName> deploy(java.io.File deploymentUnitDirectory)
deploy in interface ProcessStorepublic java.util.Collection<javax.xml.namespace.QName> deploy(java.io.File deploymentUnitDirectory,
boolean activate,
java.lang.String duName,
boolean autoincrementVersion)
public java.util.Collection<javax.xml.namespace.QName> undeploy(java.io.File dir)
undeploy in interface ProcessStorepublic java.util.Collection<javax.xml.namespace.QName> undeploy(java.lang.String duName)
public java.util.Collection<java.lang.String> getPackages()
getPackages in interface ProcessStorepublic java.util.List<javax.xml.namespace.QName> listProcesses(java.lang.String packageName)
listProcesses in interface ProcessStorepublic void setState(javax.xml.namespace.QName pid,
ProcessState state)
setState in interface ProcessStorepublic void setRetiredPackage(java.lang.String packageName,
boolean retired)
setRetiredPackage in interface ProcessStorepublic ProcessConf getProcessConfiguration(javax.xml.namespace.QName processId)
getProcessConfiguration in interface ProcessStorepublic void setProperty(javax.xml.namespace.QName pid,
javax.xml.namespace.QName propName,
org.w3c.dom.Node value)
setProperty in interface ProcessStorepublic void setProperty(javax.xml.namespace.QName pid,
javax.xml.namespace.QName propName,
java.lang.String value)
setProperty in interface ProcessStorepublic void loadAll()
public java.util.List<javax.xml.namespace.QName> getProcesses()
getProcesses in interface ProcessStorepublic long getCurrentVersion()
getCurrentVersion in interface ProcessStoreprotected void fireEvent(ProcessStoreEvent pse)
public void registerListener(ProcessStoreListener psl)
registerListener in interface ProcessStorepublic void unregisterListener(ProcessStoreListener psl)
unregisterListener in interface ProcessStorepublic static java.util.Map<javax.xml.namespace.QName,org.w3c.dom.Node> calcInitialProperties(java.util.Properties properties,
TDeployment.Process dd)
dd - protected java.util.List<ProcessConfImpl> load(DeploymentUnitDAO dudao)
dudao - protected java.io.File findDeployDir(DeploymentUnitDAO dudao)
protected boolean load(java.lang.String duName)
duName - deployment unit namepublic void setDeployDir(java.io.File depDir)
public java.io.File getDeployDir()
public java.io.File getConfigDir()
public void setConfigDir(java.io.File configDir)
public static javax.sql.DataSource createInternalDS(java.lang.String guid)
public static void shutdownInternalDB(javax.sql.DataSource ds)
public void refreshSchedules(java.lang.String packageName)
refreshSchedules in interface ProcessStorepublic void setExtensionValidators(java.util.Map<javax.xml.namespace.QName,ExtensionValidator> extensionValidators)
Copyright © 2022 WSO2. All Rights Reserved.