*/
public XmlRpcWorkflowManager(int port) throws Exception {
Class engineFactoryClass = null, repositoryFactoryClass = null;
WorkflowEngineFactory engineFactory = null;
WorkflowRepositoryFactory repoFactory = null;
// load properties from workflow manager properties file, if specified
if (System.getProperty("org.apache.oodt.cas.workflow.properties") != null) {
String configFile = System
.getProperty("org.apache.oodt.cas.workflow.properties");
LOG.log(Level.INFO,
"Loading Workflow Manager Configuration Properties from: ["
+ configFile + "]");
System.getProperties().load(
new FileInputStream(new File(configFile)));
}
String engineClassStr = System
.getProperty("workflow.engine.factory",
"org.apache.oodt.cas.workflow.engine.DataSourceWorkflowEngineFactory");
String repositoryClassStr = System
.getProperty("workflow.repo.factory",
"org.apache.oodt.cas.workflow.repository.DataSourceWorkflowRepositoryFactory");
try {
engineFactoryClass = Class.forName(engineClassStr);
engineFactory = (WorkflowEngineFactory) engineFactoryClass
.newInstance();
engine = engineFactory.createWorkflowEngine();
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new Exception("Unable to load workflow engine factory class "
+ engineClassStr);
}
webServerPort = port;
// set the corresponding workflow manager url
engine.setWorkflowManagerUrl(safeGetUrlFromString("http://"
+ getHostname() + ":" + this.webServerPort));
try {
repositoryFactoryClass = Class.forName(repositoryClassStr);
repoFactory = (WorkflowRepositoryFactory) repositoryFactoryClass
.newInstance();
repo = repoFactory.createRepository();
} catch (ClassNotFoundException e) {
e.printStackTrace();
throw new Exception(
"Unable to load workflow repository factory class "
+ repositoryClassStr);