[jbpm-commits] JBoss JBPM SVN: r3932 - in jbpm3/trunk/modules: core/src/main/java/org/jbpm/command and 13 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Feb 18 19:36:22 EST 2009
Author: alex.guizar at jboss.com
Date: 2009-02-18 19:36:21 -0500 (Wed, 18 Feb 2009)
New Revision: 3932
Added:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/EventCallback.java
Removed:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/EventCallback.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfigurationTestHelper.java
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractCancelCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractProcessInstanceBaseCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractTokenBaseCommand.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/LockMonitorThread.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java
jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/JbpmConfigurationTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/instantiation/ConfigurableClassloadersTest.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1135/JBPM1135Test.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1452/JBPM1452Test.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1755/JBPM1755Test.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java
jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
Log:
JBPM-2043: address some warnings in the findbugs report
Deleted: jbpm3/trunk/modules/core/src/main/java/org/jbpm/EventCallback.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/EventCallback.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/EventCallback.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -1,187 +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;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.jbpm.graph.def.Event;
-
-public class EventCallback implements Serializable {
-
- public static final int DEFAULT_TIMEOUT = 60 * 1000;
-
- private static final long serialVersionUID = 1L;
- private static final Log log = LogFactory.getLog(EventCallback.class);
-
- private static final Map<String, Semaphore> eventSemaphores = new HashMap<String, Semaphore>();
-
- public void processStart() {
- registerNotification(Event.EVENTTYPE_PROCESS_START);
- }
-
- public void processEnd() {
- registerNotification(Event.EVENTTYPE_PROCESS_END);
- }
-
- public void nodeEnter() {
- registerNotification(Event.EVENTTYPE_NODE_ENTER);
- }
-
- public void nodeLeave() {
- registerNotification(Event.EVENTTYPE_NODE_LEAVE);
- }
-
- public void taskCreate() {
- registerNotification(Event.EVENTTYPE_TASK_CREATE);
- }
-
- public void taskEnd() {
- registerNotification(Event.EVENTTYPE_TASK_END);
- }
-
- public void timerCreate() {
- registerNotification(Event.EVENTTYPE_TIMER_CREATE);
- }
-
- public void timer() {
- registerNotification(Event.EVENTTYPE_TIMER);
- }
-
- public void transition() {
- registerNotification(Event.EVENTTYPE_TRANSITION);
- }
-
- private static void registerNotification(final String event) {
- Synchronization notification = new Synchronization() {
-
- public void beforeCompletion() {
- }
-
- public void afterCompletion(int status) {
- if (status == Status.STATUS_COMMITTED) {
- log.debug("sending '" + event + "' notification");
- Semaphore eventSemaphore = getEventSemaphore(event);
- eventSemaphore.release();
- }
- else {
- log.warn("not sending '" + event + "' notification, transaction is " + statusToString(status));
- }
- }
- };
- JbpmContext.getCurrentJbpmContext()
- .getSession()
- .getTransaction()
- .registerSynchronization(notification);
- }
-
- private static String statusToString(int status) {
- String text;
- switch (status) {
- case Status.STATUS_ACTIVE:
- text = "active";
- break;
- case Status.STATUS_COMMITTED:
- text = "committed";
- break;
- case Status.STATUS_COMMITTING:
- text = "committing";
- break;
- case Status.STATUS_MARKED_ROLLBACK:
- text = "marked for rollback";
- break;
- case Status.STATUS_NO_TRANSACTION:
- text = "absent";
- break;
- case Status.STATUS_PREPARED:
- text = "prepared";
- break;
- case Status.STATUS_PREPARING:
- text = "preparing";
- break;
- case Status.STATUS_ROLLEDBACK:
- text = "rolled back";
- break;
- case Status.STATUS_ROLLING_BACK:
- text = "rolling back";
- break;
- case Status.STATUS_UNKNOWN:
- default:
- text = "in unknown status";
- break;
- }
- return text;
- }
-
- public static void waitForEvent(String event) {
- waitForEvent(event, DEFAULT_TIMEOUT);
- }
-
- public static void waitForEvent(String event, long timeout) {
- log.debug("waiting for " + event);
- Semaphore eventSemaphore = getEventSemaphore(event);
- try {
- if (eventSemaphore.tryAcquire(timeout, TimeUnit.MILLISECONDS)) {
- log.debug("received '" + event + "' notification");
- }
- else {
- log.warn("event '" + event + "' did not occur within " + timeout + " ms");
- }
- }
- catch (InterruptedException e) {
- // reassert interruption
- Thread.currentThread().interrupt();
- }
- }
-
- private static Semaphore getEventSemaphore(String event) {
- synchronized (eventSemaphores) {
- Semaphore semaphore = eventSemaphores.get(event);
- if (semaphore == null) {
- semaphore = new Semaphore(0);
- eventSemaphores.put(event, semaphore);
- }
- return semaphore;
- }
- }
-
- public static void clear() {
- synchronized (eventSemaphores) {
- for (Map.Entry<String, Semaphore> entry : eventSemaphores.entrySet()) {
- int permits = entry.getValue().drainPermits();
- if (permits != 0) {
- log.warn("event '" + entry.getKey() + "' has " + permits + " outstanding notifications");
- }
- }
- eventSemaphores.clear();
- }
- }
-}
\ No newline at end of file
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfiguration.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -24,9 +24,9 @@
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.Serializable;
+import java.lang.ref.SoftReference;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.List;
@@ -254,14 +254,14 @@
private static final long serialVersionUID = 1L;
static ObjectFactory defaultObjectFactory;
- static Map<String, JbpmConfiguration> instances = new HashMap<String, JbpmConfiguration>();
- static ThreadLocal<List<JbpmConfiguration>> jbpmConfigurationsStacks = new ListThreadLocal<JbpmConfiguration>();
+ static final Map<String, SoftReference<JbpmConfiguration>> instances = new HashMap<String, SoftReference<JbpmConfiguration>>();
+ static final ThreadLocal<List<JbpmConfiguration>> jbpmConfigurationStacks = new StackThreadLocal<JbpmConfiguration>();
private ObjectFactory objectFactory;
private JobExecutor jobExecutor;
- private ThreadLocal<List<JbpmContext>> jbpmContextStacks = new ListThreadLocal<JbpmContext>();
+ private final ThreadLocal<List<JbpmContext>> jbpmContextStacks = new StackThreadLocal<JbpmContext>();
- static class ListThreadLocal<E> extends ThreadLocal<List<E>> {
+ static class StackThreadLocal<E> extends ThreadLocal<List<E>> {
@Override
protected List<E> initialValue() {
return new ArrayList<E>();
@@ -280,38 +280,34 @@
if (resource == null) {
resource = "jbpm.cfg.xml";
}
- JbpmConfiguration instance = null;
+
+ JbpmConfiguration instance;
synchronized (instances) {
- instance = instances.get(resource);
- if (instance == null) {
+ // look for configuration in cache
+ SoftReference<JbpmConfiguration> instanceRef = instances.get(resource);
+ if (instanceRef == null || (instance = instanceRef.get()) == null) {
+ // configuration does not exist or was evicted, construct it
if (defaultObjectFactory != null) {
- log.debug("creating jbpm configuration from given default object factory '"
- + defaultObjectFactory
- + "'");
+ log.debug("creating configuration from default object factory: " + defaultObjectFactory);
instance = new JbpmConfiguration(defaultObjectFactory);
}
else {
- try {
- log.info("using jbpm configuration resource '" + resource + "'");
- InputStream jbpmCfgXmlStream = ClassLoaderUtil.getJbpmConfigurationStream(resource);
- /*
- * if a custom resource is specified, but not found in the classpath, log a warning
- * (otherwise, users who want to load custom stuff will be confused if the resource is
- * not found and not loaded, without any notice)
- */
- if (jbpmCfgXmlStream == null && !"jbpm.cfg.xml".equals(resource)) {
- log.warn("jbpm configuration resource '" + resource + "' is not available");
- }
- ObjectFactory objectFactory = parseObjectFactory(jbpmCfgXmlStream);
- instance = createJbpmConfiguration(objectFactory);
+ log.info("using configuration resource: " + resource);
+ InputStream jbpmCfgXmlStream = ClassLoaderUtil.getJbpmConfigurationStream(resource);
+ /*
+ * if a custom resource is specified, but not found in the classpath, log a warning;
+ * otherwise, users who want to load custom stuff will not receive any feedback when their
+ * resource cannot be found
+ */
+ if (jbpmCfgXmlStream == null && !"jbpm.cfg.xml".equals(resource)) {
+ log.warn("configuration resource '" + resource + "' could not be found");
}
- catch (RuntimeException e) {
- throw new JbpmException("couldn't parse jbpm configuration from resource '"
- + resource
- + "'", e);
- }
+ ObjectFactory objectFactory = parseObjectFactory(jbpmCfgXmlStream);
+ instance = createJbpmConfiguration(objectFactory);
}
- instances.put(resource, instance);
+ // put configuration in cache
+ instanceRef = new SoftReference<JbpmConfiguration>(instance);
+ instances.put(resource, instanceRef);
}
}
return instance;
@@ -322,7 +318,7 @@
if (resource == null) {
resource = "jbpm.cfg.xml";
}
- if ((instances != null) && (instances.containsKey(resource))) {
+ if (instances != null && instances.containsKey(resource)) {
hasInstance = true;
}
return hasInstance;
@@ -332,7 +328,8 @@
log.debug("loading defaults in jbpm configuration");
ObjectFactoryParser objectFactoryParser = new ObjectFactoryParser();
ObjectFactoryImpl objectFactoryImpl = new ObjectFactoryImpl();
- objectFactoryParser.parseElementsFromResource("org/jbpm/default.jbpm.cfg.xml", objectFactoryImpl);
+ objectFactoryParser.parseElementsFromResource("org/jbpm/default.jbpm.cfg.xml",
+ objectFactoryImpl);
if (inputStream != null) {
log.debug("loading specific configuration...");
@@ -370,22 +367,21 @@
}
private static boolean getHideStaleObjectExceptions(ObjectFactory objectFactory) {
- if (!objectFactory.hasObject("jbpm.hide.stale.object.exceptions")) {
- return true;
- }
+ if (!objectFactory.hasObject("jbpm.hide.stale.object.exceptions")) return true;
+
Object object = objectFactory.createObject("jbpm.hide.stale.object.exceptions");
return object instanceof Boolean ? ((Boolean) object).booleanValue() : true;
}
public static JbpmConfiguration parseInputStream(InputStream inputStream) {
+ log.debug("creating jbpm configuration from input stream");
ObjectFactory objectFactory = parseObjectFactory(inputStream);
- log.debug("creating jbpm configuration from input stream");
return createJbpmConfiguration(objectFactory);
}
public static JbpmConfiguration parseResource(String resource) {
+ log.debug("creating jbpm configuration from resource: " + resource);
InputStream inputStream = null;
- log.debug("creating jbpm configuration from resource '" + resource + "'");
if (resource != null) {
inputStream = ClassLoaderUtil.getJbpmConfigurationStream(resource);
}
@@ -488,8 +484,7 @@
}
public void cleanSchema(String jbpmContextName) {
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) getServiceFactory(Services.SERVICENAME_PERSISTENCE, jbpmContextName);
- persistenceServiceFactory.cleanSchema();
+ getPersistenceServiceFactory(jbpmContextName).cleanSchema();
}
public void createSchema() {
@@ -497,8 +492,7 @@
}
public void createSchema(String jbpmContextName) {
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) getServiceFactory(Services.SERVICENAME_PERSISTENCE, jbpmContextName);
- persistenceServiceFactory.createSchema();
+ getPersistenceServiceFactory(jbpmContextName).createSchema();
}
public void dropSchema() {
@@ -506,10 +500,14 @@
}
public void dropSchema(String jbpmContextName) {
- DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) getServiceFactory(Services.SERVICENAME_PERSISTENCE, jbpmContextName);
- persistenceServiceFactory.dropSchema();
+ getPersistenceServiceFactory(jbpmContextName).dropSchema();
}
+ private DbPersistenceServiceFactory getPersistenceServiceFactory(String jbpmContextName) {
+ return (DbPersistenceServiceFactory) getServiceFactory(Services.SERVICENAME_PERSISTENCE,
+ jbpmContextName);
+ }
+
public void close() {
close(JbpmContext.DEFAULT_JBPM_CONTEXT_NAME);
}
@@ -518,6 +516,7 @@
// stop job executor
if (jobExecutor != null) {
jobExecutor.stop();
+ jobExecutor = null;
}
JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
@@ -538,18 +537,21 @@
// release context stack
jbpmContextStacks.remove();
- // remove from configurations map
+ // remove from configuration cache
synchronized (instances) {
- Iterator<JbpmConfiguration> iter = instances.values().iterator();
- while (iter.hasNext()) {
- if (this == iter.next()) {
- iter.remove();
- break;
+ for (SoftReference<JbpmConfiguration> instanceRef : instances.values()) {
+ if (this == instanceRef.get()) {
+ instanceRef.clear();
}
}
}
}
+ @Override
+ protected void finalize() throws Throwable {
+ close();
+ }
+
static JbpmConfiguration getCurrentJbpmConfiguration() {
JbpmConfiguration currentJbpmConfiguration = null;
List<JbpmConfiguration> stack = getJbpmConfigurationStack();
@@ -560,7 +562,7 @@
}
static List<JbpmConfiguration> getJbpmConfigurationStack() {
- return jbpmConfigurationsStacks.get();
+ return jbpmConfigurationStacks.get();
}
synchronized void pushJbpmConfiguration() {
@@ -591,14 +593,17 @@
void popJbpmContext(JbpmContext jbpmContext) {
List<JbpmContext> stack = getJbpmContextStack();
if (stack.isEmpty()) {
- throw new JbpmException(
- "closed JbpmContext more than once... check your try-finally's around JbpmContexts blocks");
+ throw new JbpmException("closed JbpmContext more than once... "
+ + "check your try-finally clauses around JbpmContext blocks");
}
- JbpmContext popped = stack.remove(stack.size() - 1);
- if (jbpmContext != popped) {
- stack.remove(jbpmContext); // prevent context from remaining in the stack
- throw new JbpmException(
- "closed JbpmContext in some order that differs from creation... check your try-finally's around JbpmContexts blocks");
+ JbpmContext topContext = stack.remove(stack.size() - 1);
+ if (jbpmContext != topContext) {
+ // put the other context back
+ stack.add(topContext);
+ // prevent our context from remaining in the stack
+ stack.remove(jbpmContext);
+ throw new JbpmException("closed JbpmContext in some order that differs from creation... "
+ + "check your try-finally clauses around JbpmContext blocks");
}
}
@@ -618,12 +623,13 @@
public synchronized JobExecutor getJobExecutor() {
if (jobExecutor == null) {
- try {
- jobExecutor = (JobExecutor) this.objectFactory.createObject("jbpm.job.executor");
+ Object object = objectFactory.createObject("jbpm.job.executor");
+ if (object instanceof JobExecutor) {
+ jobExecutor = (JobExecutor) object;
}
- catch (ClassCastException e) {
- throw new JbpmException("jbpm configuration object under key 'jbpm.job.executor' is not a "
- + JobExecutor.class.getName(), e);
+ else if (object != null) {
+ throw new JbpmException("configuration object named 'jbpm.job.executor' is not a "
+ + JobExecutor.class.getSimpleName());
}
}
return jobExecutor;
Deleted: jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfigurationTestHelper.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfigurationTestHelper.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/JbpmConfigurationTestHelper.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -1,31 +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;
-
-public class JbpmConfigurationTestHelper
-{
- public static void reset()
- {
- JbpmConfiguration.defaultObjectFactory = null;
- JbpmConfiguration.instances.clear();
- }
-}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractCancelCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractCancelCommand.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractCancelCommand.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -21,7 +21,7 @@
* in order to indicate that this process has been 'canceled' and not just ended.
* Value of the variable is the timestamp of cancellation.
*/
- public static String CANCELLATION_INDICATOR_VARIABLE_NAME = "canceled";
+ public static final String CANCELLATION_INDICATOR_VARIABLE_NAME = "canceled";
protected transient JbpmContext jbpmContext = null;
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractProcessInstanceBaseCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractProcessInstanceBaseCommand.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractProcessInstanceBaseCommand.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -12,17 +12,13 @@
import org.jbpm.graph.exe.ProcessInstance;
/**
- * Abstract base class for all commands working on {@link org.jbpm.graph.exe.ProcessInstance}s.
+ * Abstract base class for all commands working on {@link org.jbpm.graph.exe.ProcessInstance}s. The
+ * {@link ProcessInstance} can either be specified by id or multiple ids. The alternative is to
+ * specify a {@link ProcessDefinition} name and version. In this case <b>all</b> found
+ * {@link ProcessInstance}s are processed. If no version is specified, <b>all</b> versions are taken
+ * into account. if onlyRunning is set to false (default is true) already ended
+ * {@link ProcessInstance}s are processed too.
*
- * The {@link ProcessInstance} can either be specified by id or multiple ids.
- *
- * The alternative is to specify a {@link ProcessDefinition} name and version.
- * In this case <b>all</b> found {@link ProcessInstance}s are processed.
- * If no version is specified, <b>all</b> versions are taken into account.
- *
- * if onlyRunning is set to false (default is true) already ended {@link ProcessInstance}s
- * are processed too.
- *
* @author bernd.ruecker at camunda.com
*/
public abstract class AbstractProcessInstanceBaseCommand extends AbstractBaseCommand
@@ -36,15 +32,16 @@
private boolean onlyRunning = true;
private boolean operateOnSingleObject;
-
+
private transient JbpmContext jbpmContext;
public AbstractProcessInstanceBaseCommand()
{
super();
}
-
- protected JbpmContext getJbpmContext() {
+
+ protected JbpmContext getJbpmContext()
+ {
return jbpmContext;
}
@@ -52,67 +49,71 @@
{
ArrayList result = new ArrayList();
this.jbpmContext = jbpmContext;
- try {
+ try
+ {
log.debug("executing " + this);
-
+
// batch tokens
if (processInstanceIds != null && processInstanceIds.length > 0)
{
for (int i = 0; i < processInstanceIds.length; i++)
{
ProcessInstance pi = jbpmContext.loadProcessInstanceForUpdate(processInstanceIds[i]);
- result.add(
- execute(pi));
+ result.add(execute(pi));
}
}
-
+
// search for ProcessInstances according to parameters
if (processName != null)
{
operateOnSingleObject = false;
-
+
GetProcessInstancesCommand cmd = new GetProcessInstancesCommand();
cmd.setProcessDefinitionName(processName);
cmd.setOnlyRunning(onlyRunning);
- if (processVersion>0)
- cmd.setVersion(String.valueOf(processVersion));
-
- // Query query = null;
- // if (processVersion>0) {
- // query = jbpmContext.getSession().getNamedQuery("GraphSession.findProcessDefinitionByNameAndVersion");
- // query.setInteger("version", processVersion);
- // }
- // else {
- // query = jbpmContext.getSession().getNamedQuery("GraphSession.findTokensForProcessInNode");
- // }
- // query.setString("name", processName);
- List processInstanceList = (List)cmd.execute(jbpmContext);
-
+ if (processVersion > 0) cmd.setVersion(String.valueOf(processVersion));
+
+ // Query query = null;
+ // if (processVersion>0) {
+ // query =
+ // jbpmContext.getSession().getNamedQuery("GraphSession.findProcessDefinitionByNameAndVersion");
+ // query.setInteger("version", processVersion);
+ // }
+ // else {
+ // query =
+ // jbpmContext.getSession().getNamedQuery("GraphSession.findTokensForProcessInNode");
+ // }
+ // query.setString("name", processName);
+ List processInstanceList = (List) cmd.execute(jbpmContext);
+
Iterator iter = processInstanceList.iterator();
while (iter.hasNext())
{
- ProcessInstance pi = (ProcessInstance)iter.next();
+ ProcessInstance pi = (ProcessInstance) iter.next();
execute(pi);
}
}
-
- if (operateOnSingleObject) {
- if (result.size()<1)
+
+ if (operateOnSingleObject)
+ {
+ if (result.size() < 1)
return null;
- else
+ else
return result.get(0);
}
- else {
- return result;
+ else
+ {
+ return result;
}
}
- finally {
+ finally
+ {
this.jbpmContext = null;
}
}
public abstract ProcessInstance execute(ProcessInstance processInstance);
-
+
public void setProcessInstanceIds(long[] processInstanceIds)
{
this.operateOnSingleObject = false;
@@ -123,29 +124,37 @@
{
this.operateOnSingleObject = true;
this.processInstanceIds = new long[1];
- this.processInstanceIds[0] = processInstanceId;
+ this.processInstanceIds[0] = processInstanceId;
}
-
+
/**
* Overwrite toString to keep semantic of getAdditionalToStringInformation
*/
- public String toString() {
- if (processName!=null) {
- return this.getClass().getName()
- + " [tokenIds=" + Arrays.toString(processInstanceIds)
- + ";processName=" + processName
- + ";processVersion=" + (processVersion>0 ? processVersion : "NA")
- + getAdditionalToStringInformation()
- + "]";
+ public String toString()
+ {
+ if (processName != null)
+ {
+ return this.getClass().getName()
+ + " [tokenIds="
+ + Arrays.toString(processInstanceIds)
+ + ";processName="
+ + processName
+ + ";processVersion="
+ + (processVersion > 0 ? processVersion : "NA")
+ + getAdditionalToStringInformation()
+ + "]";
}
- else {
- return this.getClass().getName()
- + " [tokenIds=" + Arrays.toString(processInstanceIds)
- + ";operateOnSingleObject=" + operateOnSingleObject
- + getAdditionalToStringInformation()
- + "]";
+ else
+ {
+ return this.getClass().getName()
+ + " [tokenIds="
+ + Arrays.toString(processInstanceIds)
+ + ";operateOnSingleObject="
+ + operateOnSingleObject
+ + getAdditionalToStringInformation()
+ + "]";
}
- }
+ }
public String getProcessName()
{
@@ -156,7 +165,7 @@
{
this.processName = processName;
}
-
+
public int getProcessVersion()
{
return processVersion;
@@ -173,14 +182,18 @@
}
/**
- * return the process instance id in case only one
- * process instance id is set. Otherwise an {@link IllegalStateException}
- * is thrown
+ * return the process instance id in case only one process instance id is set. Otherwise an
+ * {@link IllegalStateException} is thrown
*/
public long getProcessInstanceId()
{
- if (processInstanceIds==null || processInstanceIds.length!=1)
- throw new IllegalStateException("getProcessInstanceId can only be called if only one process instance id is set on command " + this + " but was " + processInstanceIds);
+ if (processInstanceIds == null || processInstanceIds.length != 1)
+ {
+ throw new IllegalStateException("exactly one process instance id must be set on "
+ + this
+ + " to get processInstanceId property; found "
+ + Arrays.toString(processInstanceIds));
+ }
return processInstanceIds[0];
}
@@ -198,25 +211,25 @@
public AbstractProcessInstanceBaseCommand processInstanceIds(long[] processInstanceIds)
{
- setProcessInstanceIds( processInstanceIds );
+ setProcessInstanceIds(processInstanceIds);
return this;
}
public AbstractProcessInstanceBaseCommand processInstanceId(long processInstanceId)
{
- setProcessInstanceId(processInstanceId);
+ setProcessInstanceId(processInstanceId);
return this;
}
public AbstractProcessInstanceBaseCommand processName(String processName)
{
- setProcessName( processName );
+ setProcessName(processName);
return this;
}
-
+
public AbstractProcessInstanceBaseCommand processVersion(int processVersion)
{
- setProcessVersion( processVersion );
+ setProcessVersion(processVersion);
return this;
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractTokenBaseCommand.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractTokenBaseCommand.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/command/AbstractTokenBaseCommand.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -12,15 +12,11 @@
import org.jbpm.graph.exe.Token;
/**
- * Abstract base class for commands working on Tokens.
+ * Abstract base class for commands working on Tokens. The {@link Token} can either be specified by
+ * id or multiple ids. The alternative is to specify a {@link ProcessDefinition} name, a required
+ * node name and version. In this case <b>all</b> found {@link Token}s are processed. If no version
+ * is specified, <b>all</b> versions are taken into account.
*
- * The {@link Token} can either be specified by id or multiple ids.
- *
- * The alternative is to specify a {@link ProcessDefinition} name, a
- * required node name and version.
- * In this case <b>all</b> found {@link Token}s are processed.
- * If no version is specified, <b>all</b> versions are taken into account.
- *
* @author bernd.ruecker at camunda.com
*/
public abstract class AbstractTokenBaseCommand implements Command
@@ -31,74 +27,82 @@
private String processName = null;
private String stateName = null;
private int processVersion = 0;
-
+
private boolean operateOnSingleObject;
private transient JbpmContext jbpmContext;
+ private static final long serialVersionUID = 1L;
+
public AbstractTokenBaseCommand()
{
super();
}
-
- protected JbpmContext getJbpmContext() {
+
+ protected JbpmContext getJbpmContext()
+ {
return jbpmContext;
}
public Object execute(JbpmContext jbpmContext) throws Exception
{
this.jbpmContext = jbpmContext;
- try {
+ try
+ {
ArrayList result = new ArrayList();
log.debug("executing " + this);
-
+
// batch tokens
if (tokenIds != null && tokenIds.length > 0)
{
for (int i = 0; i < tokenIds.length; i++)
{
Token token = jbpmContext.loadTokenForUpdate(tokenIds[i]);
- result.add(
- execute(token));
+ result.add(execute(token));
}
}
-
+
// search for tokens in process/state
if (processName != null && stateName != null)
{
this.operateOnSingleObject = false;
-
+
Query query = null;
- if (processVersion>0) {
- query = jbpmContext.getSession().getNamedQuery("GraphSession.findTokensForProcessVersionInNode");
+ if (processVersion > 0)
+ {
+ query = jbpmContext.getSession().getNamedQuery(
+ "GraphSession.findTokensForProcessVersionInNode");
query.setInteger("processDefinitionVersion", processVersion);
}
- else {
- query = jbpmContext.getSession().getNamedQuery("GraphSession.findTokensForProcessInNode");
+ else
+ {
+ query = jbpmContext.getSession().getNamedQuery("GraphSession.findTokensForProcessInNode");
}
query.setString("processDefinitionName", processName);
query.setString("nodeName", stateName);
-
+
Iterator iter = query.list().iterator();
while (iter.hasNext())
{
- Token token = (Token)iter.next();
- result.add(
- execute(token));
+ Token token = (Token) iter.next();
+ result.add(execute(token));
}
}
-
- if (operateOnSingleObject) {
- if (result.size()<1)
+
+ if (operateOnSingleObject)
+ {
+ if (result.size() < 1)
return null;
- else
+ else
return result.get(0);
}
- else {
- return result;
+ else
+ {
+ return result;
}
}
- finally {
+ finally
+ {
this.jbpmContext = null;
}
}
@@ -117,8 +121,9 @@
this.tokenIds = new long[1];
this.tokenIds[0] = tokenId;
}
-
- public String getAdditionalToStringInformation() {
+
+ public String getAdditionalToStringInformation()
+ {
return "";
}
@@ -156,38 +161,51 @@
{
return tokenIds;
}
-
+
/**
- * return the process instance id in case only one
- * process instance id is set. Otherwise an {@link IllegalStateException}
- * is thrown
+ * return the process instance id in case only one process instance id is set. Otherwise an
+ * {@link IllegalStateException} is thrown
*/
public long getTokenId()
{
- if (tokenIds==null || tokenIds.length!=1)
- throw new IllegalStateException("getTokenIds can only be called if only one token id is set on command " + this + " but was " + tokenIds);
+ if (tokenIds == null || tokenIds.length != 1)
+ {
+ throw new IllegalStateException("exactly one token id must be set on "
+ + this
+ + " to get tokenId property; found "
+ + Arrays.toString(tokenIds));
+ }
return tokenIds[0];
- }
-
- public String toString() {
- if (processName!=null && stateName!=null) {
- return this.getClass().getName()
- + " [tokenIds=" + Arrays.toString(tokenIds)
- + ";processName=" + processName
- + ";processVersion=" + (processVersion>0 ? processVersion : "NA")
- + ";stateName=" + stateName
- + getAdditionalToStringInformation()
- + "]";
+ }
+
+ public String toString()
+ {
+ if (processName != null && stateName != null)
+ {
+ return this.getClass().getName()
+ + " [tokenIds="
+ + Arrays.toString(tokenIds)
+ + ";processName="
+ + processName
+ + ";processVersion="
+ + (processVersion > 0 ? processVersion : "NA")
+ + ";stateName="
+ + stateName
+ + getAdditionalToStringInformation()
+ + "]";
}
- else {
- return this.getClass().getName()
- + " [tokenIds=" + Arrays.toString(tokenIds)
- + ";operateOnSingleObject=" + operateOnSingleObject
- + getAdditionalToStringInformation()
- + "]";
+ else
+ {
+ return this.getClass().getName()
+ + " [tokenIds="
+ + Arrays.toString(tokenIds)
+ + ";operateOnSingleObject="
+ + operateOnSingleObject
+ + getAdditionalToStringInformation()
+ + "]";
}
}
-
+
// methods for fluent programming
public AbstractTokenBaseCommand tokenIds(long[] tokenIds)
@@ -201,7 +219,7 @@
setTokenId(tokenId);
return this;
}
-
+
public AbstractTokenBaseCommand processName(String processName)
{
setProcessName(processName);
@@ -218,5 +236,5 @@
{
setStateName(stateName);
return this;
- }
+ }
}
\ No newline at end of file
Copied: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/EventCallback.java (from rev 3859, jbpm3/trunk/modules/core/src/main/java/org/jbpm/EventCallback.java)
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/EventCallback.java (rev 0)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/def/EventCallback.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -0,0 +1,187 @@
+/*
+ * 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.graph.def;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.jbpm.JbpmContext;
+
+public class EventCallback implements Serializable {
+
+ public static final int DEFAULT_TIMEOUT = 60 * 1000;
+
+ private static final long serialVersionUID = 1L;
+ private static final Log log = LogFactory.getLog(EventCallback.class);
+
+ private static final Map<String, Semaphore> eventSemaphores = new HashMap<String, Semaphore>();
+
+ public void processStart() {
+ registerNotification(Event.EVENTTYPE_PROCESS_START);
+ }
+
+ public void processEnd() {
+ registerNotification(Event.EVENTTYPE_PROCESS_END);
+ }
+
+ public void nodeEnter() {
+ registerNotification(Event.EVENTTYPE_NODE_ENTER);
+ }
+
+ public void nodeLeave() {
+ registerNotification(Event.EVENTTYPE_NODE_LEAVE);
+ }
+
+ public void taskCreate() {
+ registerNotification(Event.EVENTTYPE_TASK_CREATE);
+ }
+
+ public void taskEnd() {
+ registerNotification(Event.EVENTTYPE_TASK_END);
+ }
+
+ public void timerCreate() {
+ registerNotification(Event.EVENTTYPE_TIMER_CREATE);
+ }
+
+ public void timer() {
+ registerNotification(Event.EVENTTYPE_TIMER);
+ }
+
+ public void transition() {
+ registerNotification(Event.EVENTTYPE_TRANSITION);
+ }
+
+ private static void registerNotification(final String event) {
+ Synchronization notification = new Synchronization() {
+
+ public void beforeCompletion() {
+ }
+
+ public void afterCompletion(int status) {
+ if (status == Status.STATUS_COMMITTED) {
+ log.debug("sending '" + event + "' notification");
+ Semaphore eventSemaphore = getEventSemaphore(event);
+ eventSemaphore.release();
+ }
+ else {
+ log.warn("not sending '" + event + "' notification, transaction is " + statusToString(status));
+ }
+ }
+ };
+ JbpmContext.getCurrentJbpmContext()
+ .getSession()
+ .getTransaction()
+ .registerSynchronization(notification);
+ }
+
+ private static String statusToString(int status) {
+ String text;
+ switch (status) {
+ case Status.STATUS_ACTIVE:
+ text = "active";
+ break;
+ case Status.STATUS_COMMITTED:
+ text = "committed";
+ break;
+ case Status.STATUS_COMMITTING:
+ text = "committing";
+ break;
+ case Status.STATUS_MARKED_ROLLBACK:
+ text = "marked for rollback";
+ break;
+ case Status.STATUS_NO_TRANSACTION:
+ text = "absent";
+ break;
+ case Status.STATUS_PREPARED:
+ text = "prepared";
+ break;
+ case Status.STATUS_PREPARING:
+ text = "preparing";
+ break;
+ case Status.STATUS_ROLLEDBACK:
+ text = "rolled back";
+ break;
+ case Status.STATUS_ROLLING_BACK:
+ text = "rolling back";
+ break;
+ case Status.STATUS_UNKNOWN:
+ default:
+ text = "in unknown status";
+ break;
+ }
+ return text;
+ }
+
+ public static void waitForEvent(String event) {
+ waitForEvent(event, DEFAULT_TIMEOUT);
+ }
+
+ public static void waitForEvent(String event, long timeout) {
+ log.debug("waiting for " + event);
+ Semaphore eventSemaphore = getEventSemaphore(event);
+ try {
+ if (eventSemaphore.tryAcquire(timeout, TimeUnit.MILLISECONDS)) {
+ log.debug("received '" + event + "' notification");
+ }
+ else {
+ log.warn("event '" + event + "' did not occur within " + timeout + " ms");
+ }
+ }
+ catch (InterruptedException e) {
+ // reassert interruption
+ Thread.currentThread().interrupt();
+ }
+ }
+
+ private static Semaphore getEventSemaphore(String event) {
+ synchronized (eventSemaphores) {
+ Semaphore semaphore = eventSemaphores.get(event);
+ if (semaphore == null) {
+ semaphore = new Semaphore(0);
+ eventSemaphores.put(event, semaphore);
+ }
+ return semaphore;
+ }
+ }
+
+ public static void clear() {
+ synchronized (eventSemaphores) {
+ for (Map.Entry<String, Semaphore> entry : eventSemaphores.entrySet()) {
+ int permits = entry.getValue().drainPermits();
+ if (permits != 0) {
+ log.warn("event '" + entry.getKey() + "' has " + permits + " outstanding notifications");
+ }
+ }
+ eventSemaphores.clear();
+ }
+ }
+}
\ No newline at end of file
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutor.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -39,7 +39,7 @@
protected boolean isStarted = false;
- protected static String hostName;
+ private static String hostName;
public synchronized void start() {
if (!isStarted) {
@@ -47,8 +47,7 @@
for (int i = 0; i < nbrOfThreads; i++) {
startThread();
}
- lockMonitorThread = new LockMonitorThread(jbpmConfiguration, lockMonitorInterval,
- maxLockTime, lockBufferTime);
+ lockMonitorThread = new LockMonitorThread(this);
isStarted = true;
}
else {
@@ -114,7 +113,7 @@
}
private String getThreadName(int index) {
- return name + ":" + getHostAddress() + ":" + index;
+ return name + '@' + getHostAddress() + ':' + index;
}
private static String getHostAddress() {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/JobExecutorThread.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -39,6 +39,8 @@
this.maxLockTime = jobExecutor.getMaxLockTime();
}
+ /** @deprecated As of jBPM 3.2.6, replaced by {@link #JobExecutorThread(String, JobExecutor)} */
+ @Deprecated
public JobExecutorThread(String name, JobExecutor jobExecutor,
JbpmConfiguration jbpmConfiguration, int idleInterval, int maxIdleInterval, long maxLockTime,
int maxHistory) {
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/LockMonitorThread.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/LockMonitorThread.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/job/executor/LockMonitorThread.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -22,6 +22,15 @@
volatile boolean isActive = true;
+ public LockMonitorThread(JobExecutor jobExecutor) {
+ jbpmConfiguration = jobExecutor.getJbpmConfiguration();
+ lockMonitorInterval = jobExecutor.getLockMonitorInterval();
+ maxLockTime = jobExecutor.getMaxLockTime();
+ lockBufferTime = jobExecutor.getLockBufferTime();
+ }
+
+ /** @deprecated As of jBPM 3.2.6, replaced by {@link #LockMonitorThread(JobExecutor)} */
+ @Deprecated
public LockMonitorThread(JbpmConfiguration jbpmConfiguration, int lockMonitorInterval,
int maxLockTime, int lockBufferTime) {
this.jbpmConfiguration = jbpmConfiguration;
@@ -35,7 +44,7 @@
while (isActive) {
try {
unlockOverdueJobs();
- if ((isActive) && (lockMonitorInterval > 0)) {
+ if (isActive && lockMonitorInterval > 0) {
sleep(lockMonitorInterval);
}
}
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/persistence/db/DbPersistenceServiceFactory.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -156,11 +156,6 @@
}
}
- public void finalize() throws Throwable
- {
- close();
- }
-
public String getDataSourceJndiName()
{
return dataSourceJndiName;
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/util/XmlUtil.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -73,7 +73,7 @@
inputStream = ClassLoaderUtil.getStream(resource);
if (inputStream == null)
- throw new IllegalArgumentException("Cannot load resource: " + resource);
+ throw new IllegalArgumentException("resource not found: " + resource);
return parseXmlInputStream(inputStream);
}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/JbpmConfigurationTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/JbpmConfigurationTest.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/JbpmConfigurationTest.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -36,7 +36,7 @@
super.setUp();
JbpmConfiguration.instances.clear();
JbpmConfiguration.defaultObjectFactory = null;
- JbpmConfiguration.jbpmConfigurationsStacks.remove();
+ JbpmConfiguration.jbpmConfigurationStacks.remove();
}
public void testSingleton() {
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/SerializabilityTest.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -33,23 +33,28 @@
String testRootDir = FileDefinitionFileSystemConfigTest.class.getProtectionDomain().getCodeSource().getLocation().getFile().toString();
static String[] excusedClasses = {
- "org.jbpm.ant",
+ "org.jbpm.ant.",
+ "org.jbpm.command.service.CommandServiceImpl",
"org.jbpm.context.exe.JbpmType",
"org.jbpm.db.hibernate.ConverterEnumType",
"org.jbpm.db.hibernate.Converters",
"org.jbpm.db.hibernate.JbpmNamingStrategy",
- "org.jbpm.db.jmx.JbpmService",
"org.jbpm.db.AbstractDbTestCase",
"org.jbpm.db.ContextSession",
"org.jbpm.db.FileSession",
"org.jbpm.db.GraphSession",
"org.jbpm.db.JbpmSession",
+ "org.jbpm.db.JbpmSchema",
"org.jbpm.db.JobSession",
"org.jbpm.db.LoggingSession",
"org.jbpm.db.SchedulerSession",
"org.jbpm.db.TaskMgmtSession",
"org.jbpm.db.compatibility.JbpmSchemaUpdate",
+ "org.jbpm.graph.action.ActionTypes",
"org.jbpm.graph.exe.ExecutionContext",
+ "org.jbpm.graph.node.InterleaveStart$DefaultInterleaver",
+ "org.jbpm.graph.node.NodeTypes",
+ "org.jbpm.graph.node.ProcessFactory",
"org.jbpm.instantiation.BeanInstantiator",
"org.jbpm.instantiation.ConfigurationPropertyInstantiator",
"org.jbpm.instantiation.ConstructorInstantiator",
@@ -57,31 +62,17 @@
"org.jbpm.instantiation.FieldInstantiator",
"org.jbpm.instantiation.ProcessClassLoader",
"org.jbpm.instantiation.XmlInstantiator",
- "org.jbpm.JbpmConfiguration",
- "org.jbpm.jmx.JbpmService",
"org.jbpm.job.executor.JobExecutorThread",
"org.jbpm.job.executor.LockMonitorThread",
"org.jbpm.jpdl.convert.Converter",
"org.jbpm.jpdl.convert.Converter$1",
- "org.jbpm.graph.action.ActionTypes",
- "org.jbpm.graph.node.Fork$ForkedToken",
- "org.jbpm.graph.node.InterleaveStart$DefaultInterleaver",
- "org.jbpm.graph.node.NodeTypes",
- "org.jbpm.graph.node.ProcessFactory",
+ "org.jbpm.jpdl.el.",
"org.jbpm.jpdl.par.FileArchiveParser",
"org.jbpm.jpdl.par.JpdlArchiveParser",
"org.jbpm.jpdl.par.ProcessArchive",
- "org.jbpm.jpdl.par.ProcessArchiveDeployer",
- "org.jbpm.jpdl.par.ProcessArchiveDeployerTask",
"org.jbpm.jpdl.xml.JpdlXmlReader",
"org.jbpm.jpdl.xml.JpdlXmlWriter",
- "org.jbpm.jpdl.el",
- "org.jbpm.scheduler.impl.Scheduler",
- "org.jbpm.scheduler.impl.Scheduler$HistoryListener",
- "org.jbpm.scheduler.impl.SchedulerMain$1",
- "org.jbpm.scheduler.impl.SchedulerMain$LogListener",
- "org.jbpm.scheduler.impl.SchedulerMain",
- "org.jbpm.scheduler.impl.SchedulerThread",
+ "org.jbpm.jsf.",
"org.jbpm.security.authenticator.JBossAuthenticator",
"org.jbpm.security.authenticator.JbpmDefaultAuthenticator",
"org.jbpm.security.authenticator.SubjectAuthenticator",
@@ -90,22 +81,11 @@
"org.jbpm.security.authorizer.JbpmIdentityAuthorizer",
"org.jbpm.security.authorizer.RolesAuthorizer",
"org.jbpm.security.filter.JbpmAuthenticationFilter",
- "org.jbpm.command.service.CommandServiceImpl",
- "org.jbpm.msg.jms.JmsCommandFactory",
- "org.jbpm.msg.jms.JmsMessageConstants",
- "org.jbpm.msg.jms.JmsMessageUtils",
- "org.jbpm.bpel.ant.DBSchemaTask",
- "org.jbpm.bpel.ant.ServiceGeneratorTask",
- "org.jbpm.bpel.ant.DeployProcessTask",
- "org.jbpm.bpel.",
"org.jbpm.sim.",
- "org.jbpm.jsf.",
"org.jbpm.util.Clock",
"org.jbpm.util.CustomLoaderObjectInputStream",
"org.jbpm.web.JobExecutorLauncher",
- "org.jbpm.web.JbpmConfigurationCloser",
- "org.jbpm.JbpmContextTestHelper",
- "org.jbpm.EventCallback$1"
+ "org.jbpm.web.JbpmConfigurationCloser"
};
public void testForNonSerializableClasses() {
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/instantiation/ConfigurableClassloadersTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/instantiation/ConfigurableClassloadersTest.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/instantiation/ConfigurableClassloadersTest.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -23,7 +23,6 @@
import org.jbpm.AbstractJbpmTestCase;
import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmConfigurationTestHelper;
import org.jbpm.JbpmContext;
import org.jbpm.graph.def.ProcessDefinition;
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1072/JBPM1072Test.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -21,11 +21,11 @@
*/
package org.jbpm.jbpm1072;
-import org.jbpm.EventCallback;
import org.jbpm.JbpmConfiguration;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.EventCallback;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.ProcessInstance;
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1135/JBPM1135Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1135/JBPM1135Test.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1135/JBPM1135Test.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -21,9 +21,9 @@
*/
package org.jbpm.jbpm1135;
-import org.jbpm.EventCallback;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.EventCallback;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1452/JBPM1452Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1452/JBPM1452Test.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1452/JBPM1452Test.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -22,6 +22,7 @@
package org.jbpm.jbpm1452;
import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmException;
import org.jbpm.configuration.ObjectFactory;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ProcessDefinition;
@@ -78,7 +79,7 @@
newTransaction();
processInstance.end();
}
- catch (RuntimeException e) {
+ catch (JbpmException e) {
jbpmContext.setRollbackOnly();
fail("could not end process instance in absence of job executor: " + e);
}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1755/JBPM1755Test.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1755/JBPM1755Test.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jbpm1755/JBPM1755Test.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -3,9 +3,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
-import org.jbpm.EventCallback;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.EventCallback;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.node.Join;
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/AbstractEnterpriseTestCase.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -37,7 +37,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.cfg.Environment;
-import org.jbpm.EventCallback;
import org.jbpm.JbpmContext;
import org.jbpm.command.Command;
import org.jbpm.command.CommandService;
@@ -47,6 +46,7 @@
import org.jbpm.command.SignalCommand;
import org.jbpm.command.StartProcessInstanceCommand;
import org.jbpm.ejb.LocalCommandServiceHome;
+import org.jbpm.graph.def.EventCallback;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.persistence.db.DbPersistenceServiceFactory;
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/ejbtimer/EjbSchedulerTest.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -26,11 +26,11 @@
import junit.framework.Test;
import org.jboss.bpm.api.test.IntegrationTestSetup;
-import org.jbpm.EventCallback;
import org.jbpm.JbpmContext;
import org.jbpm.command.Command;
import org.jbpm.enterprise.AbstractEnterpriseTestCase;
import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.EventCallback;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.jbpm.scheduler.ejbtimer.EntitySchedulerService;
Modified: jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java
===================================================================
--- jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-02-19 00:28:36 UTC (rev 3931)
+++ jbpm3/trunk/modules/enterprise/src/test/java/org/jbpm/enterprise/jms/JmsMessageTest.java 2009-02-19 00:36:21 UTC (rev 3932)
@@ -24,9 +24,9 @@
import junit.framework.Test;
import org.jboss.bpm.api.test.IntegrationTestSetup;
-import org.jbpm.EventCallback;
import org.jbpm.enterprise.AbstractEnterpriseTestCase;
import org.jbpm.graph.def.Event;
+import org.jbpm.graph.def.EventCallback;
import org.jbpm.msg.jms.JmsMessageService;
/**
More information about the jbpm-commits
mailing list