JBoss JBPM SVN: r2405 - jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/job/executor.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-09-27 01:25:27 -0400 (Sat, 27 Sep 2008)
New Revision: 2405
Modified:
jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
Log:
have job executor thread rollback on persistence exception
Modified: jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2008-09-27 04:36:31 UTC (rev 2404)
+++ jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2008-09-27 05:25:27 UTC (rev 2405)
@@ -10,6 +10,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.HibernateException;
+
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.db.JobSession;
@@ -164,6 +166,11 @@
if (job.execute(jbpmContext)) {
jobSession.deleteJob(job);
}
+ } catch (HibernateException e) {
+ log.debug("exception while executing " + job, e);
+ // allowing a transaction to proceed after a persistence exception is unsafe
+ // TODO rollback on *any* runtime exception?
+ jbpmContext.setRollbackOnly();
} catch (Exception e) {
log.debug("exception while executing " + job, e);
StringWriter memoryWriter = new StringWriter();
17 years, 6 months
JBoss JBPM SVN: r2404 - jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-09-27 00:36:31 -0400 (Sat, 27 Sep 2008)
New Revision: 2404
Modified:
jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/JobSession.java
Log:
check the effect of pessimistic locking on job acquisition and execution
Modified: jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/JobSession.java
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/JobSession.java 2008-09-26 17:41:47 UTC (rev 2403)
+++ jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/db/JobSession.java 2008-09-27 04:36:31 UTC (rev 2404)
@@ -6,6 +6,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hibernate.LockMode;
import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.JbpmContext;
@@ -32,6 +33,7 @@
query.setString("lockOwner", lockOwner);
query.setTimestamp("now", new Date());
query.setMaxResults(1);
+ query.setLockMode("job", LockMode.UPGRADE);
job = (Job) query.uniqueResult();
} catch (Exception e) {
@@ -48,6 +50,7 @@
query.setString("lockOwner", lockOwner);
query.setTimestamp("now", new Date());
query.setParameter("processInstance", processInstance);
+ query.setLockMode("job", LockMode.UPGRADE);
jobs = query.list();
} catch (Exception e) {
@@ -101,7 +104,7 @@
public Job loadJob(long jobId) {
try {
- return (Job) session.load(Job.class, new Long(jobId));
+ return (Job) session.load(Job.class, new Long(jobId), LockMode.UPGRADE);
} catch (Exception e) {
log.error(e);
throw new JbpmException("couldn't load job '"+jobId+"'", e);
17 years, 6 months
JBoss JBPM SVN: r2403 - in jbpm4/branches/tdiesler: modules/api/src/main/java/org/jbpm/api and 14 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-26 13:41:47 -0400 (Fri, 26 Sep 2008)
New Revision: 2403
Added:
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jboss/
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jboss/bpm/
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jboss/bpm/pattern/
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jboss/bpm/pattern/control/
jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.config.Configuration
Removed:
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Deployment.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DeploymentService.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectHandler.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessService.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Service.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/
jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration
Modified:
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
jbpm4/branches/tdiesler/modules/cts/pom.xml
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
jbpm4/branches/tdiesler/pom.xml
Log:
Add basic model
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-// $Id$
-
-/**
- * The Configuration provides a ProcessEngine through a given
- * configuration method
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public interface Configuration
-{
- /**
- * Create a new instance of ProcessEngine for this configuration
- * @return The configured instance of a process engine
- */
- ProcessEngine getProcessEngine();
-
- /**
- * Get a ProcessEngine with a given name from this configuration
- * @return The configured instance of a process engine
- */
- ProcessEngine getProcessEngine(String engineName);
-}
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Deployment.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Deployment.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Deployment.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,102 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * A deployment, containing all information to create a process that will be deployed to the {@link ProcessService}
- *
- * @author Tom Baeyens
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public class Deployment implements Serializable
-{
- private static final long serialVersionUID = 1L;
-
- private String procXML;
-
- public Deployment(String procXML)
- {
- if (procXML == null)
- throw new IllegalArgumentException("Null process definition");
-
- this.procXML = procXML;
- }
-
- public Deployment(URL procURL) throws IOException
- {
- if (procURL == null)
- throw new IllegalArgumentException("Null process definition");
-
- StringBuilder strBuilder = new StringBuilder();
- BufferedReader br = new BufferedReader(new InputStreamReader(procURL.openStream()));
- String line = br.readLine();
- while (line != null)
- {
- strBuilder.append(line);
- line = br.readLine();
- }
- procXML = strBuilder.toString();
- }
-
- public String getProcessXML()
- {
- return procXML;
- }
-
- public URI getNamespaceURI()
- {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- Document doc;
- try
- {
- DocumentBuilder db = dbf.newDocumentBuilder();
- doc = db.parse(new ByteArrayInputStream(procXML.getBytes()));
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot parse process descriptor", ex);
- }
-
- Element root = doc.getDocumentElement();
- String nsURI = root.getNamespaceURI();
- if (nsURI == null)
- throw new IllegalStateException("Cannot get namespace URI from root element");
-
- return URI.create(nsURI);
- }
-}
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DeploymentService.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DeploymentService.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DeploymentService.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import javax.management.ObjectName;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The marker interface for all Services
- *
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public abstract class DeploymentService implements Service
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(DeploymentService.class);
-
- /**
- * Deploy a new process to the process service.
- */
- ObjectName deploy(Deployment deployment)
- {
- return null;
- }
-}
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectHandler.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URL;
-
-/**
- * The DialectHandler converts a supported dialect to the Process model.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public interface DialectHandler
-{
- URI DEFAULT_NAMESPACE_URI = URI.create("urn:bpm.jboss:pdl-0.1");
-
- /**
- * Get the the supported namespace from this dialect.
- */
- URI getNamespaceURI();
-
- /**
- * Create a {@link Process} from a descriptor.
- * @param isInclude TODO
- */
- Process createProcess(String pXML);
-
- /**
- * Create a {@link Process} from a descriptor URL.
- * @param isInclude TODO
- */
- Process createProcess(URL pURL) throws IOException;
-
- /**
- * Marshall the process to the given writer
- */
- void marshallProcess(Process proc, Writer out) throws IOException;
-}
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectRegistry.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/DialectRegistry.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import java.net.URI;
-import java.util.Map;
-
-/**
- * A registry that maps namespaceURI to a {@link DialectHandler}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jul-2008
- */
-public abstract class DialectRegistry
-{
- // Maps namespaceURI to a DialectHandler
- protected Map<URI, DialectHandler> dialectHandlers;
-
- /**
- * Get the handler for the dialect with the given namespace URI
- */
- public DialectHandler getDialectHandler(URI nsURI)
- {
- DialectHandler dialectHandler = dialectHandlers.get(nsURI);
- if (dialectHandler == null)
- throw new IllegalStateException("No dialect handler registered for: " + nsURI);
-
- return dialectHandler;
- }
-
-}
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,106 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.util.KernelLocator;
-import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jbpm.api.client.internal.EmbeddedBeansDeployer;
-
-/**
- * The ProcessEngineProvider provides a ProcessEngine through a given configuration method
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class MicrocontainerConfiguration implements Configuration
-{
- /** The process engine bean name - jBPMEngine */
- public static final String BEAN_NAME = "jBPMProcessEngine";
- /** The default bean config: jbpm-cfg-beans.xml */
- public static final String JBPM_ENGINE_CONFIG = "jbpm-cfg-beans.xml";
-
- // Everything gets deployed through one deployer
- private static EmbeddedBeansDeployer beansDeployer = new EmbeddedBeansDeployer();
-
- public void deployDefaultConfig()
- {
- URL cfgURL = getDefaultConfigURL();
- beansDeployer.deploy(cfgURL);
- }
-
- public void undeployDefaultConfig()
- {
- URL cfgURL = getDefaultConfigURL();
- beansDeployer.undeploy(cfgURL);
- }
-
- public void deployBeansConfig(URL cfgURL)
- {
- beansDeployer.deploy(cfgURL);
- }
-
- public void undeployBeansConfig(URL cfgURL)
- {
- beansDeployer.undeploy(cfgURL);
- }
-
- /**
- * Get the default ProcessEngine from this configuration
- * @return The configured instance of a process engine
- */
- public ProcessEngine getProcessEngine()
- {
- return getProcessEngine(BEAN_NAME);
- }
-
- /**
- * Get a ProcessEngine with a given name from this configuration
- * @return The configured instance of a process engine
- */
- @SuppressWarnings("deprecation")
- public ProcessEngine getProcessEngine(String beanName)
- {
- Kernel kernel = KernelLocator.getKernel();
- if (kernel == null)
- {
- deployDefaultConfig();
- kernel = KernelLocator.getKernel();
- }
-
- KernelRegistryEntry entry = kernel.getRegistry().getEntry(beanName);
- ProcessEngine engine = (ProcessEngine)entry.getTarget();
- return engine;
- }
-
- private URL getDefaultConfigURL()
- {
- URL cfgURL = Thread.currentThread().getContextClassLoader().getResource(JBPM_ENGINE_CONFIG);
- if (cfgURL == null)
- throw new IllegalStateException("Cannot find resource: " + JBPM_ENGINE_CONFIG);
- return cfgURL;
- }
-}
\ No newline at end of file
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -28,20 +28,27 @@
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
+import org.jbpm.api.config.Configuration;
+import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.service.ProcessEngineRegistry;
+import org.jbpm.api.service.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * The process engine is an agregator of various service objects used by the BPM engine. <p/> A ProcessEngine is always
- * created via one of the available {@link Configuration} objects. Every implementation of the API has one default
- * {@link Configuration} which is configured via a resource file with the fully qualified class name of
- * {@link Configuration}. <p/> The API natively supports {@link MicrocontainerConfiguration}. To create and register a
- * ProcessEngine explicitly, you would do
+ * The process engine is an agregator of various service objects used by the BPM engine.
+ * <p/>
+ * A ProcessEngine is always created via one of the available {@link Configuration} objects. Every implementation of the API has one default
+ * {@link Configuration} which is configured via a resource file with the fully qualified class name of {@link Configuration}.
+ * <p/>
+ * The API natively supports {@link MicrocontainerConfiguration}. To create and register a ProcessEngine explicitly, you would do
*
* <pre>
- * ProcessEngine engine = new MicrocontainerConfiguration(cfgURL).getProcessEngine();
- * ProcessEngineRegistry.registerProcessEngine(engine);
+ * MicrocontainerConfiguration config = new MicrocontainerConfiguration();
+ * ProcessEngine engine = config.deployBeansConfig(cfgURL).getProcessEngine("EngineBeanName");
+ * ProcessEngineRegistry.registerProcessEngine(engine);
* </pre>
*
* @author thomas.diesler(a)jboss.com
@@ -89,23 +96,21 @@
*
* @return null, if there is no ProcessEngine registered by this name
*/
- public static ProcessEngine getProcessEngine(String name)
+ public static ProcessEngine getProcessEngine(String engineName)
{
- Map<String, ProcessEngine> engineRegistry = ProcessEngineRegistry.engineRegistry;
+ Set<String> registeredEngines = ProcessEngineRegistry.getEngineNames();
+ if (registeredEngines.size() == 0)
+ {
+ ProcessEngine engine = loadDefaultEngine();
+ ProcessEngineRegistry.registerEngine(engine);
+ return engine;
+ }
- if (engineRegistry.size() == 0)
- loadDefaultEngine();
+ if (engineName == null && registeredEngines.size() == 1)
+ engineName = registeredEngines.iterator().next();
- ProcessEngine pe = null;
- if (name == null && engineRegistry.size() == 1)
- {
- pe = engineRegistry.values().iterator().next();
- }
- else
- {
- pe = engineRegistry.get(name);
- }
- return pe;
+ ProcessEngine engine = ProcessEngineRegistry.getEngine(engineName);
+ return engine;
}
/**
@@ -129,7 +134,7 @@
{
}
- private static void loadDefaultEngine()
+ private static ProcessEngine loadDefaultEngine()
{
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
InputStream instream = ctxLoader.getResourceAsStream(Configuration.class.getName());
@@ -153,7 +158,7 @@
if (engine == null)
throw new IllegalStateException("Cannot obtain engine from configuration: " + config);
- ProcessEngineRegistry.registerProcessEngine(engine);
+ return engine;
}
@Override
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A registry of ProcessEngine instances per VM
- *
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public final class ProcessEngineRegistry
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(ProcessEngineRegistry.class);
-
- // The process engine registry
- static Map<String, ProcessEngine> engineRegistry = new HashMap<String, ProcessEngine>();
-
- // Hide constructor
- private ProcessEngineRegistry()
- {
- }
-
- /**
- * Get the set of registered engine names
- */
- public static Set<String> getRegisteredProcessEngines()
- {
- return engineRegistry.keySet();
- }
-
- /**
- * Register a ProcessEngine
- * @throws IllegalStateException If a ProcessEngine with that name is already registered
- */
- public static void registerProcessEngine(ProcessEngine engine)
- {
- if (engineRegistry.get(engine.getName()) != null)
- throw new IllegalStateException("Process engine already registered: " + engine.getName());
-
- log.debug("Register: " + engine);
- engineRegistry.put(engine.getName(), engine);
- }
-
- /**
- * Unregister a ProcessEngine for a given name
- */
- public static ProcessEngine unregisterProcessEngine(String name)
- {
- ProcessEngine pe = engineRegistry.remove(name);
- log.debug("Unregister: " + name + "=" + pe);
- return pe;
- }
-
-
-}
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessService.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessService.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessService.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,73 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The marker interface for all Services
- *
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public abstract class ProcessService implements Service
-{
- // Provide logging
- final static Logger log = LoggerFactory.getLogger(ProcessService.class);
-
- // The set of registered processes
- private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
-
- // Hide public constructor
- protected ProcessService()
- {
- }
-
- /**
- * Deploy a new process to the process service.
- */
- ObjectName deploy(Deployment deployment)
- {
-
- return null;
- }
-
- /**
- * Get the set of registered Processes
- */
- public Set<Process> getProcesses()
- {
- Set<Process> procSet = new HashSet<Process>(procs.values());
- return Collections.unmodifiableSet(procSet);
- }
-}
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Service.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Service.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Service.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.api.client;
-
-//$Id$
-
-/**
- * The base interface for all Services
- *
- * @author thomas.diesler(a)jboss.com
- * @since 25-Sep-2008
- */
-public interface Service
-{
- /**
- * Get the associated ProcessEngine
- */
- ProcessEngine getProcessEngine();
-}
\ No newline at end of file
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.config;
+
+import org.jbpm.api.client.ProcessEngine;
+
+// $Id$
+
+/**
+ * The Configuration provides a ProcessEngine through a given
+ * configuration method
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public interface Configuration
+{
+ /**
+ * Create a new instance of ProcessEngine for this configuration
+ * @return The configured instance of a process engine
+ */
+ ProcessEngine getProcessEngine();
+
+ /**
+ * Get a ProcessEngine with a given name from this configuration
+ * @return The configured instance of a process engine
+ */
+ ProcessEngine getProcessEngine(String engineName);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/Configuration.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.config;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.config.internal.EmbeddedBeansDeployer;
+
+/**
+ * The ProcessEngineProvider provides a ProcessEngine through a given configuration method
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public class MicrocontainerConfiguration implements Configuration
+{
+ /** The process engine bean name - jBPMEngine */
+ public static final String BEAN_NAME = "jBPMProcessEngine";
+ /** The default bean config: jbpm-cfg-beans.xml */
+ public static final String JBPM_ENGINE_CONFIG = "jbpm-cfg-beans.xml";
+
+ // Everything gets deployed through one deployer
+ private static EmbeddedBeansDeployer beansDeployer = new EmbeddedBeansDeployer();
+
+ public Configuration deployDefaultConfig()
+ {
+ URL cfgURL = getDefaultConfigURL();
+ beansDeployer.deploy(cfgURL);
+ return this;
+ }
+
+ public void undeployDefaultConfig()
+ {
+ URL cfgURL = getDefaultConfigURL();
+ beansDeployer.undeploy(cfgURL);
+ }
+
+ public Configuration deployBeansConfig(URL cfgURL)
+ {
+ beansDeployer.deploy(cfgURL);
+ return this;
+ }
+
+ public void undeployBeansConfig(URL cfgURL)
+ {
+ beansDeployer.undeploy(cfgURL);
+ }
+
+ /**
+ * Get the default ProcessEngine from this configuration
+ * @return The configured instance of a process engine
+ */
+ public ProcessEngine getProcessEngine()
+ {
+ return getProcessEngine(BEAN_NAME);
+ }
+
+ /**
+ * Get a ProcessEngine with a given name from this configuration
+ * @return The configured instance of a process engine
+ */
+ @SuppressWarnings("deprecation")
+ public ProcessEngine getProcessEngine(String beanName)
+ {
+ Kernel kernel = KernelLocator.getKernel();
+ if (kernel == null)
+ {
+ deployDefaultConfig();
+ kernel = KernelLocator.getKernel();
+ }
+
+ KernelRegistryEntry entry = kernel.getRegistry().getEntry(beanName);
+ ProcessEngine engine = (ProcessEngine)entry.getTarget();
+ return engine;
+ }
+
+ private URL getDefaultConfigURL()
+ {
+ URL cfgURL = Thread.currentThread().getContextClassLoader().getResource(JBPM_ENGINE_CONFIG);
+ if (cfgURL == null)
+ throw new IllegalStateException("Cannot find resource: " + JBPM_ENGINE_CONFIG);
+ return cfgURL;
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/MicrocontainerConfiguration.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.config.internal;
+
+// $Id$
+
+import java.net.URL;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+import org.jboss.kernel.plugins.util.KernelLocator;
+import org.jbpm.api.test.CTSTestSetup;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Boostrap the Microcontainer
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 27-Jun-2008
+ */
+public class EmbeddedBeansDeployer extends BasicBootstrap
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(CTSTestSetup.class);
+
+ private Kernel kernel;
+ private BasicXMLDeployer deployer;
+
+ public EmbeddedBeansDeployer()
+ {
+ // Get or bootstrap the kernel
+ kernel = KernelLocator.getKernel();
+ if (kernel == null)
+ {
+ try
+ {
+ super.bootstrap();
+ kernel = super.getKernel();
+ log.debug("bootstrap kernel: " + kernel);
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot bootstrap kernel", e);
+ }
+ }
+ deployer = new BasicXMLDeployer(kernel);
+ }
+
+ /**
+ * Deploy MC beans from URL
+ */
+ public void deploy(URL url)
+ {
+ log.debug("deploy: " + url);
+ try
+ {
+ deployer.deploy(url);
+ deployer.validate();
+
+ // The KernelLocator is expected to get deployed as a bean
+ if (KernelLocator.getKernel() == null)
+ throw new IllegalStateException("KernelLocator not deployed as MC bean");
+
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot deploy beans from: " + url, e);
+ }
+ }
+
+ /**
+ * Undeploy MC beans from URL
+ */
+ public void undeploy(URL url)
+ {
+ log.debug("undeploy: " + url);
+ try
+ {
+ deployer.undeploy(url);
+ }
+ catch (Throwable e)
+ {
+ throw new IllegalStateException("Cannot undeploy beans from: " + url, e);
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/config/internal/EmbeddedBeansDeployer.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+/**
+ * The parrent of all Elements
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface AbstractElement extends Serializable
+{
+ /**
+ * Get the ID of this element
+ */
+ ObjectName getID();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/AbstractElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+// $Id$
+
+/**
+ * The base of all builders.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Builder
+{
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Builder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * There are two ways of Connecting Objects in BPMN: a Flow, either sequence or message, and an Association. Sequence
+ * Flow and Message Flow, to a certain extent, represent orthogonal aspects of the business processes depicted in a model,
+ * although they both affect the performance of activities within a Process.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ConnectingObject
+{
+ /**
+ * Name is an optional attribute that is text description of the Connecting Object.
+ */
+ String getName();
+
+ /**
+ * SourceRef is an attribute that identifies which Graphical Element the Connecting
+ * Object is connected from. Note: there are restrictions as to what objects Sequence
+ * Flow and Message Flow can connect.
+ */
+ Node getSourceRef();
+
+ /**
+ * TargetRef is an attribute that identifies which Graphical Element the Connecting
+ * Object is connected to. Note: there are restrictions as to what objects Sequence
+ * Flow and Message Flow can connect.
+ */
+ Node getTargetRef();
+
+ /**
+ * Get the required target name
+ */
+ String getTargetName();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ConnectingObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * As the name implies, the End Event indicates where a Process will end.
+ *
+ * In terms of Sequence Flow, the End Event ends the flow of the Process, and thus, will not have any outgoing Sequence Flow.
+ * An End Event can have a specific Result that will appear as a marker within the center of the End Event shape.
+ * End Event Results are Message, Error, Compensation, Link, and Multiple.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface EndEvent extends Event
+{
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/EndEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * An Event is something that “happens” during the course of a business process.
+ * <p/>
+ * These Events affect the flow of the Process and usually have a cause or an impact.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Event extends Node
+{
+ /**
+ * Defines the type of an {@link Event}
+ */
+ enum EventType
+ {
+ Start, End, Intermediate
+ };
+
+ /**
+ * Get the type of this event
+ */
+ EventType getEventType();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Event.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * An Expression, which is used in the definition of attributes for StartEvent,
+ * IntermediateEvent, Activity, ComplexGateway, and SequenceFlow
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Expression
+{
+ public enum ExpressionLanguage
+ {
+ MVEL
+ }
+
+ /**
+ * An ExpressionBody MUST be entered to provide the text of the expression, which
+ * will be written in the language defined by the ExpressionLanguage attribute.
+ */
+ String getExpressionBody();
+
+ /**
+ * A Language MUST be provided to identify the language of the ExpressionBody.
+ * The value of the ExpressionLanguage should follow the naming conventions for the
+ * version of the specified language.
+ */
+ ExpressionLanguage getExpressionLanguage();
+
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Expression.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+
+/**
+ * There MAY be zero or more Gates (except where noted below). Zero Gates are
+ * allowed if the Gateway is last object in a Process flow and there are no Start or
+ * End Events for the Process. If there are zero or only one incoming Sequence
+ * Flow, then there MUST be at least two Gates.
+ *
+ * For Exclusive Data-Based Gateways
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ *
+ * For Exclusive Event-Based Gateways
+ * There MUST be two or more Gates. (Note that this type of Gateway does not act
+ * only as a Merge--it is always a Decision, at least.)
+ *
+ * For Inclusive Gateways
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Gate
+{
+ /**
+ * Each Gate MUST have an associated (outgoing) Sequence Flow.
+ *
+ * For Exclusive Event-Based, Complex, and Parallel Gateways:
+ * The Sequence Flow MUST have its Condition attribute set to None (there is not an
+ * evaluation of a condition expression).
+ *
+ * For Exclusive Data-Based, and Inclusive Gateways:
+ * The Sequence Flow MUST have its Condition attribute set to Expression and
+ * MUST have a valid ConditionExpression. The ConditionExpression MUST be
+ * unique for all the Gates within the Gateway. If there is only one Gate (i.e., the
+ * Gateway is acting only as a Merge), then Sequence Flow MUST have its Condition
+ * set to None.
+ *
+ * For DefaultGates:
+ * The Sequence Flow MUST have its Condition attribute set to Otherwise
+ */
+ SequenceFlow getOutgoingSequenceFlow();
+
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gate.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id:$
+
+import java.util.List;
+
+/**
+ * Gateways are modeling elements that are used to control how Sequence Flow interact as they converge and diverge within
+ * a Process. If the flow does not need to be controlled, then a Gateway is not needed. The term “Gateway” implies that
+ * there is a gating mechanism that either allows or disallows passage through the Gateway--that is, as Tokens arrive at a
+ * Gateway, they can be merged together on input and/or split apart on output as the Gateway mechanisms are invoked. To
+ * be more descriptive, a Gateway is actually a collection of “Gates.”
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Gateway extends Node
+{
+ /**
+ * The GatewayType
+ *
+ */
+ public enum GatewayType
+ {
+ Exclusive, Inclusive, Complex, Parallel
+ }
+
+ /**
+ * GatewayType is by default Exclusive. The GatewayType MAY be set to Inclusive, Complex, or Parallel. The GatewayType will determine the behavior of the Gateway,
+ * both for incoming and outgoing Sequence Flow
+ */
+ GatewayType getGatewayType();
+
+ /**
+ * There MAY be zero or more Gates (except where noted below). Zero Gates are allowed if the Gateway is last object in a Process flow and there are no Start or End
+ * Events for the Process. If there are zero or only one incoming Sequence Flow, then there MUST be at least two Gates.
+ *
+ * For Exclusive Data-Based Gateways.
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ *
+ * For Exclusive Event-Based Gateways.
+ * There MUST be two or more Gates. (Note that this type of Gateway does not act only as a Merge--it is always a Decision, at
+ * least.)
+ *
+ * For Inclusive Gateways.
+ * When two Gates are required, one of them MAY be the DefaultGate.
+ */
+ List<Gate> getGates();
+
+ /**
+ * Get the optional default gate
+ * @return null if there is none
+ */
+ Gate getDefaultGate();
+
+ /**
+ * Get the gate for the given target name
+ * @return null if there is none
+ */
+ Gate getGateByTargetName(String targetName);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Gateway.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+
+//$Id$
+
+/**
+ * A Message, which is used in the definition of attributes for a StartEvent,
+ * EndEvent, IntermediateEvent, Task, and MessageFlow
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Message extends PropertySupport
+{
+ /**
+ * Name is an attribute that is text description of the Message.
+ */
+ String getName();
+
+ /**
+ * This defines the source of the Message.
+ */
+ Participant getFromRef();
+
+ /**
+ * This defines the target of the Message.
+ */
+ Participant getToRef();
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Message.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+
+/**
+ * A MessageBuilder can be used to build a {@link Message} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageBuilder extends Builder
+{
+ /**
+ * Create a {@link Message} with a given name
+ */
+ MessageBuilder newMessage(String msgName);
+
+ /**
+ * Add a message destination
+ */
+ MessageBuilder addToRef(ObjectName toRef);
+
+ /**
+ * Add a message source
+ */
+ MessageBuilder addFromRef(ObjectName fromRef);
+
+ /**
+ * Add a message property
+ */
+ MessageBuilder addProperty(String name, Object value);
+
+ /**
+ * Add a message property
+ */
+ MessageBuilder addProperty(String name, Object value, boolean isCorrelation);
+
+ /**
+ * Get the Message
+ */
+ Message getMessage();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * A Message Flow is a dashed line that is used to show the flow of messages between two entities that are prepared to
+ * send and receive them. In BPMN, two separate Pools in the Diagram will represent the two entities.
+ *
+ * Message Flow MUST connect two Pools, either to the Pools themselves or to Flow Objects within the Pools. They cannot
+ * connect two objects within the same Pool.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface MessageFlow extends ConnectingObject
+{
+ /**
+ * MessageRef is an optional attribute that identifies the Message that is being sent.
+ */
+ Message getMessageRef();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/MessageFlow.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+// $Id$
+
+/**
+ * A Node is an abstract element with a name and an associated process
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Node extends AbstractElement
+{
+ /**
+ * Get the unique name.
+ */
+ String getName();
+
+ /**
+ * Get the associated Process
+ */
+ Process getProcess();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Node.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+/**
+ * A Participant, which is used in the definition of attributes for a Pool, {@link Message}, and WebService
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Participant
+{
+ /**
+ * The name of this participant
+ */
+ ObjectName getName();
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Participant.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.util.List;
+
+import javax.management.ObjectName;
+
+import org.jbpm.api.runtime.Attachments;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Process extends AbstractElement
+{
+ /**
+ * Defines the status a {@link Process} can be in
+ */
+ public enum ProcessStatus
+ {
+ None, Ready, Active, Cancelled, Aborting, Aborted, Completing, Completed
+ }
+
+ /**
+ * Get the unique name.
+ */
+ String getName();
+
+ /**
+ * Get the process state
+ */
+ ProcessStatus getProcessStatus();
+
+ /**
+ * Get the list of flow objects
+ */
+ List<Node> getNodes();
+
+ /**
+ * Get a list of flow objects of a given type.
+ */
+ <T extends Node> List<T> getNodes(Class<T> clazz);
+
+ /**
+ * Get a flow object by name.
+ * @return null if not found
+ */
+ Node getNode(String name);
+
+ // Runtime Aspects ====================================================================================================
+
+ /**
+ * Start the process
+ */
+ ObjectName startProcess();
+
+ /**
+ * Start the process, with a given execution context
+ */
+ ObjectName startProcess(Attachments att);
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event.
+ * The Process will be in a running state until all Tokens are consumed.
+ * <p/>
+ * This method until the process ends without timeout.
+ */
+ ProcessStatus waitForEnd();
+
+ /**
+ * All Tokens that are generated at the Start Event for that Process must eventually arrive at an End Event.
+ * The Process will be in a running state until all Tokens are consumed.
+ * <p/>
+ * This method until the process ends with a given timeout.
+ */
+ ProcessStatus waitForEnd(long timeout);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Process.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,119 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+// $Id$
+
+/**
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ProcessBuilder extends Builder
+{
+ /**
+ * Add a {@link Process} with a given name
+ */
+ ProcessBuilder addProcess(String name);
+
+ /**
+ * Get the {@link Process}.
+ * <p/>
+ * This is the final call to the ProcessBuilder after all elements have been added.
+ * The {@link Process} is initialized and put in state READY
+ */
+ Process getProcess();
+
+ /**
+ * Get the {@link Process} for inclusion in another.
+ * <p/>
+ * This is the final call to the ProcessBuilder after all elements have been added.
+ * The {@link Process} is not initialized and stays in state CREATED
+ */
+ Process getProcessForInclude();
+
+ /**
+ * Add a SequenceFlow with a given name
+ */
+ ProcessBuilder addSequenceFlow(String targetName);
+
+ /**
+ * Add a MessageFlow with a given name
+ */
+ ProcessBuilder addMessageFlow(String targetName);
+
+ /**
+ * Add a SartEvent with a given name
+ */
+ ProcessBuilder addStartEvent(String name);
+
+ /**
+ * Add an IntermediateEvent with a given name
+ */
+ ProcessBuilder addEvent(String name);
+
+ /**
+ * Add an EndEvent with a given name
+ */
+ ProcessBuilder addEndEvent(String name);
+
+ /**
+ * Add a Task of {@link Task.TaskType} NONE with a given name
+ */
+ ProcessBuilder addTask(String name);
+
+ /**
+ * Add a Task with a given name and type
+ */
+ ProcessBuilder addTask(String name, Task.TaskType type);
+
+ /**
+ * Add a Gateway with a given name
+ */
+ ProcessBuilder addGateway(String name, Gateway.GatewayType type);
+
+ /**
+ * Add a {@link Message} with a given name.
+ */
+ MessageBuilder addMessage(String name);
+
+ /**
+ * Add a process property
+ */
+ ProcessBuilder addProperty(String name, String value);
+
+ /**
+ * Add an {@link ExecutionHandler} with a given Class
+ */
+ ProcessBuilder addExecutionHandler(Class<?> clazz);
+
+ /**
+ * Add an {@link FlowHandler} with a given Class
+ */
+ ProcessBuilder addFlowHandler(Class<?> clazz);
+
+ /**
+ * Add an {@link SignalHandler} with a given Class
+ */
+ ProcessBuilder addSignalHandler(Class<?> clazz);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/ProcessBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+// $Id$
+
+/**
+ * A Property, which is used in the definition of attributes for a Process and common activity attributes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface Property
+{
+ /**
+ * Each Property has a Name (e.g., name=”Customer Name”).
+ */
+ String getName();
+
+ /**
+ * Get the body of the expression value.
+ */
+ Object getValue();
+
+ /**
+ * If the Correlation attribute is set to True, then the Property is marked to be used for
+ * correlation (e.g., for incoming Messages).
+ */
+ boolean isCorrelation();
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Property.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.util.List;
+
+/**
+ * Property support
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 21-Jul-2008
+ */
+public interface PropertySupport
+{
+ /**
+ * Get a Property with a given name.
+ */
+ Property getProperty(String name);
+
+ /**
+ * Get the list of property names
+ */
+ List<String> getPropertyNames();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/PropertySupport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * A Sequence Flow is used to show the order that activities will be performed in a Process. Each Flow has only one
+ * source and only one target. The source and target must be from the set of the following Flow Objects: Events (Start,
+ * Intermediate, and End), Activities (Task and Sub-Process), and Gateways. During performance (or simulation) of the
+ * process, a Token will leave the source Flow Object, traverse down the Sequence Flow, and enter the target Flow
+ * Object.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SequenceFlow extends ConnectingObject
+{
+ /**
+ * The ConditionType
+ */
+ public enum ConditionType
+ {
+ None, Expression, Default
+ }
+
+ /**
+ * By default, the ConditionType of a Sequence Flow is None. This means that there is no evaluation at runtime to
+ * determine whether or not the Sequence Flow will be used. Once a Token is ready to traverse the Sequence Flow (i.e.,
+ * the Source is an activity that has completed), then the Token will do so. The normal, uncontrolled use of Sequence
+ * Flow, in a sequence of activities, will have a None ConditionType. A None ConditionType MUST NOT be used if the
+ * Source of the Sequence Flow is an Exclusive Data-Based or Inclusive Gateway. The ConditionType attribute MAY be set
+ * to Expression if the Source of the Sequence Flow is a Task, a Sub-Process, or a Gateway of type Exclusive-Data-
+ * Based or Inclusive. If the ConditionType attribute is set to Expression, then a condition marker SHALL be added to
+ * the line if the Sequence Flow is outgoing from an activity. However, a condition indicator MUST NOT be added to the
+ * line if the Sequence Flow is outgoing from a Gateway. An Expression ConditionType MUST NOT be used if the Source of
+ * the Sequence Flow is an Event-Based Exclusive Gateway, a Complex Gateway, a Parallel Gateway, a Start Event, or an
+ * Intermediate Event. In addition, an Expression ConditionType MUST NOT be used if the Sequence Flow is associated
+ * with the Default Gate of a Gateway. The ConditionType attribute MAY be set to Default only if the Source of the
+ * Sequence Flow is an activity or an Exclusive Data-Based Gateway.
+ */
+ ConditionType getConditionType();
+
+ /**
+ * If the ConditionType attribute is set to Expression, then the ConditionExpression attribute MUST be defined as a
+ * valid expression. The expression will be evaluated at runtime. If the result of the evaluation is TRUE, then a
+ * Token will be generated and will traverse the Sequence--Subject to any constraints imposed by a Source that is a
+ * Gateway.
+ */
+ Expression getConditionExpression();
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/SequenceFlow.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+import java.io.Serializable;
+
+import javax.management.ObjectName;
+
+// $Id$
+
+/**
+ * A Signal thrown by the ProcessEngine
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public final class Signal implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Defines the types of supported Signals
+ */
+ public enum SignalType
+ {
+ SYSTEM_START_EVENT_ENTER, SYSTEM_START_EVENT_EXIT, SYSTEM_START_TRIGGER,
+ SYSTEM_EVENT_ENTER, SYSTEM_EVENT_EXIT, SYSTEM_EVENT_TRIGGER,
+ SYSTEM_END_EVENT_ENTER, SYSTEM_END_EVENT_EXIT, SYSTEM_END_TRIGGER,
+ SYSTEM_GATEWAY_ENTER, SYSTEM_GATEWAY_EXIT,
+ SYSTEM_PROCESS_ENTER, SYSTEM_PROCESS_EXIT,
+ SYSTEM_TASK_ENTER, SYSTEM_TASK_EXIT, SYSTEM_TASK_TRIGGER,
+ USER_SIGNAL
+ }
+
+ private SignalType type;
+ private String message;
+ private ObjectName fromRef;
+
+ /**
+ * Create the signal for a given source and type
+ */
+ public Signal(ObjectName fromRef, SignalType type)
+ {
+ this.fromRef = fromRef;
+ this.type = type;
+ if (fromRef == null)
+ throw new IllegalArgumentException("Signal fromRef cannot be null");
+ if (type == null)
+ throw new IllegalArgumentException("SignalType cannot be null");
+ }
+
+ /**
+ * Create the signal for a given source, type and message
+ */
+ public Signal(ObjectName fromRef, SignalType type, String message)
+ {
+ this(fromRef, type);
+ this.message = message;
+ }
+
+ public ObjectName getFromRef()
+ {
+ return fromRef;
+ }
+
+ public SignalType getSignalType()
+ {
+ return type;
+ }
+
+ public String getMessage()
+ {
+ return message;
+ }
+
+ public String toString()
+ {
+ StringBuilder string = new StringBuilder(type + "[" + fromRef);
+ if (message != null)
+ {
+ string.append(":" + message);
+ }
+ string.append("]");
+ return string.toString();
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Signal.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+// $Id$
+
+/**
+ * A Start Event indicates where a particular Process will start. <p/> In terms of Sequence Flow, the Start Event starts
+ * the Flow of the Process, and thus, will not have any incoming Sequence Flow. A Start Event can have a Trigger that
+ * indicates how the Process starts: Message, Timer, Rule, Link, or Multiple.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface StartEvent extends Event
+{
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StartEvent.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+import java.util.List;
+
+/**
+ * A Process is any Activity performed within a company or organization.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface StructuralProcess extends Process
+{
+ /**
+ * Get the list of flow objects
+ */
+ List<Node> getNodes();
+
+ /**
+ * Get a list of flow objects of a given type.
+ */
+ <T extends Node> List<T> getNodes(Class<T> clazz);
+
+ /**
+ * Get a flow object by name.
+ * @return null if not found
+ */
+ Node getNode(String name);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/StructuralProcess.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.model;
+
+//$Id$
+
+/**
+ * A Task is an Atomic Activity that is included within a Process.
+ *
+ * A Task is used when the work in the Process is not broken down to a finer level of Process Model detail. Generally, an end-user and/or an application are used to
+ * perform the Task when it is executed.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Task extends Node
+{
+ /**
+ * The TaskType
+ */
+ public enum TaskType
+ {
+ Service, Receive, Send, User, Script, Manual, Reference, None
+ }
+
+ /**
+ * TaskType is an attribute that has a default of None, but MAY be set to Send,
+ * Receive, User, Script, Manual, Reference, or Service. The TaskType will be
+ * impacted by the Message Flow to and/or from the Task, if Message Flow are
+ * used. A TaskType of Receive MUST NOT have an outgoing Message Flow. A
+ * TaskType of Send MUST NOT have an incoming Message Flow. A TaskType of
+ * Script or Manual MUST NOT have an incoming or an outgoing Message Flow.
+ * The TaskType list MAY be extended to include new types.
+ */
+ TaskType getTaskType();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/model/Task.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,142 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import java.util.Collection;
+
+/**
+ * An interface for general Attachments
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Attachments
+{
+ /** Get attachment keys */
+ Collection<Key> getAttachmentKeys();
+
+ /** Add arbitrary attachment */
+ <T> T addAttachment(Class<T> clazz, Object value);
+
+ /** Add arbitrary attachment with name */
+ <T> T addAttachment(Class<T> clazz, String name, Object value);
+
+ /** Add arbitrary attachment with name */
+ Object addAttachment(String name, Object value);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(Class<T> clazz);
+
+ /** Get an arbitrary attachment */
+ <T> T getAttachment(Class<T> clazz, String name);
+
+ /** Get an arbitrary attachment */
+ Object getAttachment(String name);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> clazz);
+
+ /** Remove arbitrary attachments */
+ <T> T removeAttachment(Class<T> clazz, String name);
+
+ /** Remove arbitrary attachments */
+ Object removeAttachment(String name);
+
+ /**
+ * A key for attachements
+ */
+ public static class Key
+ {
+ private Class<?> clazz;
+ private String name;
+
+ /**
+ * Construct the key with optional class and name
+ */
+ public Key(Class<?> clazz, String name)
+ {
+ this.clazz = clazz;
+ this.name = name;
+ }
+
+ /**
+ * Get the class part for this key
+ *
+ * @return maybe null
+ */
+ public Class<?> getClassPart()
+ {
+ return clazz;
+ }
+
+ /**
+ * Get the name part for this key
+ *
+ * @return maybe null
+ */
+ public String getNamePart()
+ {
+ return name;
+ }
+
+ /**
+ * Two keys are equal if their {@link #toString()} is equal
+ */
+ public boolean equals(Object obj)
+ {
+ if (!(obj instanceof Key))
+ return false;
+ if (obj == this)
+ return true;
+ return obj.toString().equals(toString());
+ }
+
+ /**
+ * Two keys have the same hashCode if their {@link #toString()} is equal
+ */
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+ /**
+ * Returns the String repesentation of this Key. <p/>
+ * <pre>
+ * "[" + clazz + "," + name + "]"
+ * </pre>
+ */
+ public String toString()
+ {
+ StringBuilder str = new StringBuilder("[");
+ if (clazz != null)
+ str.append(clazz.getName());
+ if (clazz != null && name != null)
+ str.append(",");
+ if (name != null)
+ str.append(name);
+ str.append("]");
+ return str.toString();
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Attachments.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+
+/**
+ * Basic attachments.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public class BasicAttachments implements Attachments
+{
+ private Map<Key, Object> attachments = new HashMap<Key, Object>();
+
+ /** Construct the execution context with no attachments */
+ public BasicAttachments()
+ {
+
+ }
+
+ /** Construct the execution context with given attachments */
+ public BasicAttachments(Attachments att)
+ {
+ if (att != null)
+ {
+ for (Key key : att.getAttachmentKeys())
+ {
+ Object value = att.getAttachment(key.getClassPart(), key.getNamePart());
+ this.attachments.put(key, value);
+ }
+ }
+ }
+
+ public Collection<Key> getAttachmentKeys()
+ {
+ return attachments.keySet();
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz)
+ {
+ return (T)attachments.get(new Key(clazz, null));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getAttachment(Class<T> clazz, String name)
+ {
+ return (T)attachments.get(new Key(clazz, name));
+ }
+
+ public Object getAttachment(String name)
+ {
+ return attachments.get(new Key(null, name));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, Object obj)
+ {
+ return (T)attachments.put(new Key(clazz, null), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T addAttachment(Class<T> clazz, String name, Object obj)
+ {
+ return (T)attachments.put(new Key(clazz, name), obj);
+ }
+
+ public Object addAttachment(String name, Object obj)
+ {
+ return attachments.put(new Key(null, name), obj);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz)
+ {
+ return (T)attachments.remove(new Key(clazz, null));
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T removeAttachment(Class<T> clazz, String name)
+ {
+ return (T)attachments.remove(new Key(clazz, name));
+ }
+
+ public Object removeAttachment(String name)
+ {
+ return attachments.remove(new Key(null, name));
+ }
+
+ public String toString()
+ {
+ return attachments.toString();
+ }
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicAttachments.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+//$Id$
+
+/**
+ * A basic ExecutionContext.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 15-Aug-2008
+ */
+public class BasicExecutionContext extends BasicAttachments implements ExecutionContext
+{
+ public BasicExecutionContext()
+ {
+ }
+
+ public BasicExecutionContext(Attachments att)
+ {
+ super(att);
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/BasicExecutionContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+
+/**
+ * An execution context that can take attachments.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface ExecutionContext extends Attachments
+{
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+//$Id$
+
+
+/**
+ * The ProcessEngine invokes the ExecutionHandler on a
+ * Node to execute user provided business logic.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface ExecutionHandler extends Handler
+{
+ /**
+ * Execute the associated business logic.
+ */
+ void execute(Token token);
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/ExecutionHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+
+/**
+ * The {@link ProcessEngine} invokes the FlowHandler on an {@link HandlerSupport}
+ * {@link Node} to move the {@link Token} to the next {@link Node}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface FlowHandler extends Handler
+{
+ /**
+ * Execute the FlowHandler.
+ * <p/>
+ * The FlowHandler typically invoves one of the {@link TokenExecutor}
+ * methods to move the {@link Token} to the next {@link Node}.
+ */
+ void execute(TokenExecutor tokenExecutor, Token token);
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/FlowHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+import java.io.Serializable;
+
+//$Id$
+
+/**
+ * The generic base for handlers that can be associated with a Node.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface Handler extends Serializable
+{
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Handler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Signal;
+
+/**
+ * The {@link ProcessEngine} invokes the SignalHandler on an {@link HandlerSupport}
+ * {@link Node} to send {@link Signal}s.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface SignalHandler extends Handler
+{
+ /**
+ * Get signal for enter
+ */
+ void throwEnterSignal(Token token);
+
+ /**
+ * Get signal for exit
+ */
+ void throwExitSignal(Token token);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/SignalHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+// $Id$
+
+import org.jbpm.api.model.SequenceFlow;
+
+/**
+ * A Token is a descriptive construct used to describe how the flow of a Process will proceed at runtime.
+ *
+ * By tracking how the Token traverses the Flow Objects, gets diverted through alternative paths, and gets split into parallel paths, the normal Sequence Flow should be
+ * completely definable.
+ *
+ * A Token will have a unique identity that can be used to separate multiple Tokens that may exist because of concurrent process instances or the splitting of the Token
+ * for parallel processing within a single process instance.
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 20-Apr-2007
+ */
+public interface Token
+{
+ public enum TokenStatus
+ {
+ Created, Started, Stoped, Destroyed, Suspended
+ }
+
+ /**
+ * Get the token status
+ */
+ TokenStatus getTokenStatus();
+
+ /**
+ * Get the unique token identity
+ */
+ String getTokenID();
+
+ /**
+ * Get the associated {@link ExecutionContext}
+ */
+ ExecutionContext getExecutionContext();
+
+ /**
+ * Get the current {@link SequenceFlow}
+ */
+ SequenceFlow getFlow();
+
+ /**
+ * Create a schallow copy of this Token.
+ * <p/>
+ * The content in the ExecutionContext will be copied by reference.
+ */
+ Token copyToken();
+
+ /**
+ * Merge this Token with another token.
+ */
+ void mergeToken(Token token);
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/Token.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.runtime;
+
+//$Id$
+
+import java.util.Set;
+
+import org.jbpm.api.model.SequenceFlow;
+
+/**
+ * The {@link FlowHandler} invokes the TokenExecutor to move {@link Token}s
+ * along the {@link SequenceFlow}s in the {@link Process}.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 08-Jul-2008
+ */
+public interface TokenExecutor
+{
+ /**
+ * Get the set of active tokens
+ */
+ Set<Token> getRunnableTokens();
+
+ /**
+ * True if there are active tokens
+ */
+ boolean hasRunnableTokens();
+
+ /**
+ * Create a {@link Token} with an initial flow
+ */
+ void create(Token token, SequenceFlow flow);
+
+ /**
+ * Start a {@link Token}
+ */
+ void start(Token token);
+
+ /**
+ * Stop a {@link Token}
+ */
+ void stop(Token token);
+
+ /**
+ * Destroy a {@link Token}
+ */
+ void destroy(Token token);
+
+ /**
+ * Suspend a {@link Token}
+ */
+ String suspend(Token token);
+
+ /**
+ * Activate a {@link Token}
+ */
+ Token activate(String tokenID);
+
+ /**
+ * Move a given {@link Token} along a given flow.
+ */
+ void move(Token token, SequenceFlow flow);
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/runtime/TokenExecutor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * A deployment, containing all information to create a process that will be deployed to the {@link ProcessService}
+ *
+ * @author Tom Baeyens
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public class Deployment implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private String procXML;
+
+ public Deployment(String procXML)
+ {
+ if (procXML == null)
+ throw new IllegalArgumentException("Null process definition");
+
+ this.procXML = procXML;
+ }
+
+ public Deployment(URL procURL) throws IOException
+ {
+ if (procURL == null)
+ throw new IllegalArgumentException("Null process definition");
+
+ StringBuilder strBuilder = new StringBuilder();
+ BufferedReader br = new BufferedReader(new InputStreamReader(procURL.openStream()));
+ String line = br.readLine();
+ while (line != null)
+ {
+ strBuilder.append(line);
+ line = br.readLine();
+ }
+ procXML = strBuilder.toString();
+ }
+
+ public String getProcessXML()
+ {
+ return procXML;
+ }
+
+ public URI getNamespaceURI()
+ {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ Document doc;
+ try
+ {
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ doc = db.parse(new ByteArrayInputStream(procXML.getBytes()));
+ }
+ catch (Exception ex)
+ {
+ throw new IllegalStateException("Cannot parse process descriptor", ex);
+ }
+
+ Element root = doc.getDocumentElement();
+ String nsURI = root.getNamespaceURI();
+ if (nsURI == null)
+ throw new IllegalStateException("Cannot get namespace URI from root element");
+
+ return URI.create(nsURI);
+ }
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Deployment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The marker interface for all Services
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public abstract class DeploymentService implements Service
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(DeploymentService.class);
+
+ /**
+ * Deploy a new process to the process service.
+ */
+ ObjectName deploy(Deployment deployment)
+ {
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DeploymentService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.io.IOException;
+import java.io.Writer;
+import java.net.URI;
+import java.net.URL;
+
+/**
+ * The DialectHandler converts a supported dialect to the Process model.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+public interface DialectHandler
+{
+ URI DEFAULT_NAMESPACE_URI = URI.create("urn:bpm.jboss:pdl-0.1");
+
+ /**
+ * Get the the supported namespace from this dialect.
+ */
+ URI getNamespaceURI();
+
+ /**
+ * Create a {@link Process} from a descriptor.
+ * @param isInclude TODO
+ */
+ Process createProcess(String pXML);
+
+ /**
+ * Create a {@link Process} from a descriptor URL.
+ * @param isInclude TODO
+ */
+ Process createProcess(URL pURL) throws IOException;
+
+ /**
+ * Marshall the process to the given writer
+ */
+ void marshallProcess(Process proc, Writer out) throws IOException;
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.net.URI;
+import java.util.Map;
+
+
+/**
+ * A registry that maps namespaceURI to a {@link DialectHandler}
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jul-2008
+ */
+public abstract class DialectRegistry
+{
+ // Maps namespaceURI to a DialectHandler
+ protected Map<URI, DialectHandler> dialectHandlers;
+
+ /**
+ * Get the handler for the dialect with the given namespace URI
+ */
+ public DialectHandler getDialectHandler(URI nsURI)
+ {
+ DialectHandler dialectHandler = dialectHandlers.get(nsURI);
+ if (dialectHandler == null)
+ throw new IllegalStateException("No dialect handler registered for: " + nsURI);
+
+ return dialectHandler;
+ }
+
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/DialectRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A registry of ProcessEngine instances per VM
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public final class ProcessEngineRegistry
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessEngineRegistry.class);
+
+ // The process engine registry
+ static Map<String, ProcessEngine> engineRegistry = new HashMap<String, ProcessEngine>();
+
+ // Hide constructor
+ private ProcessEngineRegistry()
+ {
+ }
+
+ /**
+ * Get the set of registered engine names
+ */
+ public static Set<String> getEngineNames()
+ {
+ return engineRegistry.keySet();
+ }
+
+ /**
+ * Get a process engine by name
+ * @return null, if there is no engine registered under the given name
+ */
+ public static ProcessEngine getEngine(String engineName)
+ {
+ return engineRegistry.get(engineName);
+ }
+
+ /**
+ * Register a ProcessEngine
+ * @throws IllegalStateException If a ProcessEngine with that name is already registered
+ */
+ public static void registerEngine(ProcessEngine engine)
+ {
+ if (engineRegistry.get(engine.getName()) != null)
+ throw new IllegalStateException("Process engine already registered: " + engine.getName());
+
+ log.debug("Register: " + engine);
+ engineRegistry.put(engine.getName(), engine);
+ }
+
+ /**
+ * Unregister a ProcessEngine for a given name
+ */
+ public static ProcessEngine unregisterEngine(String name)
+ {
+ ProcessEngine pe = engineRegistry.remove(name);
+ log.debug("Unregister: " + name + "=" + pe);
+ return pe;
+ }
+
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessEngineRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+//$Id$
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The marker interface for all Services
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public abstract class ProcessService implements Service
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessService.class);
+
+ // The set of registered processes
+ private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+
+ // Hide public constructor
+ protected ProcessService()
+ {
+ }
+
+ /**
+ * Deploy a new process to the process service.
+ */
+ ObjectName deploy(Deployment deployment)
+ {
+
+ return null;
+ }
+
+ /**
+ * Get the set of registered Processes
+ */
+ public Set<Process> getProcesses()
+ {
+ Set<Process> procSet = new HashSet<Process>(procs.values());
+ return Collections.unmodifiableSet(procSet);
+ }
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/ProcessService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.service;
+
+import org.jbpm.api.client.ProcessEngine;
+
+//$Id$
+
+/**
+ * The base interface for all Services
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 25-Sep-2008
+ */
+public interface Service
+{
+ /**
+ * Get the associated ProcessEngine
+ */
+ ProcessEngine getProcessEngine();
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/service/Service.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -23,9 +23,9 @@
import java.net.URL;
-import org.jbpm.api.client.MicrocontainerConfiguration;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.ProcessEngineRegistry;
+import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.service.ProcessEngineRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,14 +62,14 @@
MicrocontainerConfiguration configuration = new MicrocontainerConfiguration();
configuration.deployBeansConfig(cfgURL);
ProcessEngine engine = configuration.getProcessEngine(CTS_TEST_ENGINE);
- ProcessEngineRegistry.registerProcessEngine(engine);
+ ProcessEngineRegistry.registerEngine(engine);
}
@Override
protected void tearDown() throws Exception
{
URL cfgURL = helper.getResourceURL(beansConfig);
- ProcessEngineRegistry.unregisterProcessEngine(CTS_TEST_ENGINE);
+ ProcessEngineRegistry.unregisterEngine(CTS_TEST_ENGINE);
new MicrocontainerConfiguration().undeployBeansConfig(cfgURL);
super.tearDown();
}
Modified: jbpm4/branches/tdiesler/modules/cts/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/pom.xml 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/cts/pom.xml 2008-09-26 17:41:47 UTC (rev 2403)
@@ -75,27 +75,6 @@
</dependencies>
</profile>
- <!--
- Name: impl-ri
- Descr: The RI implementation profile
- -->
- <profile>
- <id>impl-ri</id>
- <activation>
- <property>
- <name>impl</name>
- <value>pvm</value>
- </property>
- </activation>
- <dependencies>
- <dependency>
- <groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-pvm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
- </profile>
-
</profiles>
</project>
\ No newline at end of file
Modified: jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-09-26 17:41:47 UTC (rev 2403)
@@ -25,9 +25,9 @@
import java.net.URL;
-import org.jbpm.api.client.MicrocontainerConfiguration;
import org.jbpm.api.client.ProcessEngine;
-import org.jbpm.api.client.ProcessEngineRegistry;
+import org.jbpm.api.config.MicrocontainerConfiguration;
+import org.jbpm.api.service.ProcessEngineRegistry;
import org.jbpm.api.test.CTSTestCase;
/**
@@ -56,12 +56,12 @@
URL cfgURL = getResourceURL("cts/processengine/test-cfg-beans.xml");
String engineName = "CTSTestEngine";
- MicrocontainerConfiguration configuration = new MicrocontainerConfiguration();
- configuration.deployBeansConfig(cfgURL);
+ MicrocontainerConfiguration config = new MicrocontainerConfiguration();
try
{
- ProcessEngine engineOne = configuration.getProcessEngine(engineName);
+ // test that we can get the engine from the configuration
+ ProcessEngine engineOne = config.deployBeansConfig(cfgURL).getProcessEngine(engineName);
assertNotNull("ProcessEngine not null", engineOne);
assertEquals("ProcessEngine name", engineName, engineOne.getName());
@@ -70,7 +70,7 @@
assertNull("ProcessEngine null", engineTwo);
// register the engine and do the lockup again
- ProcessEngineRegistry.registerProcessEngine(engineOne);
+ ProcessEngineRegistry.registerEngine(engineOne);
engineTwo = ProcessEngine.getProcessEngine(engineName);
assertNotNull("ProcessEngine not null", engineTwo);
assertSame("ProcessEngine same", engineOne, engineTwo);
@@ -78,7 +78,7 @@
// Try to register the engine twice
try
{
- ProcessEngineRegistry.registerProcessEngine(engineTwo);
+ ProcessEngineRegistry.registerEngine(engineTwo);
fail("Expceted IllegalStateException");
}
catch (IllegalStateException e)
@@ -88,7 +88,8 @@
}
finally
{
- configuration.undeployBeansConfig(cfgURL);
+ ProcessEngineRegistry.unregisterEngine(engineName);
+ config.undeployBeansConfig(cfgURL);
}
}
}
Deleted: jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration 2008-09-26 17:41:47 UTC (rev 2403)
@@ -1 +0,0 @@
-org.jbpm.api.client.MicrocontainerConfiguration
\ No newline at end of file
Added: jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.config.Configuration
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.config.Configuration (rev 0)
+++ jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.config.Configuration 2008-09-26 17:41:47 UTC (rev 2403)
@@ -0,0 +1 @@
+org.jbpm.api.config.MicrocontainerConfiguration
\ No newline at end of file
Modified: jbpm4/branches/tdiesler/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/pom.xml 2008-09-26 16:01:53 UTC (rev 2402)
+++ jbpm4/branches/tdiesler/pom.xml 2008-09-26 17:41:47 UTC (rev 2403)
@@ -170,9 +170,20 @@
<!-- DistributionManagement -->
<distributionManagement>
+ <!--
+ Add this to your ~/.m2/settings.xml
+ <servers>
+ <server>
+ <id>jbpm.dyndns.org</id>
+ <username>yourname</username>
+ <privateKey>/home/yourname/.ssh/id_rsa</privateKey>
+ <passphrase>yourpass</passphrase>
+ </server>
+ </servers>
+ -->
<site>
- <id>local.site</id>
- <url>file:///${publications}/pvm/site</url>
+ <id>jbpm.dyndns.org</id>
+ <url>scp://jbpm.dyndns.org/var/www/html/jbpm-site</url>
</site>
</distributionManagement>
17 years, 6 months
JBoss JBPM SVN: r2402 - in jbpm4/branches/tdiesler: modules/api and 12 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-26 12:01:53 -0400 (Fri, 26 Sep 2008)
New Revision: 2402
Added:
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestCase.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration
Removed:
jbpm4/branches/tdiesler/modules/impl/scripts/
jbpm4/branches/tdiesler/modules/impl/src/main/java/org/jboss/
jbpm4/branches/tdiesler/modules/impl/src/main/resources/hibernate.cfg.hsqldb.xml
jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.ProcessEngineProvider
jbpm4/branches/tdiesler/modules/impl/src/test/java/org/
jbpm4/branches/tdiesler/modules/impl/src/test/resources/jbpm-beans.xml
Modified:
jbpm4/branches/tdiesler/.project
jbpm4/branches/tdiesler/modules/api/pom.xml
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java
jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestSetup.java
jbpm4/branches/tdiesler/modules/cts/pom.xml
jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
jbpm4/branches/tdiesler/modules/cts/src/test/resources/cts/processengine/test-cfg-beans.xml
jbpm4/branches/tdiesler/modules/cts/src/test/resources/log4j.xml
jbpm4/branches/tdiesler/modules/impl/pom.xml
jbpm4/branches/tdiesler/pom.xml
Log:
More work on MC config
Modified: jbpm4/branches/tdiesler/.project
===================================================================
--- jbpm4/branches/tdiesler/.project 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/.project 2008-09-26 16:01:53 UTC (rev 2402)
@@ -6,18 +6,12 @@
</projects>
<buildSpec>
<buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>
Modified: jbpm4/branches/tdiesler/modules/api/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/api/pom.xml 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/pom.xml 2008-09-26 16:01:53 UTC (rev 2402)
@@ -17,13 +17,11 @@
<artifactId>jbpm-api</artifactId>
<packaging>jar</packaging>
- <version>1.0.0-SNAPSHOT</version>
-
<!-- Parent -->
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/Configuration.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -33,10 +33,14 @@
public interface Configuration
{
/**
- * Get the ProcessEngine for this configuration
- * <p/>
- *
+ * Create a new instance of ProcessEngine for this configuration
* @return The configured instance of a process engine
*/
ProcessEngine getProcessEngine();
+
+ /**
+ * Get a ProcessEngine with a given name from this configuration
+ * @return The configured instance of a process engine
+ */
+ ProcessEngine getProcessEngine(String engineName);
}
\ No newline at end of file
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/MicrocontainerConfiguration.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -28,7 +28,6 @@
import org.jboss.kernel.Kernel;
import org.jboss.kernel.plugins.util.KernelLocator;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
-import org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException;
import org.jbpm.api.client.internal.EmbeddedBeansDeployer;
/**
@@ -44,50 +43,64 @@
/** The default bean config: jbpm-cfg-beans.xml */
public static final String JBPM_ENGINE_CONFIG = "jbpm-cfg-beans.xml";
- private URL cfgURL;
-
- public MicrocontainerConfiguration(URL cfgURL)
+ // Everything gets deployed through one deployer
+ private static EmbeddedBeansDeployer beansDeployer = new EmbeddedBeansDeployer();
+
+ public void deployDefaultConfig()
{
- this.cfgURL = cfgURL;
+ URL cfgURL = getDefaultConfigURL();
+ beansDeployer.deploy(cfgURL);
}
- public MicrocontainerConfiguration()
+ public void undeployDefaultConfig()
{
- cfgURL = Thread.currentThread().getContextClassLoader().getResource(JBPM_ENGINE_CONFIG);
- if (cfgURL == null)
- throw new IllegalStateException("Cannot find resource: " + JBPM_ENGINE_CONFIG);
+ URL cfgURL = getDefaultConfigURL();
+ beansDeployer.undeploy(cfgURL);
}
+ public void deployBeansConfig(URL cfgURL)
+ {
+ beansDeployer.deploy(cfgURL);
+ }
+
+ public void undeployBeansConfig(URL cfgURL)
+ {
+ beansDeployer.undeploy(cfgURL);
+ }
+
/**
- * Get the ProcessEngine from this provider
- *
+ * Get the default ProcessEngine from this configuration
* @return The configured instance of a process engine
*/
- @SuppressWarnings("deprecation")
public ProcessEngine getProcessEngine()
{
- KernelRegistryEntry entry = null;
+ return getProcessEngine(BEAN_NAME);
+ }
+
+ /**
+ * Get a ProcessEngine with a given name from this configuration
+ * @return The configured instance of a process engine
+ */
+ @SuppressWarnings("deprecation")
+ public ProcessEngine getProcessEngine(String beanName)
+ {
Kernel kernel = KernelLocator.getKernel();
if (kernel == null)
{
- new EmbeddedBeansDeployer().deploy(cfgURL);
+ deployDefaultConfig();
kernel = KernelLocator.getKernel();
- entry = kernel.getRegistry().getEntry(BEAN_NAME);
}
- else
- {
- try
- {
- entry = kernel.getRegistry().getEntry(BEAN_NAME);
- }
- catch (KernelRegistryEntryNotFoundException ex)
- {
- new EmbeddedBeansDeployer().deploy(cfgURL);
- entry = kernel.getRegistry().getEntry(BEAN_NAME);
- }
- }
-
+
+ KernelRegistryEntry entry = kernel.getRegistry().getEntry(beanName);
ProcessEngine engine = (ProcessEngine)entry.getTarget();
return engine;
}
+
+ private URL getDefaultConfigURL()
+ {
+ URL cfgURL = Thread.currentThread().getContextClassLoader().getResource(JBPM_ENGINE_CONFIG);
+ if (cfgURL == null)
+ throw new IllegalStateException("Cannot find resource: " + JBPM_ENGINE_CONFIG);
+ return cfgURL;
+ }
}
\ No newline at end of file
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngine.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -33,17 +33,15 @@
import org.slf4j.LoggerFactory;
/**
- * The process engine is an agregator of various service objects used by the BPM engine.
- * <p/>
- * A ProcessEngine is always created via one of the available {@link Configuration} objects. Every implementation of the
- * API has one default {@link Configuration} which is configured via a resource file with the fully qualified class name
- * of {@link Configuration}.
- * <p/>
- * The API natively supports {@link MicrocontainerConfiguration}. To create and register a ProcessEngine explicitly, you
- * would do
+ * The process engine is an agregator of various service objects used by the BPM engine. <p/> A ProcessEngine is always
+ * created via one of the available {@link Configuration} objects. Every implementation of the API has one default
+ * {@link Configuration} which is configured via a resource file with the fully qualified class name of
+ * {@link Configuration}. <p/> The API natively supports {@link MicrocontainerConfiguration}. To create and register a
+ * ProcessEngine explicitly, you would do
+ *
* <pre>
- * ProcessEngine engine = new MicrocontainerConfiguration(cfgURL).getProcessEngine();
- * ProcessEngineRegistry.registerProcessEngine(engine);
+ * ProcessEngine engine = new MicrocontainerConfiguration(cfgURL).getProcessEngine();
+ * ProcessEngineRegistry.registerProcessEngine(engine);
* </pre>
*
* @author thomas.diesler(a)jboss.com
@@ -124,6 +122,13 @@
this.name = name;
}
+ /**
+ * Do a shutdown of this
+ */
+ public void shutdownProcessEngine()
+ {
+ }
+
private static void loadDefaultEngine()
{
ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
@@ -131,24 +136,24 @@
if (instream == null)
throw new IllegalStateException("Cannot find resource: " + Configuration.class.getName());
- Configuration configuration = null;
+ Configuration config;
try
{
BufferedReader br = new BufferedReader(new InputStreamReader(instream));
String configurationClassName = br.readLine();
Class<?> configurationClass = ctxLoader.loadClass(configurationClassName);
- configuration = (Configuration)configurationClass.newInstance();
+ config = (Configuration)configurationClass.newInstance();
}
catch (Exception ex)
{
throw new IllegalStateException("Cannot obtain configuration", ex);
}
- ProcessEngine pe = configuration.getProcessEngine();
- if (pe == null)
- throw new IllegalStateException("Cannot obtain engine from configuration: " + configuration);
+ ProcessEngine engine = config.getProcessEngine();
+ if (engine == null)
+ throw new IllegalStateException("Cannot obtain engine from configuration: " + config);
- ProcessEngineRegistry.registerProcessEngine(pe);
+ ProcessEngineRegistry.registerProcessEngine(engine);
}
@Override
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/ProcessEngineRegistry.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -61,13 +61,13 @@
* Register a ProcessEngine
* @throws IllegalStateException If a ProcessEngine with that name is already registered
*/
- public static void registerProcessEngine(ProcessEngine pe)
+ public static void registerProcessEngine(ProcessEngine engine)
{
- if (engineRegistry.get(pe.getName()) != null)
- throw new IllegalStateException("Process engine already regitered: " + pe.getName());
+ if (engineRegistry.get(engine.getName()) != null)
+ throw new IllegalStateException("Process engine already registered: " + engine.getName());
- log.debug("Register: " + pe);
- engineRegistry.put(pe.getName(), pe);
+ log.debug("Register: " + engine);
+ engineRegistry.put(engine.getName(), engine);
}
/**
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/client/internal/EmbeddedBeansDeployer.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -73,8 +73,6 @@
public void deploy(URL url)
{
log.debug("deploy: " + url);
-
- // Deploy the beans
try
{
deployer.deploy(url);
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestCase.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -40,13 +40,13 @@
{
// Provide logging
final Logger log = LoggerFactory.getLogger(CTSTestCase.class);
-
+
private CTSTestHelper delegate = new CTSTestHelper();
-
+
@Override
protected void setUp() throws Exception
{
- log.debug("setUp: " + getClass().getName());
+ log.debug("### START " + getLongName());
super.setUp();
}
@@ -54,16 +54,21 @@
protected void tearDown() throws Exception
{
super.tearDown();
- log.debug("tearDown: " + getClass().getName());
+ log.debug("### END " + getLongName());
}
-
- public URL getResourceURL(String resource) throws MalformedURLException
+
+ protected URL getResourceURL(String resource) throws MalformedURLException
{
return delegate.getResourceURL(resource);
}
- public File getResourceFile(String resource)
+ protected File getResourceFile(String resource)
{
return delegate.getResourceFile(resource);
}
+
+ protected String getLongName()
+ {
+ return getClass().getName() + "." + getName();
+ }
}
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/CTSTestSetup.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -22,7 +22,7 @@
package org.jbpm.api.test;
import junit.extensions.TestSetup;
-import junit.framework.Test;
+import junit.framework.TestSuite;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -37,9 +37,24 @@
{
// Provide logging
final Logger log = LoggerFactory.getLogger(CTSTestSetup.class);
-
- public CTSTestSetup(Test test)
+
+ public CTSTestSetup(Class<?> testCase)
{
- super(test);
+ super(new TestSuite(testCase));
}
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ log.debug("### START SETUP " + getTest());
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ log.debug("### END SETUP " + getTest());
+ }
+
}
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestCase.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestCase.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestCase.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.test;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A CTS test case
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class ConfigurationTestCase extends CTSTestCase
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(ConfigurationTestCase.class);
+
+ // By convention a this test case should have a setup that deployes
+ // and registers an engine named CTSTestEngine
+ protected ProcessEngine getProcessEngine()
+ {
+ ProcessEngine engine = ProcessEngine.getProcessEngine(ConfigurationTestSetup.CTS_TEST_ENGINE);
+ if (engine == null)
+ throw new IllegalStateException("Cannot obtain process engine: " + ConfigurationTestSetup.CTS_TEST_ENGINE);
+
+ return engine;
+ }
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java (rev 0)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.api.test;
+
+import java.net.URL;
+
+import org.jbpm.api.client.MicrocontainerConfiguration;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.client.ProcessEngineRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A CTS test setup
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Sep-2008
+ */
+public class ConfigurationTestSetup extends CTSTestSetup
+{
+ public static final String CTS_TEST_ENGINE = "CTSTestEngine";
+
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(ConfigurationTestSetup.class);
+
+ private CTSTestHelper helper = new CTSTestHelper();
+ private String beansConfig;
+
+
+ public ConfigurationTestSetup(Class<?> testCase, String beansConfig)
+ {
+ super(testCase);
+ this.beansConfig = beansConfig;
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ // deploy the provided beans config and register the engine
+ URL cfgURL = helper.getResourceURL(beansConfig);
+ MicrocontainerConfiguration configuration = new MicrocontainerConfiguration();
+ configuration.deployBeansConfig(cfgURL);
+ ProcessEngine engine = configuration.getProcessEngine(CTS_TEST_ENGINE);
+ ProcessEngineRegistry.registerProcessEngine(engine);
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ URL cfgURL = helper.getResourceURL(beansConfig);
+ ProcessEngineRegistry.unregisterProcessEngine(CTS_TEST_ENGINE);
+ new MicrocontainerConfiguration().undeployBeansConfig(cfgURL);
+ super.tearDown();
+ }
+
+}
Property changes on: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/ConfigurationTestSetup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestSetup.java
===================================================================
--- jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestSetup.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/api/src/main/java/org/jbpm/api/test/IntegrationTestSetup.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -32,9 +32,6 @@
import javax.management.MBeanServerConnection;
import javax.naming.NamingException;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
/**
* A test setup that deploys/undeploys archives
*
@@ -49,21 +46,10 @@
public IntegrationTestSetup(Class<?> testClass, String archiveList)
{
- super(new TestSuite(testClass));
+ super(testClass);
getArchiveArray(archiveList);
}
- public IntegrationTestSetup(Test test, String archiveList)
- {
- super(test);
- getArchiveArray(archiveList);
- }
-
- public IntegrationTestSetup(Test test)
- {
- super(test);
- }
-
public File getArchiveFile(String archive)
{
return delegate.getArchiveFile(archive);
Modified: jbpm4/branches/tdiesler/modules/cts/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/pom.xml 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/cts/pom.xml 2008-09-26 16:01:53 UTC (rev 2402)
@@ -17,13 +17,11 @@
<artifactId>jbpm-cts</artifactId>
<packaging>jar</packaging>
- <version>1.0.0-SNAPSHOT</version>
-
<!-- Parent -->
<parent>
<groupId>org.jbpm.jbpm4</groupId>
<artifactId>jbpm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@@ -71,8 +69,8 @@
<dependencies>
<dependency>
<groupId>org.jbpm.jbpm4</groupId>
- <artifactId>jbpm-pvm</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <artifactId>jbpm-impl</artifactId>
+ <version>${version}</version>
</dependency>
</dependencies>
</profile>
@@ -86,14 +84,14 @@
<activation>
<property>
<name>impl</name>
- <value>ri</value>
+ <value>pvm</value>
</property>
</activation>
<dependencies>
<dependency>
- <groupId>org.jbpm.spec</groupId>
- <artifactId>jbpm-spec-ri</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-pvm</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</profile>
Modified: jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/cts/src/test/java/org/jbpm/test/cts/processengine/ProcessEngineTest.java 2008-09-26 16:01:53 UTC (rev 2402)
@@ -54,28 +54,41 @@
{
// create an engine from an MC config
URL cfgURL = getResourceURL("cts/processengine/test-cfg-beans.xml");
- ProcessEngine engineOne = new MicrocontainerConfiguration(cfgURL).getProcessEngine();
- assertNotNull("ProcessEngine not null", engineOne);
+
+ String engineName = "CTSTestEngine";
+ MicrocontainerConfiguration configuration = new MicrocontainerConfiguration();
+ configuration.deployBeansConfig(cfgURL);
+
+ try
+ {
+ ProcessEngine engineOne = configuration.getProcessEngine(engineName);
+ assertNotNull("ProcessEngine not null", engineOne);
+ assertEquals("ProcessEngine name", engineName, engineOne.getName());
- // the engine is not automatically registered
- ProcessEngine engineTwo = ProcessEngine.getProcessEngine("mock engine");
- assertNull("ProcessEngine null", engineTwo);
+ // the engine is not automatically registered
+ ProcessEngine engineTwo = ProcessEngine.getProcessEngine(engineName);
+ assertNull("ProcessEngine null", engineTwo);
- // register the engine and do the lockup again
- ProcessEngineRegistry.registerProcessEngine(engineOne);
- engineTwo = ProcessEngine.getProcessEngine("mock engine");
- assertNotNull("ProcessEngine not null", engineTwo);
- assertSame("ProcessEngine same", engineOne, engineTwo);
+ // register the engine and do the lockup again
+ ProcessEngineRegistry.registerProcessEngine(engineOne);
+ engineTwo = ProcessEngine.getProcessEngine(engineName);
+ assertNotNull("ProcessEngine not null", engineTwo);
+ assertSame("ProcessEngine same", engineOne, engineTwo);
- // Try to register the engine twice
- try
- {
- ProcessEngineRegistry.registerProcessEngine(engineTwo);
- fail("Expceted IllegalStateException");
+ // Try to register the engine twice
+ try
+ {
+ ProcessEngineRegistry.registerProcessEngine(engineTwo);
+ fail("Expceted IllegalStateException");
+ }
+ catch (IllegalStateException e)
+ {
+ // expected
+ }
}
- catch (IllegalStateException e)
+ finally
{
- // expected
+ configuration.undeployBeansConfig(cfgURL);
}
}
}
Modified: jbpm4/branches/tdiesler/modules/cts/src/test/resources/cts/processengine/test-cfg-beans.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/src/test/resources/cts/processengine/test-cfg-beans.xml 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/cts/src/test/resources/cts/processengine/test-cfg-beans.xml 2008-09-26 16:01:53 UTC (rev 2402)
@@ -1,11 +1,8 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- The KernelLocator -->
- <bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator"/>
-
<!-- The ProcessEngine -->
- <bean name="jBPMProcessEngine" class="org.jbpm.test.cts.processengine.MockProcessEngine">
- <property name="name">mock engine</property>
+ <bean name="CTSTestEngine" class="org.jbpm.test.cts.processengine.MockProcessEngine">
+ <property name="name">CTSTestEngine</property>
</bean>
</deployment>
Modified: jbpm4/branches/tdiesler/modules/cts/src/test/resources/log4j.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/src/test/resources/log4j.xml 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/cts/src/test/resources/log4j.xml 2008-09-26 16:01:53 UTC (rev 2402)
@@ -12,7 +12,7 @@
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ <param name="ConversionPattern" value="%d %-5p [%c:%L] %m%n"/>
</layout>
</appender>
Modified: jbpm4/branches/tdiesler/modules/impl/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/pom.xml 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/impl/pom.xml 2008-09-26 16:01:53 UTC (rev 2402)
@@ -14,23 +14,57 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <name>jBPM Spec - RI</name>
- <groupId>org.jbpm.spec</groupId>
- <artifactId>jbpm-spec-ri</artifactId>
+ <name>JBoss jBPM4 - Impl</name>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-impl</artifactId>
<packaging>jar</packaging>
+
<!-- Parent -->
<parent>
- <groupId>org.jbpm.spec</groupId>
- <artifactId>jbpm-spec</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<!-- Properties -->
<properties>
+ <hibernate.version>3.2.6.ga</hibernate.version>
+ <hibernate.annotations.version>3.3.1.GA</hibernate.annotations.version>
+ <hibernate.validator.version>3.0.0.ga</hibernate.validator.version>
+ <hsqldb.version>1.8.0.7</hsqldb.version>
+ <mysql.connector.version>5.1.6</mysql.connector.version>
</properties>
+ <!-- DependencyManagement -->
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>${hibernate.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>${hibernate.annotations.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>${hibernate.validator.version}</version>
+ </dependency>
+
+ <!-- Database Driver Versions -->
+ <dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>${mysql.connector.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<!-- Dependencies -->
<dependencies>
<dependency>
@@ -39,15 +73,6 @@
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>org.jbpm.spec</groupId>
- <artifactId>jbpm-spec-api</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
- <groupId>org.mvel</groupId>
- <artifactId>mvel</artifactId>
- </dependency>
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
</dependency>
Deleted: jbpm4/branches/tdiesler/modules/impl/src/main/resources/hibernate.cfg.hsqldb.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/src/main/resources/hibernate.cfg.hsqldb.xml 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/impl/src/main/resources/hibernate.cfg.hsqldb.xml 2008-09-26 16:01:53 UTC (rev 2402)
@@ -1,32 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
-
- <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
-
- <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
- <property name="hibernate.connection.url">jdbc:hsqldb:mem:jbpm</property>
- <property name="hibernate.connection.username">sa</property>
- <property name="hibernate.connection.password"></property>
-
- <!-- ################################### -->
- <!-- # common settings # -->
- <!-- ################################### -->
-
- <!-- Automatic schema creation -->
- <property name="hibernate.hbm2ddl.auto">create-drop</property>
-
- <!-- Simple memory-only cache -->
- <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
-
- <!-- logging properties -->
- <property name="hibernate.format_sql">true</property>
- <property name="hibernate.use_sql_comments">true</property>
-
- </session-factory>
-</hibernate-configuration>
Added: jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration (rev 0)
+++ jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.Configuration 2008-09-26 16:01:53 UTC (rev 2402)
@@ -0,0 +1 @@
+org.jbpm.api.client.MicrocontainerConfiguration
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.ProcessEngineProvider
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.ProcessEngineProvider 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/impl/src/main/resources/org.jbpm.api.client.ProcessEngineProvider 2008-09-26 16:01:53 UTC (rev 2402)
@@ -1 +0,0 @@
-org.jbpm.api.client.MicrocontainerEngineProvider
\ No newline at end of file
Deleted: jbpm4/branches/tdiesler/modules/impl/src/test/resources/jbpm-beans.xml
===================================================================
--- jbpm4/branches/tdiesler/modules/impl/src/test/resources/jbpm-beans.xml 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/modules/impl/src/test/resources/jbpm-beans.xml 2008-09-26 16:01:53 UTC (rev 2402)
@@ -1,48 +0,0 @@
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <!-- The KernelLocator -->
- <bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator"/>
-
- <!-- The Builder Factories -->
- <bean name="jBPMProcessBuilderFactory" class="org.jboss.bpm.ri.model.impl.ProcessBuilderFactoryImpl"/>
- <bean name="jBPMMessageBuilderFactory" class="org.jboss.bpm.ri.model.impl.MessageBuilderFactoryImpl"/>
-
- <!-- The ProcessEngine -->
- <bean name="jBPMProcessEngine" class="org.jboss.bpm.ri.client.ProcessEngineImpl">
- <property name="processManager"><inject bean="jBPMProcessManager"/></property>
- <property name="executionManager"><inject bean="jBPMExecutionManager"/></property>
- <property name="signalManager"><inject bean="jBPMSignalManager"/></property>
- <property name="messageManager"><inject bean="jBPMMessageManager"/></property>
- </bean>
-
- <!-- The Managers -->
- <bean name="jBPMExecutionManager" class="org.jboss.bpm.ri.client.ExecutionManagerImpl"/>
- <bean name="jBPMSignalManager" class="org.jboss.bpm.ri.client.SignalManagerImpl"/>
- <bean name="jBPMMessageManager" class="org.jboss.bpm.ri.client.MessageManagerImpl"/>
-
- <!-- The ProcessManager -->
- <bean name="jBPMProcessManager" class="org.jboss.bpm.ri.client.ProcessManagerImpl">
- <property name="dialectRegistry"><inject bean="jBPMDialectRegistry"/></property>
- <property name="persistenceService"><inject bean="jBPMPersistenceService"/></property>
- <property name="dialectHandlers">
- <map keyClass="java.lang.String" valueClass="org.jboss.bpm.client.DialectHandler">
- </map>
- </property>
- </bean>
-
- <!-- The DialectRegistry -->
- <bean name="jBPMDialectRegistry" class="org.jboss.bpm.client.DialectRegistry">
- <property name="registry">
- <map keyClass="java.net.URI" valueClass="java.lang.String">
- <entry><key>urn:bpm.jboss:pdl-0.1</key><value>api10</value></entry>
- <entry><key>urn:jbpm.org:jpdl-3.2</key><value>jpdl32</value></entry>
- <entry><key>http://stp.eclipse.org/bpmn</key><value>stp</value></entry>
- <entry><key>http://www.wfmc.org/2008/XPDL2.1</key><value>xpdl21</value></entry>
- </map>
- </property>
- </bean>
-
- <!-- The PersistenceService -->
- <bean name="jBPMPersistenceService" class="org.jboss.bpm.ri.client.HibernatePersistenceService"/>
-
-</deployment>
Modified: jbpm4/branches/tdiesler/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/pom.xml 2008-09-26 15:25:41 UTC (rev 2401)
+++ jbpm4/branches/tdiesler/pom.xml 2008-09-26 16:01:53 UTC (rev 2402)
@@ -22,7 +22,7 @@
<artifactId>jbpm</artifactId>
<packaging>pom</packaging>
- <version>4.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<!-- Parent -->
<parent>
@@ -34,7 +34,7 @@
<!-- Modules -->
<modules>
<module>modules/api</module>
- <module>modules/ri</module>
+ <module>modules/impl</module>
<module>modules/cts</module>
</modules>
17 years, 6 months
JBoss JBPM SVN: r2401 - in jbpm3/branches/aguizar/modules/core/src/main: resources/org/jbpm and 1 other directories.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2008-09-26 11:25:41 -0400 (Fri, 26 Sep 2008)
New Revision: 2401
Modified:
jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/bytes/ByteArray.hbm.xml
jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
Log:
restored original byte block size (1024)
Modified: jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java 2008-09-26 13:55:42 UTC (rev 2400)
+++ jbpm3/branches/aguizar/modules/core/src/main/java/org/jbpm/bytes/ByteBlockChopper.java 2008-09-26 15:25:41 UTC (rev 2401)
@@ -23,6 +23,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import org.apache.commons.logging.Log;
@@ -44,17 +45,22 @@
public static List chopItUp(byte[] byteArray) {
List bytes = null;
- if ( (byteArray!=null)
- && (byteArray.length>0) ){
- log.debug("chopping " + byteArray.length + " bytes");
- bytes = new ArrayList();
+ if (byteArray != null) {
int blockSize = JbpmConfiguration.Configs.getInt("jbpm.byte.block.size");
- int offset = 0;
- while ( (byteArray.length-offset) > blockSize ) {
- bytes.add(subArray(byteArray, offset, blockSize));
- offset+=blockSize;
+ int byteCount = byteArray.length;
+ if (byteCount > blockSize) {
+ log.debug("chopping " + byteCount + " bytes");
+ bytes = new ArrayList();
+ int offset;
+ for (offset = 0; byteCount - offset > blockSize; offset += blockSize) {
+ bytes.add(subArray(byteArray, offset, blockSize));
+ }
+ bytes.add(subArray(byteArray, offset, byteCount - offset));
}
- bytes.add(subArray(byteArray, offset, byteArray.length-offset));
+ else if (byteCount > 0) {
+ log.debug("no need to chop " + byteCount + " bytes");
+ bytes = Collections.singletonList(byteArray);
+ }
}
return bytes;
}
@@ -66,26 +72,28 @@
return subArray;
}
- public static byte[] glueChopsBackTogether(List bytes) {
+ public static byte[] glueChopsBackTogether(List byteBlocks) {
byte[] byteArray = null;
- if (bytes!=null) {
- int blockCount = bytes.size();
+ if (byteBlocks != null) {
+ int blockCount = byteBlocks.size();
switch (blockCount) {
case 0:
break;
case 1:
- byteArray = (byte[]) bytes.get(0);
+ byteArray = (byte[]) byteBlocks.get(0);
+ log.debug("no need to glue " + byteArray.length + " bytes");
break;
default:
int blockSize = JbpmConfiguration.Configs.getInt("jbpm.byte.block.size");
- byte[] lastBlock = (byte[]) bytes.get(blockCount - 1);
+ byte[] lastBlock = (byte[]) byteBlocks.get(blockCount - 1);
int byteCount = blockSize * (blockCount - 1) + lastBlock.length;
log.debug("gluing " + byteCount + " bytes");
+
byteArray = new byte[byteCount];
int offset = 0;
for (int i = 0, n = blockCount; i < n; i++) {
- byte[] block = (byte[]) bytes.get(i);
+ byte[] block = (byte[]) byteBlocks.get(i);
int length = block.length;
System.arraycopy(block, 0, byteArray, offset, length);
log.debug("glued " + length + " bytes beggining at " + offset);
Modified: jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/bytes/ByteArray.hbm.xml
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/bytes/ByteArray.hbm.xml 2008-09-26 13:55:42 UTC (rev 2400)
+++ jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/bytes/ByteArray.hbm.xml 2008-09-26 15:25:41 UTC (rev 2401)
@@ -13,7 +13,7 @@
cascade="all">
<key column="PROCESSFILE_" foreign-key="FK_BYTEBLOCK_FILE" />
<list-index column="INDEX_" />
- <element type="binary" length="255" column="BYTES_" />
+ <element type="binary" length="1024" column="BYTES_" />
</list>
</class>
</hibernate-mapping>
Modified: jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml
===================================================================
--- jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2008-09-26 13:55:42 UTC (rev 2400)
+++ jbpm3/branches/aguizar/modules/core/src/main/resources/org/jbpm/default.jbpm.cfg.xml 2008-09-26 15:25:41 UTC (rev 2401)
@@ -31,7 +31,7 @@
<string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
<!-- make sure the block size matches the length in ByteArray.hbm.xml -->
- <int name="jbpm.byte.block.size" value="255" singleton="true" />
+ <int name="jbpm.byte.block.size" value="1024" singleton="true" />
<bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
<bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
<string name="jbpm.mail.smtp.host" value="localhost" />
17 years, 6 months
JBoss JBPM SVN: r2400 - jbpm4/branches/tdiesler/modules.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-26 09:55:42 -0400 (Fri, 26 Sep 2008)
New Revision: 2400
Added:
jbpm4/branches/tdiesler/modules/impl/
Removed:
jbpm4/branches/tdiesler/modules/ri/
Log:
wip
Copied: jbpm4/branches/tdiesler/modules/impl (from rev 2399, jbpm4/branches/tdiesler/modules/ri)
17 years, 6 months
JBoss JBPM SVN: r2399 - jbpm4/branches/tdiesler/modules.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-26 09:54:45 -0400 (Fri, 26 Sep 2008)
New Revision: 2399
Added:
jbpm4/branches/tdiesler/modules/ri/
Log:
wip
Copied: jbpm4/branches/tdiesler/modules/ri (from rev 2396, projects/spec/trunk/modules/ri)
17 years, 6 months
JBoss JBPM SVN: r2398 - jbpm4/branches/tdiesler.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-26 09:53:58 -0400 (Fri, 26 Sep 2008)
New Revision: 2398
Removed:
jbpm4/branches/tdiesler/eclipse/
jbpm4/branches/tdiesler/hudson/
Modified:
jbpm4/branches/tdiesler/.project
jbpm4/branches/tdiesler/pom.xml
Log:
wip
Modified: jbpm4/branches/tdiesler/.project
===================================================================
--- jbpm4/branches/tdiesler/.project 2008-09-26 13:53:20 UTC (rev 2397)
+++ jbpm4/branches/tdiesler/.project 2008-09-26 13:53:58 UTC (rev 2398)
@@ -6,12 +6,18 @@
</projects>
<buildSpec>
<buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>
Modified: jbpm4/branches/tdiesler/pom.xml
===================================================================
--- jbpm4/branches/tdiesler/pom.xml 2008-09-26 13:53:20 UTC (rev 2397)
+++ jbpm4/branches/tdiesler/pom.xml 2008-09-26 13:53:58 UTC (rev 2398)
@@ -34,8 +34,7 @@
<!-- Modules -->
<modules>
<module>modules/api</module>
- <module>modules/pvm</module>
- <module>modules/jpdl</module>
+ <module>modules/ri</module>
<module>modules/cts</module>
</modules>
17 years, 6 months
JBoss JBPM SVN: r2397 - in jbpm4/branches/tdiesler/modules: cts and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-26 09:53:20 -0400 (Fri, 26 Sep 2008)
New Revision: 2397
Removed:
jbpm4/branches/tdiesler/modules/jpdl/
jbpm4/branches/tdiesler/modules/pvm/
Modified:
jbpm4/branches/tdiesler/modules/cts/.classpath
Log:
wip
Modified: jbpm4/branches/tdiesler/modules/cts/.classpath
===================================================================
--- jbpm4/branches/tdiesler/modules/cts/.classpath 2008-09-26 08:05:26 UTC (rev 2396)
+++ jbpm4/branches/tdiesler/modules/cts/.classpath 2008-09-26 13:53:20 UTC (rev 2397)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
17 years, 6 months
JBoss JBPM SVN: r2396 - projects.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-26 04:05:26 -0400 (Fri, 26 Sep 2008)
New Revision: 2396
Added:
projects/spec/
Removed:
projects/jbpm-spec/
Log:
Move jbpm-spec to parent
Copied: projects/spec (from rev 2395, projects/jbpm-spec)
17 years, 6 months