JBoss JBPM SVN: r2355 - in jbpm4/trunk/modules/api/src/main/java/org: jbpm and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 10:53:47 -0400 (Wed, 24 Sep 2008)
New Revision: 2355
Added:
jbpm4/trunk/modules/api/src/main/java/org/jbpm/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/BPMException.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/EngineShutdownException.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/InvalidProcessException.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NameNotUniqueException.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NotImplementedException.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessNotFoundException.java
jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessTimeoutException.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jboss/
Log:
Move package to org.jbpm.api
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/BPMException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/BPMException.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/BPMException.java 2008-09-24 14:53:47 UTC (rev 2355)
@@ -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;
+
+// $Id$
+
+/**
+ * A RuntimeException that can be thrown for unrecoverable API errors
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+@SuppressWarnings("serial")
+public class BPMException extends RuntimeException
+{
+ public BPMException()
+ {
+ super();
+ }
+
+ public BPMException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public BPMException(String message)
+ {
+ super(message);
+ }
+
+ public BPMException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/BPMException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/EngineShutdownException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/EngineShutdownException.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/EngineShutdownException.java 2008-09-24 14:53:47 UTC (rev 2355)
@@ -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;
+
+// $Id$
+
+/**
+ * A JBPMException that is thrown when an invalid operation is invoked on engine shutdown.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+@SuppressWarnings("serial")
+public class EngineShutdownException extends BPMException
+{
+
+ public EngineShutdownException()
+ {
+ super();
+ }
+
+ public EngineShutdownException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/EngineShutdownException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/InvalidProcessException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/InvalidProcessException.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/InvalidProcessException.java 2008-09-24 14:53:47 UTC (rev 2355)
@@ -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;
+
+
+// $Id$
+
+/**
+ * A RuntimeException that is thrown for invalid processes
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+@SuppressWarnings("serial")
+public class InvalidProcessException extends BPMException
+{
+ public InvalidProcessException()
+ {
+ super();
+ }
+
+ public InvalidProcessException(String message)
+ {
+ super(message);
+ }
+
+ public InvalidProcessException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public InvalidProcessException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/InvalidProcessException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NameNotUniqueException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NameNotUniqueException.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NameNotUniqueException.java 2008-09-24 14:53:47 UTC (rev 2355)
@@ -0,0 +1,44 @@
+/*
+ * 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;
+
+// $Id$
+
+/**
+ * A JBPMException that is thrown when an element name is not unique.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+@SuppressWarnings("serial")
+public class NameNotUniqueException extends InvalidProcessException
+{
+ public NameNotUniqueException()
+ {
+ super();
+ }
+
+ public NameNotUniqueException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NameNotUniqueException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NotImplementedException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NotImplementedException.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NotImplementedException.java 2008-09-24 14:53:47 UTC (rev 2355)
@@ -0,0 +1,39 @@
+/*
+ * 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;
+
+// $Id$
+
+/**
+ * A RuntimeException that should be thrown for unimplemented features
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Jun-2008
+ */
+@SuppressWarnings("serial")
+public class NotImplementedException extends RuntimeException
+{
+ public NotImplementedException(String jiraIssue, String message)
+ {
+ super("[" + jiraIssue + "] " + message);
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/NotImplementedException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessNotFoundException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessNotFoundException.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessNotFoundException.java 2008-09-24 14:53:47 UTC (rev 2355)
@@ -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;
+
+
+// $Id$
+
+/**
+ * A RuntimeException that is when a process cannot be found in persistent storage.
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 18-Sep-2008
+ */
+@SuppressWarnings("serial")
+public class ProcessNotFoundException extends BPMException
+{
+ public ProcessNotFoundException()
+ {
+ super();
+ }
+
+ public ProcessNotFoundException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessNotFoundException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessTimeoutException.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessTimeoutException.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessTimeoutException.java 2008-09-24 14:53:47 UTC (rev 2355)
@@ -0,0 +1,54 @@
+/*
+ * 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;
+
+// $Id$
+
+/**
+ * A RuntimeException that is thrown when the process does not respond in time
+ *
+ * @author thomas.diesler(a)jboss.com
+ * @since 24-Jul-2008
+ */
+@SuppressWarnings("serial")
+public class ProcessTimeoutException extends BPMException
+{
+ public ProcessTimeoutException()
+ {
+ super();
+ }
+
+ public ProcessTimeoutException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public ProcessTimeoutException(String message)
+ {
+ super(message);
+ }
+
+ public ProcessTimeoutException(Throwable cause)
+ {
+ super(cause);
+ }
+}
Property changes on: jbpm4/trunk/modules/api/src/main/java/org/jbpm/api/ProcessTimeoutException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 6 months
JBoss JBPM SVN: r2354 - jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 10:38:35 -0400 (Wed, 24 Sep 2008)
New Revision: 2354
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
Log:
Remove MC based test cases
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-09-24 14:28:24 UTC (rev 2353)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/AbstractAPITestCase.java 2008-09-24 14:38:35 UTC (rev 2354)
@@ -1,354 +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.jboss.bpm.test;
-
-// $Id$
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.ObjectName;
-
-import junit.framework.TestCase;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.BPMException;
-import org.jboss.bpm.client.DialectHandler;
-import org.jboss.bpm.client.MessageListener;
-import org.jboss.bpm.client.MessageManager;
-import org.jboss.bpm.client.ProcessManager;
-import org.jboss.bpm.client.SignalListener;
-import org.jboss.bpm.client.SignalManager;
-import org.jboss.bpm.client.internal.EmbeddedBeansDeployer;
-import org.jboss.bpm.model.Constants;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.ObjectNameFactory;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.Signal;
-
-public abstract class AbstractAPITestCase extends TestCase
-{
- // provide logging
- protected final Log log = LogFactory.getLog(getClass());
-
- // Every test case has a deployer
- private EmbeddedBeansDeployer deployer;
- // The embedded SignalListener
- private SignalListener signalListener;
- // The embedded MessageListener
- private MessageListener messageListener;
- // The signals caught by this test case
- private List<Signal> signals = new ArrayList<Signal>();
- // The messages caught by this test case
- private List<Message> messages = new ArrayList<Message>();
-
- /** Overwrite to provide beans config */
- protected abstract String getBeansConfig();
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- log.debug("setUp: " + getClass().getName() + "." + getName());
-
- deployer = new EmbeddedBeansDeployer();
-
- // Setup the SignalListener
- clearAllSignalListeners();
- SignalManager sigManager = SignalManager.locateSignalManager();
- sigManager.addSignalListener(getSignalListener());
- synchronized (signals)
- {
- signals.clear();
- }
-
- // Setup the MessageListener
- clearAllMessageListeners();
- MessageManager msgManager = MessageManager.locateMessageManager();
- msgManager.addMessageListener(getMessageListener());
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- log.debug("tearDown: " + getClass().getName() + "." + getName());
-
- // Tear down the SignalListener
- SignalManager signalManager = SignalManager.locateSignalManager();
- signalManager.removeSignalListener(getSignalListener());
-
- // Tear down the MessageListener
- MessageManager messageManager = MessageManager.locateMessageManager();
- messageManager.removeMessageListener(getTestID());
-
- // Check that there are no registered processes left
- ProcessManager procManager = ProcessManager.locateProcessManager();
- Set<Process> procs = procManager.getProcesses();
- if (procs.size() > 0)
- {
- System.out.println("FIXME: Registered processes on tear down of " + getName() + ": " + procs);
- System.exit(1);
- }
-
- // Check that there are no registered signal listeners left
- Set<SignalListener> sigListeners = signalManager.getSignalListeners();
- if (sigListeners.size() > 0)
- {
- System.out.println("FIXME: Registered signal listeners on tear down of " + getName() + ": " + sigListeners);
- System.exit(1);
- }
-
- // Check that there are no registered signal listeners left
- Set<MessageListener> msgListeners = messageManager.getMessageListeners();
- if (msgListeners.size() > 0)
- {
- System.out.println("FIXME: Registered message listeners on tear down of " + getName() + ": " + msgListeners);
- System.exit(1);
- }
-
- super.tearDown();
- }
-
- private void clearAllSignalListeners()
- {
- SignalManager sigManager = SignalManager.locateSignalManager();
- Set<SignalListener> sigListeners = sigManager.getSignalListeners();
- for (SignalListener sigListener : sigListeners)
- {
- sigManager.removeSignalListener(sigListener);
- }
- }
-
- private void clearAllMessageListeners()
- {
- MessageManager msgManager = MessageManager.locateMessageManager();
- Set<MessageListener> msgListeners = msgManager.getMessageListeners();
- for (MessageListener msgListener : msgListeners)
- {
- msgManager.removeMessageListener(msgListener.getID());
- }
- }
-
- // Deploy a beans config
- protected void deployBeans(String resourceName)
- {
- URL url = getBeansConfigURL(resourceName);
- deployer.deploy(url);
- }
-
- // Undeploy a beans config
- protected void undeployBeans(String resourceName)
- {
- URL url = getBeansConfigURL(resourceName);
- deployer.undeploy(url);
- deployer = null;
- }
-
- // Get the URL for an resource
- protected URL getResourceURL(String resource)
- {
- ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
- URL url = ctxLoader.getResource(resource);
- if (url == null)
- throw new IllegalStateException("Cannot find resource: " + resource);
-
- return url;
- }
-
- private URL getBeansConfigURL(String resourceName)
- {
- URL url = Thread.currentThread().getContextClassLoader().getResource(resourceName);
- if (url == null)
- throw new BPMException("Cannot find resource: " + resourceName);
- return url;
- }
-
- public SignalListener getSignalListener()
- {
- if (signalListener == null)
- {
- signalListener = new SignalListener()
- {
- public boolean acceptSignal(Signal signal)
- {
- return true;
- }
-
- public void catchSignal(Signal signal)
- {
- synchronized (signals)
- {
- signals.add(signal);
- }
- }
-
- public String toString()
- {
- return "SignalListener[" + getShortName() + "]";
- }
- };
- }
- return signalListener;
- }
-
- public List<Signal> getSignals()
- {
- synchronized (signals)
- {
- return Collections.unmodifiableList(signals);
- }
- }
-
- public List<Signal> getSignals(Signal.SignalType type)
- {
- synchronized (signals)
- {
- List<Signal> retSignals = new ArrayList<Signal>();
- for (Signal sig : signals)
- {
- if (sig.getSignalType() == type)
- retSignals.add(sig);
- }
- return Collections.unmodifiableList(retSignals);
- }
- }
-
- public MessageListener getMessageListener()
- {
- if (messageListener == null)
- {
- messageListener = new MessageListener()
- {
- public ObjectName getID()
- {
- return getTestID();
- }
-
- public void catchMessage(Message message)
- {
- synchronized (messages)
- {
- log.debug("catchMessage: " + message);
- messages.add(message);
- }
- }
- };
- }
- return messageListener;
- }
-
- public ObjectName getTestID()
- {
- String shortName = getShortName();
- shortName = shortName.replace("DescriptorTest", "Test");
- shortName = shortName.replace("MarshallerTest", "Test");
- return ObjectNameFactory.create(Constants.ID_DOMAIN, "test", shortName);
- }
-
- public List<Message> getMessages()
- {
- synchronized (messages)
- {
- return Collections.unmodifiableList(messages);
- }
- }
-
- /**
- * Marshall the given process
- *
- * @param out if null, the proces is marshalled to a file
- */
- public String marshallProcess(Process proc, Writer out)
- {
- try
- {
- if (out == null)
- {
- File file = new File("target/" + getName() + "-" + getDialect() + ".xml");
- out = new FileWriter(file);
- System.out.println("Marshall process to: " + file.getCanonicalPath());
- }
-
- String procXML = marshallProcess(proc);
- out.write(procXML);
- out.close();
-
- return procXML;
- }
- catch (IOException ex)
- {
- throw new BPMException("Cannot marshall process", ex);
- }
- }
-
- /**
- * Marshall the given process
- */
- public String marshallProcess(Process proc) throws IOException
- {
- ProcessManager procManager = ProcessManager.locateProcessManager();
- DialectHandler dialectHandler = procManager.getDialectHandler(getDialectURI());
-
- StringWriter strwr = new StringWriter();
- dialectHandler.marshallProcess(proc, strwr);
- return strwr.toString();
- }
-
- /**
- * Get the test short name, which is the class name without the package
- */
- protected String getShortName()
- {
- String shortName = getClass().getName();
- shortName = shortName.substring(shortName.lastIndexOf(".") + 1);
- return shortName;
- }
-
- /**
- * Get the BPM descriptor dialect ID
- */
- protected String getDialect()
- {
- String dialect = System.getProperty("jbpm.dialect", "api10");
- return dialect;
- }
-
- /**
- * Get the BPM descriptor dialect ID
- */
- protected URI getDialectURI()
- {
- String defaultURI = DialectHandler.DEFAULT_NAMESPACE_URI.toString();
- URI nsURI = URI.create(System.getProperty("jbpm.dialect.uri", defaultURI));
- return nsURI;
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-09-24 14:28:24 UTC (rev 2353)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/DefaultEngineTestCase.java 2008-09-24 14:38:35 UTC (rev 2354)
@@ -1,35 +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.jboss.bpm.test;
-
-// $Id$
-
-import org.jboss.bpm.client.ProcessEngine;
-
-public abstract class DefaultEngineTestCase extends AbstractAPITestCase
-{
- @Override
- protected String getBeansConfig()
- {
- return ProcessEngine.JBPM_ENGINE_CONFIG;
- }
-}
17 years, 6 months
JBoss JBPM SVN: r2353 - jbpm4/trunk/modules/api.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 10:28:24 -0400 (Wed, 24 Sep 2008)
New Revision: 2353
Added:
jbpm4/trunk/modules/api/.classpath
jbpm4/trunk/modules/api/.project
jbpm4/trunk/modules/api/pom.xml
Modified:
jbpm4/trunk/modules/api/
Log:
Add api eclipse stuff
Property changes on: jbpm4/trunk/modules/api
___________________________________________________________________
Name: svn:ignore
+ .settings
target
Added: jbpm4/trunk/modules/api/.classpath
===================================================================
--- jbpm4/trunk/modules/api/.classpath (rev 0)
+++ jbpm4/trunk/modules/api/.classpath 2008-09-24 14:28:24 UTC (rev 2353)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <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"/>
+</classpath>
Added: jbpm4/trunk/modules/api/.project
===================================================================
--- jbpm4/trunk/modules/api/.project (rev 0)
+++ jbpm4/trunk/modules/api/.project 2008-09-24 14:28:24 UTC (rev 2353)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbpm-api</name>
+ <comment></comment>
+ <projects>
+ </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>
Added: jbpm4/trunk/modules/api/pom.xml
===================================================================
--- jbpm4/trunk/modules/api/pom.xml (rev 0)
+++ jbpm4/trunk/modules/api/pom.xml 2008-09-24 14:28:24 UTC (rev 2353)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ====================================================================== -->
+<!-- -->
+<!-- JBoss, the OpenSource J2EE webOS -->
+<!-- -->
+<!-- Distributable under LGPL license. -->
+<!-- See terms of license at http://www.gnu.org. -->
+<!-- -->
+<!-- ====================================================================== -->
+
+<!-- $Id$ -->
+<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>JBoss jBPM4 - API</name>
+ <groupId>org.jbpm.spec</groupId>
+ <artifactId>jbpm-api</artifactId>
+ <packaging>jar</packaging>
+
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <!-- Dependencies -->
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ </dependencies>
+
+ <!-- Plugins -->
+ <build>
+ <plugins>
+ </plugins>
+ </build>
+
+ <!-- Reporting -->
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <show>public</show>
+ <excludePackageNames>*.internal:*.incubation:*.test</excludePackageNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
\ No newline at end of file
Property changes on: jbpm4/trunk/modules/api/pom.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 6 months
JBoss JBPM SVN: r2352 - in jbpm4/trunk: modules/api/src/main/java/org/jboss/bpm and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 10:25:46 -0400 (Wed, 24 Sep 2008)
New Revision: 2352
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/model/
Modified:
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessEngine.java
jbpm4/trunk/pom.xml
Log:
Initial api
Modified: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessEngine.java
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessEngine.java 2008-09-24 14:09:42 UTC (rev 2351)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessEngine.java 2008-09-24 14:25:46 UTC (rev 2352)
@@ -21,18 +21,6 @@
*/
package org.jboss.bpm.client;
-import java.net.URL;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.BPMException;
-import org.jboss.bpm.client.internal.EmbeddedBeansDeployer;
-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;
-
-
// $Id$
/**
@@ -43,22 +31,6 @@
*/
public class ProcessEngine
{
- // provide logging
- private static final Log log = LogFactory.getLog(ProcessEngine.class);
-
- /** The process engine bean name - jBPMEngine */
- public static final String BEAN_NAME = "jBPMProcessEngine";
- /** The default bean config: jbpm-beans.xml */
- public static final String JBPM_ENGINE_CONFIG = "jbpm-beans.xml";
-
- // Injected through the MC
- protected ProcessManager processManager;
- // Injected through the MC
- protected ExecutionManager executionManager;
- // Injected through the MC
- protected SignalManager signalManager;
- // Injected through the MC
- protected MessageManager messageManager;
// Flag to indicate that the Engine is shutting down
private boolean prepareForShutdown;
@@ -72,50 +44,17 @@
*
* @return The configured instance of a process engine
*/
- @SuppressWarnings("deprecation")
public static ProcessEngine locateProcessEngine()
{
- KernelRegistryEntry entry = null;
- Kernel kernel = KernelLocator.getKernel();
- if (kernel == null)
- {
- deployEngineConfiguration();
- kernel = KernelLocator.getKernel();
- entry = kernel.getRegistry().getEntry(ProcessEngine.BEAN_NAME);
- }
- else
- {
- try
- {
- entry = kernel.getRegistry().getEntry(ProcessEngine.BEAN_NAME);
- }
- catch (KernelRegistryEntryNotFoundException ex)
- {
- deployEngineConfiguration();
- entry = kernel.getRegistry().getEntry(ProcessEngine.BEAN_NAME);
- }
- }
-
- ProcessEngine engine = (ProcessEngine)entry.getTarget();
- return engine;
+ return null;
}
- private static void deployEngineConfiguration()
- {
- String config = ProcessEngine.JBPM_ENGINE_CONFIG;
- URL url = Thread.currentThread().getContextClassLoader().getResource(config);
- if (url == null)
- throw new BPMException("Cannot find resource: " + config);
-
- new EmbeddedBeansDeployer().deploy(url);
- }
-
/**
* Prepare the engine for shutdown. During shutdown the creation of new processes is disallowed.
*/
public void prepareForShutdown()
{
- log.debug("prepareForShutdown");
+ //log.debug("prepareForShutdown");
prepareForShutdown = true;
}
@@ -132,55 +71,7 @@
*/
public void cancelShutdown()
{
- log.debug("cancelShutdown");
+ //log.debug("cancelShutdown");
prepareForShutdown = false;
}
-
- /**
- * Get the configured instance of the ProcessManager
- *
- * @return The ProcessManager
- */
- public ProcessManager getProcessManager()
- {
- if (processManager == null)
- throw new IllegalStateException("ProcessManager not available through kernel configuration");
- return processManager;
- }
-
- /**
- * Get the configured instance of the ExecutionManager
- *
- * @return The ExecutionManager
- */
- public ExecutionManager getExecutionManager()
- {
- if (executionManager == null)
- throw new IllegalStateException("ExecutionManager not available through kernel configuration");
- return executionManager;
- }
-
- /**
- * Get the configured instance of the SignalManager
- *
- * @return The SignalManager
- */
- public SignalManager getSignalManager()
- {
- if (signalManager == null)
- throw new IllegalStateException("SignalManager not available through kernel configuration");
- return signalManager;
- }
-
- /**
- * Get the configured instance of the MessageManager
- *
- * @return The MessageManager
- */
- public MessageManager getMessageManager()
- {
- if (messageManager == null)
- throw new IllegalStateException("MessageManager not available through kernel configuration");
- return messageManager;
- }
}
\ No newline at end of file
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2008-09-24 14:09:42 UTC (rev 2351)
+++ jbpm4/trunk/pom.xml 2008-09-24 14:25:46 UTC (rev 2352)
@@ -33,6 +33,7 @@
<!-- Modules -->
<modules>
+ <module>modules/api</module>
<module>modules/pvm</module>
<module>modules/jpdl</module>
</modules>
17 years, 6 months
JBoss JBPM SVN: r2351 - in jbpm4/trunk/modules/api/src/main: java/org/jboss/bpm and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 10:09:42 -0400 (Wed, 24 Sep 2008)
New Revision: 2351
Added:
jbpm4/trunk/modules/api/src/main/java/
Removed:
jbpm4/trunk/modules/api/src/main/java/
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectHandler.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageListener.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageManager.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/PersistenceService.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/
Log:
Add api module
Copied: jbpm4/trunk/modules/api/src/main/java (from rev 2307, projects/jbpm-spec/trunk/modules/api/src/main/java)
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectHandler.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectHandler.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectHandler.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,64 +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.jboss.bpm.client;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URL;
-
-import org.jboss.bpm.model.Process;
-
-/**
- * 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, boolean isInclude);
-
- /**
- * Create a {@link Process} from a descriptor URL.
- * @param isInclude TODO
- */
- Process createProcess(URL pURL, boolean isInclude) throws IOException;
-
- /**
- * Marshall the process to the given writer
- */
- void marshallProcess(Process proc, Writer out) throws IOException;
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,51 +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.jboss.bpm.client;
-
-//$Id$
-
-import java.net.URI;
-import java.util.Map;
-
-/**
- * A registry that Maps namespaceURI to dialect Id
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jul-2008
- */
-public class DialectRegistry
-{
- public static final Object BEAN_NAME = "jBPMDialectRegistry";
-
- // Maps namespaceURI to dialect Id
- private Map<URI,String> registry;
-
- public void setRegistry(Map<URI, String> registry)
- {
- this.registry = registry;
- }
-
- public String getDialect(URI nsURI)
- {
- return registry.get(nsURI);
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,97 +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.jboss.bpm.client;
-
-// $Id: $
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.StartEvent;
-import org.jboss.bpm.model.Process.ProcessStatus;
-import org.jboss.bpm.runtime.Attachments;
-
-/**
- * The ExecutionManager executes processes
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class ExecutionManager
-{
- private ExecutorService procExecutor = Executors.newCachedThreadPool();
-
- // Hide public constructor
- protected ExecutionManager()
- {
- }
-
- /**
- * Locate the ExecutionManager
- */
- public static ExecutionManager locateExecutionManager()
- {
- ProcessEngine engine = ProcessEngine.locateProcessEngine();
- return engine.getExecutionManager();
- }
-
- /**
- * Get the process executor service
- */
- public ExecutorService getProcessExecutor()
- {
- return procExecutor;
- }
-
- /**
- * Start the Process
- *
- * @param proc The Process to start
- * @param att The Attachments in the ExecutionContext
- */
- public abstract void startProcess(Process proc, Attachments att);
-
- /**
- * Start the Process from a given start event
- *
- * @param start The StartEvent that triggers the process
- * @param att The Attachments in the ExecutionContext
- */
- public abstract void startProcess(StartEvent start, 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.
- */
- public abstract ProcessStatus waitForEnd(Process proc);
-
- /**
- * 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.
- */
- public abstract ProcessStatus waitForEnd(Process proc, long timeout);
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageListener.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageListener.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageListener.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,47 +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.jboss.bpm.client;
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.model.Message;
-
-//$Id$
-
-/**
- * A MessageListener that can be registered with the ProcessEngine
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface MessageListener
-{
- /**
- * Get the id for this listener
- */
- ObjectName getID();
-
- /**
- * Catch a message from the process that this listener is registered with
- */
- void catchMessage(Message message);
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageManager.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageManager.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageManager.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,146 +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.jboss.bpm.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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.model.Event;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.Participant;
-import org.jboss.bpm.model.Task;
-
-/**
- * The ProcessEngine sends mesages through the MessageManager. <p/> A {@link Message} has an ID and is targeted to a
- * specific Participant. A component can register a {@link MessageListener} with the MessageManager.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class MessageManager
-{
- // provide logging
- private static final Log log = LogFactory.getLog(MessageManager.class);
-
- // The set of registered message listeners
- private Map<ObjectName, MessageListener> listeners = new HashMap<ObjectName, MessageListener>();
-
- /**
- * Locate the MessageManager
- */
- public static MessageManager locateMessageManager()
- {
- ProcessEngine engine = ProcessEngine.locateProcessEngine();
- return engine.getMessageManager();
- }
-
- /**
- * Add a MessageListener
- */
- public void addMessageListener(MessageListener listener)
- {
- synchronized (listeners)
- {
- if (hasMessageListener(listener.getID()))
- throw new IllegalStateException("Listener already registered: " + listener.getID());
-
- log.debug("addMessageListener: " + listener.getID());
- listeners.put(listener.getID(), listener);
- }
- }
-
- /**
- * Get the set of registered MessageListeners
- */
- public Set<MessageListener> getMessageListeners()
- {
- synchronized (listeners)
- {
- HashSet<MessageListener> set = new HashSet<MessageListener>(listeners.values());
- return Collections.unmodifiableSet(set);
- }
- }
-
- /**
- * Get a MessageListener for a given ID
- *
- * @return null if there is none
- */
- public MessageListener getMessageListener(ObjectName listenerID)
- {
- synchronized (listeners)
- {
- return listeners.get(listenerID);
- }
- }
-
- /**
- * True if there is a MessageListener for a given ID
- */
- public boolean hasMessageListener(ObjectName listenerID)
- {
- return getMessageListener(listenerID) != null;
- }
-
- /**
- * Remove an MessageListener
- */
- public void removeMessageListener(ObjectName listenerID)
- {
- synchronized (listeners)
- {
- log.debug("removeMessageListener: " + listenerID);
- listeners.remove(listenerID);
- }
- }
-
- /**
- * Send a message to a given {@link Task} or {@link Event}
- */
- public abstract void sendMessage(ObjectName procID, String targetName, Message msg);
-
- /**
- * Send a message to a given {@link MessageListener}
- */
- public void sendMessage(Message msg)
- {
- Participant toRef = msg.getToRef().getEntityRef();
- if (toRef == null)
- throw new IllegalArgumentException("Target entity cannot be null");
-
- MessageListener msgListener = getMessageListener(toRef.getName());
- if (msgListener == null)
- throw new IllegalStateException("No message listener registered for: " + toRef);
-
- log.debug("sendMessage to '" + toRef + "' => " + msg);
- msgListener.catchMessage(msg);
- }
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/PersistenceService.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/PersistenceService.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/PersistenceService.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,44 +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.jboss.bpm.client;
-
-// $Id$
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.model.Process;
-
-/**
- * The persistence service for a process.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 17-Sep-2008
- */
-public interface PersistenceService
-{
- ObjectName saveProcess(Process proc);
-
- Process loadProcess(ObjectName procID);
-
- void deleteProcess(Process proc);
-
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,211 +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.jboss.bpm.client;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-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 javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.EngineShutdownException;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.Process.ProcessStatus;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * The process manager is the entry point to create, find and otherwise manage processes.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class ProcessManager implements PersistenceService
-{
- // provide logging
- private static final Log log = LogFactory.getLog(ProcessManager.class);
-
- // The map of registerd dialect handlers
- protected Map<String, DialectHandler> dialectHandlers;
- // The dialect registry
- protected DialectRegistry dialectRegistry;
- // The set of registered processes
- private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
-
- // Hide public constructor
- protected ProcessManager()
- {
- }
-
- /**
- * Locate the ProcessManager
- */
- public static ProcessManager locateProcessManager()
- {
- ProcessEngine engine = ProcessEngine.locateProcessEngine();
- return engine.getProcessManager();
- }
-
- /**
- * Create a Process from a XML string in one of the supported formats.
- * Note, the Process is not automatically registered.
- */
- public final Process createProcess(String pXML)
- {
- URI nsURI = getNamespaceURI(new ByteArrayInputStream(pXML.getBytes()));
- Process proc = getDialectHandler(nsURI).createProcess(pXML, false);
- return proc;
- }
-
- /**
- * Create a Process from an URL to a XML descritor in one of the supported formats.
- * Note, the Process is not automatically registered.
- */
- public final Process createProcess(URL pURL) throws IOException
- {
- URI nsURI = getNamespaceURI(pURL.openStream());
- Process proc = getDialectHandler(nsURI).createProcess(pURL, false);
- return proc;
- }
-
- /**
- * Get the set of registered Processes
- */
- public Set<Process> getProcesses()
- {
- Set<Process> procSet = new HashSet<Process>(procs.values());
- return Collections.unmodifiableSet(procSet);
- }
-
- /**
- * Get a set of Processes for a given name and status.
- * <p/>
- * If the given status is null, all processes with the given name are included.
- *
- * @param name The process name
- * @param status The optional process status
- * @return An empty set if the process cannot be found
- */
- public Set<Process> getProcesses(String name, ProcessStatus status)
- {
- Set<Process> procSet = new HashSet<Process>();
- for (Process aux : procs.values())
- {
- if (aux.getName().equals(name))
- {
- if (status == null || aux.getProcessStatus() == status)
- procSet.add(aux);
- }
- }
- return procSet;
- }
-
- /**
- * Get a Process for a given id
- */
- public Process getProcessByID(ObjectName procID)
- {
- Process proc = procs.get(procID);
- return proc;
- }
-
- /**
- * Register a Process explicitly.
- * <p/>
- * A Process that is registered explicitly, can be started by name.
- * <p/>
- * An implementation may replace the given process with a copy of itself. The copy
- * can then be started without effecting the just registered process.
- * <p/>
- *
- */
- public Process registerProcess(Process proc)
- {
- if (ProcessEngine.locateProcessEngine().isPrepareForShutdown())
- throw new EngineShutdownException("Cannot register a process while engine is shutting down");
-
- log.debug("registerProcess: " + proc);
- procs.put(proc.getID(), proc);
- return proc;
- }
-
- /**
- * Unregister a Process.
- */
- public Process unregisterProcess(ObjectName procID)
- {
- log.debug("unregisterProcess: " + procID);
- return procs.remove(procID);
- }
-
- private URI getNamespaceURI(InputStream inStream)
- {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- Document doc;
- try
- {
- DocumentBuilder db = dbf.newDocumentBuilder();
- doc = db.parse(inStream);
- }
- 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);
- }
-
- /**
- * Get the handler for the dialect with the given namespace URI
- */
- public DialectHandler getDialectHandler(URI nsURI)
- {
- String dialectId = dialectRegistry.getDialect(nsURI);
- if (dialectId == null)
- throw new IllegalStateException("No dialect registered for: " + nsURI);
-
- DialectHandler dialectHandler = dialectHandlers.get(dialectId);
- if (dialectHandler == null)
- throw new IllegalStateException("No dialect handler registered for: " + dialectId);
-
- return dialectHandler;
- }
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,45 +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.jboss.bpm.client;
-
-//$Id$
-
-import org.jboss.bpm.model.Signal;
-
-/**
- * A signal listener that can be registered with the {@link SignalManager}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalListener
-{
- /**
- * Returns true if the listener accepts a given signal
- */
- boolean acceptSignal(Signal signal);
-
- /**
- * Catch a previously accepted signal
- */
- void catchSignal(Signal signal);
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-09-24 14:09:42 UTC (rev 2351)
@@ -1,133 +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.jboss.bpm.client;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.model.Signal;
-
-/**
- * The ProcessEngine sends signals through the SignalManager. <p/> A {@link Signal} is like an undirected flare shot up
- * into the air. A component can register a {@link SignalListener} with the SignalManager.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class SignalManager
-{
- // provide logging
- private static final Log log = LogFactory.getLog(SignalManager.class);
-
- // The map of registered signal listeners
- private Set<SignalListener> listeners = new HashSet<SignalListener>();
-
- /**
- * Locate the SignalManager
- */
- public static SignalManager locateSignalManager()
- {
- ProcessEngine engine = ProcessEngine.locateProcessEngine();
- return engine.getSignalManager();
- }
-
- /**
- * Add a SignalListener for a given source
- */
- public void addSignalListener(SignalListener listener)
- {
- synchronized (listeners)
- {
- log.debug("addSignalListener: " + listener);
- listeners.add(listener);
- }
- }
-
- /**
- * Get the set of registered SignalListeners
- */
- public Set<SignalListener> getSignalListeners()
- {
- synchronized (listeners)
- {
- HashSet<SignalListener> set = new HashSet<SignalListener>(listeners);
- return Collections.unmodifiableSet(set);
- }
- }
-
- /**
- * Remove a SignalListener for a given source
- */
- public void removeSignalListener(SignalListener listener)
- {
- synchronized (listeners)
- {
- log.debug("removeSignalListener: " + listener);
- listeners.remove(listener);
- }
- }
-
- /**
- * Throw a signal to all registered listeners
- */
- public void throwSignal(Signal signal)
- {
- log.debug("throwSignal: " + signal);
- Set<SignalListener> currentSet = getSignalListeners();
- for (SignalListener listener : currentSet)
- {
- if (failsafeAccept(listener, signal))
- failsafeThrow(listener, signal);
- }
- }
-
- private boolean failsafeAccept(SignalListener listener, Signal signal)
- {
- try
- {
- boolean accept = listener.acceptSignal(signal);
- return accept;
- }
- catch (RuntimeException rte)
- {
- log.error("Signal processing error", rte);
- return false;
- }
- }
-
- private void failsafeThrow(SignalListener listener, Signal signal)
- {
- try
- {
- listener.catchSignal(signal);
- }
- catch (RuntimeException rte)
- {
- log.error("Signal processing error", rte);
- }
- }
-}
\ No newline at end of file
17 years, 6 months
JBoss JBPM SVN: r2350 - in jbpm4/trunk/modules: api and 5 other directories.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 10:08:56 -0400 (Wed, 24 Sep 2008)
New Revision: 2350
Added:
jbpm4/trunk/modules/api/
jbpm4/trunk/modules/api/src/
jbpm4/trunk/modules/api/src/main/
jbpm4/trunk/modules/api/src/main/java/
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestCase.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java
Removed:
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectHandler.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageListener.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageManager.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/PersistenceService.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/internal/
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/model/
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/runtime/
jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java
Log:
Add api module
Copied: jbpm4/trunk/modules/api/src/main/java (from rev 2307, projects/jbpm-spec/trunk/modules/api/src/main/java)
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectHandler.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectHandler.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectHandler.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,64 +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.jboss.bpm.client;
-
-//$Id$
-
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URL;
-
-import org.jboss.bpm.model.Process;
-
-/**
- * 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, boolean isInclude);
-
- /**
- * Create a {@link Process} from a descriptor URL.
- * @param isInclude TODO
- */
- Process createProcess(URL pURL, boolean isInclude) throws IOException;
-
- /**
- * Marshall the process to the given writer
- */
- void marshallProcess(Process proc, Writer out) throws IOException;
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/DialectRegistry.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,51 +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.jboss.bpm.client;
-
-//$Id$
-
-import java.net.URI;
-import java.util.Map;
-
-/**
- * A registry that Maps namespaceURI to dialect Id
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jul-2008
- */
-public class DialectRegistry
-{
- public static final Object BEAN_NAME = "jBPMDialectRegistry";
-
- // Maps namespaceURI to dialect Id
- private Map<URI,String> registry;
-
- public void setRegistry(Map<URI, String> registry)
- {
- this.registry = registry;
- }
-
- public String getDialect(URI nsURI)
- {
- return registry.get(nsURI);
- }
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ExecutionManager.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,97 +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.jboss.bpm.client;
-
-// $Id: $
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.StartEvent;
-import org.jboss.bpm.model.Process.ProcessStatus;
-import org.jboss.bpm.runtime.Attachments;
-
-/**
- * The ExecutionManager executes processes
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class ExecutionManager
-{
- private ExecutorService procExecutor = Executors.newCachedThreadPool();
-
- // Hide public constructor
- protected ExecutionManager()
- {
- }
-
- /**
- * Locate the ExecutionManager
- */
- public static ExecutionManager locateExecutionManager()
- {
- ProcessEngine engine = ProcessEngine.locateProcessEngine();
- return engine.getExecutionManager();
- }
-
- /**
- * Get the process executor service
- */
- public ExecutorService getProcessExecutor()
- {
- return procExecutor;
- }
-
- /**
- * Start the Process
- *
- * @param proc The Process to start
- * @param att The Attachments in the ExecutionContext
- */
- public abstract void startProcess(Process proc, Attachments att);
-
- /**
- * Start the Process from a given start event
- *
- * @param start The StartEvent that triggers the process
- * @param att The Attachments in the ExecutionContext
- */
- public abstract void startProcess(StartEvent start, 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.
- */
- public abstract ProcessStatus waitForEnd(Process proc);
-
- /**
- * 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.
- */
- public abstract ProcessStatus waitForEnd(Process proc, long timeout);
-}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageListener.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageListener.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageListener.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,47 +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.jboss.bpm.client;
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.model.Message;
-
-//$Id$
-
-/**
- * A MessageListener that can be registered with the ProcessEngine
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface MessageListener
-{
- /**
- * Get the id for this listener
- */
- ObjectName getID();
-
- /**
- * Catch a message from the process that this listener is registered with
- */
- void catchMessage(Message message);
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageManager.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageManager.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/MessageManager.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,146 +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.jboss.bpm.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.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.model.Event;
-import org.jboss.bpm.model.Message;
-import org.jboss.bpm.model.Participant;
-import org.jboss.bpm.model.Task;
-
-/**
- * The ProcessEngine sends mesages through the MessageManager. <p/> A {@link Message} has an ID and is targeted to a
- * specific Participant. A component can register a {@link MessageListener} with the MessageManager.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class MessageManager
-{
- // provide logging
- private static final Log log = LogFactory.getLog(MessageManager.class);
-
- // The set of registered message listeners
- private Map<ObjectName, MessageListener> listeners = new HashMap<ObjectName, MessageListener>();
-
- /**
- * Locate the MessageManager
- */
- public static MessageManager locateMessageManager()
- {
- ProcessEngine engine = ProcessEngine.locateProcessEngine();
- return engine.getMessageManager();
- }
-
- /**
- * Add a MessageListener
- */
- public void addMessageListener(MessageListener listener)
- {
- synchronized (listeners)
- {
- if (hasMessageListener(listener.getID()))
- throw new IllegalStateException("Listener already registered: " + listener.getID());
-
- log.debug("addMessageListener: " + listener.getID());
- listeners.put(listener.getID(), listener);
- }
- }
-
- /**
- * Get the set of registered MessageListeners
- */
- public Set<MessageListener> getMessageListeners()
- {
- synchronized (listeners)
- {
- HashSet<MessageListener> set = new HashSet<MessageListener>(listeners.values());
- return Collections.unmodifiableSet(set);
- }
- }
-
- /**
- * Get a MessageListener for a given ID
- *
- * @return null if there is none
- */
- public MessageListener getMessageListener(ObjectName listenerID)
- {
- synchronized (listeners)
- {
- return listeners.get(listenerID);
- }
- }
-
- /**
- * True if there is a MessageListener for a given ID
- */
- public boolean hasMessageListener(ObjectName listenerID)
- {
- return getMessageListener(listenerID) != null;
- }
-
- /**
- * Remove an MessageListener
- */
- public void removeMessageListener(ObjectName listenerID)
- {
- synchronized (listeners)
- {
- log.debug("removeMessageListener: " + listenerID);
- listeners.remove(listenerID);
- }
- }
-
- /**
- * Send a message to a given {@link Task} or {@link Event}
- */
- public abstract void sendMessage(ObjectName procID, String targetName, Message msg);
-
- /**
- * Send a message to a given {@link MessageListener}
- */
- public void sendMessage(Message msg)
- {
- Participant toRef = msg.getToRef().getEntityRef();
- if (toRef == null)
- throw new IllegalArgumentException("Target entity cannot be null");
-
- MessageListener msgListener = getMessageListener(toRef.getName());
- if (msgListener == null)
- throw new IllegalStateException("No message listener registered for: " + toRef);
-
- log.debug("sendMessage to '" + toRef + "' => " + msg);
- msgListener.catchMessage(msg);
- }
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/PersistenceService.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/PersistenceService.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/PersistenceService.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,44 +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.jboss.bpm.client;
-
-// $Id$
-
-import javax.management.ObjectName;
-
-import org.jboss.bpm.model.Process;
-
-/**
- * The persistence service for a process.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 17-Sep-2008
- */
-public interface PersistenceService
-{
- ObjectName saveProcess(Process proc);
-
- Process loadProcess(ObjectName procID);
-
- void deleteProcess(Process proc);
-
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/ProcessManager.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,211 +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.jboss.bpm.client;
-
-// $Id$
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-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 javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.EngineShutdownException;
-import org.jboss.bpm.model.Process;
-import org.jboss.bpm.model.Process.ProcessStatus;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * The process manager is the entry point to create, find and otherwise manage processes.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public abstract class ProcessManager implements PersistenceService
-{
- // provide logging
- private static final Log log = LogFactory.getLog(ProcessManager.class);
-
- // The map of registerd dialect handlers
- protected Map<String, DialectHandler> dialectHandlers;
- // The dialect registry
- protected DialectRegistry dialectRegistry;
- // The set of registered processes
- private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
-
- // Hide public constructor
- protected ProcessManager()
- {
- }
-
- /**
- * Locate the ProcessManager
- */
- public static ProcessManager locateProcessManager()
- {
- ProcessEngine engine = ProcessEngine.locateProcessEngine();
- return engine.getProcessManager();
- }
-
- /**
- * Create a Process from a XML string in one of the supported formats.
- * Note, the Process is not automatically registered.
- */
- public final Process createProcess(String pXML)
- {
- URI nsURI = getNamespaceURI(new ByteArrayInputStream(pXML.getBytes()));
- Process proc = getDialectHandler(nsURI).createProcess(pXML, false);
- return proc;
- }
-
- /**
- * Create a Process from an URL to a XML descritor in one of the supported formats.
- * Note, the Process is not automatically registered.
- */
- public final Process createProcess(URL pURL) throws IOException
- {
- URI nsURI = getNamespaceURI(pURL.openStream());
- Process proc = getDialectHandler(nsURI).createProcess(pURL, false);
- return proc;
- }
-
- /**
- * Get the set of registered Processes
- */
- public Set<Process> getProcesses()
- {
- Set<Process> procSet = new HashSet<Process>(procs.values());
- return Collections.unmodifiableSet(procSet);
- }
-
- /**
- * Get a set of Processes for a given name and status.
- * <p/>
- * If the given status is null, all processes with the given name are included.
- *
- * @param name The process name
- * @param status The optional process status
- * @return An empty set if the process cannot be found
- */
- public Set<Process> getProcesses(String name, ProcessStatus status)
- {
- Set<Process> procSet = new HashSet<Process>();
- for (Process aux : procs.values())
- {
- if (aux.getName().equals(name))
- {
- if (status == null || aux.getProcessStatus() == status)
- procSet.add(aux);
- }
- }
- return procSet;
- }
-
- /**
- * Get a Process for a given id
- */
- public Process getProcessByID(ObjectName procID)
- {
- Process proc = procs.get(procID);
- return proc;
- }
-
- /**
- * Register a Process explicitly.
- * <p/>
- * A Process that is registered explicitly, can be started by name.
- * <p/>
- * An implementation may replace the given process with a copy of itself. The copy
- * can then be started without effecting the just registered process.
- * <p/>
- *
- */
- public Process registerProcess(Process proc)
- {
- if (ProcessEngine.locateProcessEngine().isPrepareForShutdown())
- throw new EngineShutdownException("Cannot register a process while engine is shutting down");
-
- log.debug("registerProcess: " + proc);
- procs.put(proc.getID(), proc);
- return proc;
- }
-
- /**
- * Unregister a Process.
- */
- public Process unregisterProcess(ObjectName procID)
- {
- log.debug("unregisterProcess: " + procID);
- return procs.remove(procID);
- }
-
- private URI getNamespaceURI(InputStream inStream)
- {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- Document doc;
- try
- {
- DocumentBuilder db = dbf.newDocumentBuilder();
- doc = db.parse(inStream);
- }
- 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);
- }
-
- /**
- * Get the handler for the dialect with the given namespace URI
- */
- public DialectHandler getDialectHandler(URI nsURI)
- {
- String dialectId = dialectRegistry.getDialect(nsURI);
- if (dialectId == null)
- throw new IllegalStateException("No dialect registered for: " + nsURI);
-
- DialectHandler dialectHandler = dialectHandlers.get(dialectId);
- if (dialectHandler == null)
- throw new IllegalStateException("No dialect handler registered for: " + dialectId);
-
- return dialectHandler;
- }
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalListener.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,45 +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.jboss.bpm.client;
-
-//$Id$
-
-import org.jboss.bpm.model.Signal;
-
-/**
- * A signal listener that can be registered with the {@link SignalManager}
- *
- * @author thomas.diesler(a)jboss.com
- * @since 08-Jul-2008
- */
-public interface SignalListener
-{
- /**
- * Returns true if the listener accepts a given signal
- */
- boolean acceptSignal(Signal signal);
-
- /**
- * Catch a previously accepted signal
- */
- void catchSignal(Signal signal);
-}
\ No newline at end of file
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/client/SignalManager.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,133 +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.jboss.bpm.client;
-
-//$Id$
-
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.bpm.model.Signal;
-
-/**
- * The ProcessEngine sends signals through the SignalManager. <p/> A {@link Signal} is like an undirected flare shot up
- * into the air. A component can register a {@link SignalListener} with the SignalManager.
- *
- * @author thomas.diesler(a)jboss.com
- * @since 18-Jun-2008
- */
-public class SignalManager
-{
- // provide logging
- private static final Log log = LogFactory.getLog(SignalManager.class);
-
- // The map of registered signal listeners
- private Set<SignalListener> listeners = new HashSet<SignalListener>();
-
- /**
- * Locate the SignalManager
- */
- public static SignalManager locateSignalManager()
- {
- ProcessEngine engine = ProcessEngine.locateProcessEngine();
- return engine.getSignalManager();
- }
-
- /**
- * Add a SignalListener for a given source
- */
- public void addSignalListener(SignalListener listener)
- {
- synchronized (listeners)
- {
- log.debug("addSignalListener: " + listener);
- listeners.add(listener);
- }
- }
-
- /**
- * Get the set of registered SignalListeners
- */
- public Set<SignalListener> getSignalListeners()
- {
- synchronized (listeners)
- {
- HashSet<SignalListener> set = new HashSet<SignalListener>(listeners);
- return Collections.unmodifiableSet(set);
- }
- }
-
- /**
- * Remove a SignalListener for a given source
- */
- public void removeSignalListener(SignalListener listener)
- {
- synchronized (listeners)
- {
- log.debug("removeSignalListener: " + listener);
- listeners.remove(listener);
- }
- }
-
- /**
- * Throw a signal to all registered listeners
- */
- public void throwSignal(Signal signal)
- {
- log.debug("throwSignal: " + signal);
- Set<SignalListener> currentSet = getSignalListeners();
- for (SignalListener listener : currentSet)
- {
- if (failsafeAccept(listener, signal))
- failsafeThrow(listener, signal);
- }
- }
-
- private boolean failsafeAccept(SignalListener listener, Signal signal)
- {
- try
- {
- boolean accept = listener.acceptSignal(signal);
- return accept;
- }
- catch (RuntimeException rte)
- {
- log.error("Signal processing error", rte);
- return false;
- }
- }
-
- private void failsafeThrow(SignalListener listener, Signal signal)
- {
- try
- {
- listener.catchSignal(signal);
- }
- catch (RuntimeException rte)
- {
- log.error("Signal processing error", rte);
- }
- }
-}
\ No newline at end of file
Copied: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestCase.java (from rev 2314, projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestCase.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestCase.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestCase.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -0,0 +1,87 @@
+/*
+ * 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 protected 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 protected License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General protected
+ * 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.jboss.bpm.test;
+
+// $Id$
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.management.MBeanServerConnection;
+
+import junit.framework.TestCase;
+
+public abstract class IntegrationTestCase extends TestCase
+{
+ private IntegrationTestHelper delegate = new IntegrationTestHelper();
+
+ protected void deploy(String archive) throws Exception
+ {
+ delegate.deploy(archive);
+ }
+
+ protected void undeploy(String archive) throws Exception
+ {
+ delegate.undeploy(archive);
+ }
+
+ protected boolean isTargetJBoss500()
+ {
+ return delegate.isTargetJBoss500();
+ }
+
+ protected boolean isTargetJBoss423()
+ {
+ return delegate.isTargetJBoss423();
+ }
+
+ protected boolean isTargetJBoss422()
+ {
+ return delegate.isTargetJBoss422();
+ }
+
+ protected URL getArchiveURL(String archive) throws MalformedURLException
+ {
+ return delegate.getArchiveURL(archive);
+ }
+
+ protected File getArchiveFile(String archive)
+ {
+ return delegate.getArchiveFile(archive);
+ }
+
+ protected URL getResourceURL(String resource) throws MalformedURLException
+ {
+ return delegate.getResourceURL(resource);
+ }
+
+ protected File getResourceFile(String resource)
+ {
+ return delegate.getResourceFile(resource);
+ }
+
+ protected MBeanServerConnection getServer()
+ {
+ return IntegrationTestHelper.getServer();
+ }
+}
Deleted: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java
===================================================================
--- projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java 2008-09-22 14:04:07 UTC (rev 2307)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -1,145 +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.jboss.bpm.test;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Hashtable;
-
-import javax.management.MBeanServerConnection;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-/**
- * An integration test helper that deals with test deployment/undeployment, etc.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Oct-2004
- */
-public class IntegrationTestHelper
-{
- private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
- private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
-
- private static MBeanServerConnection server;
- private static String testArchiveDir;
- private static String testResourcesDir;
-
- /** Deploy the given archive
- */
- public void deploy(String archive) throws Exception
- {
- URL url = getArchiveFile(archive).toURI().toURL();
- getDeployer().deploy(url);
- }
-
- /** Undeploy the given archive
- */
- public void undeploy(String archive) throws Exception
- {
- URL url = getArchiveFile(archive).toURI().toURL();
- getDeployer().undeploy(url);
- }
-
- @SuppressWarnings("unchecked")
- public static MBeanServerConnection getServer()
- {
- if (server == null)
- {
- Hashtable jndiEnv = null;
- try
- {
- InitialContext iniCtx = new InitialContext();
- jndiEnv = iniCtx.getEnvironment();
- server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
- }
- catch (NamingException ex)
- {
- throw new RuntimeException("Cannot obtain MBeanServerConnection using jndi props: " + jndiEnv, ex);
- }
- }
- return server;
- }
-
- private ArchiveDeployer getDeployer()
- {
- return new JBossArchiveDeployer(getServer());
- }
-
- /** Try to discover the URL for the deployment archive */
- public URL getArchiveURL(String archive) throws MalformedURLException
- {
- return getArchiveFile(archive).toURI().toURL();
- }
-
- /** Try to discover the File for the deployment archive */
- public File getArchiveFile(String archive)
- {
- File file = new File(archive);
- if (file.exists())
- return file;
-
- file = new File(getTestArchiveDir() + "/" + archive);
- if (file.exists())
- return file;
-
- String notSet = (getTestArchiveDir() == null ? " System property '" + SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set." : "");
- throw new IllegalArgumentException("Cannot obtain '" + getTestArchiveDir() + "/" + archive + "'." + notSet);
- }
-
- /** Try to discover the URL for the test resource */
- public URL getResourceURL(String resource) throws MalformedURLException
- {
- return getResourceFile(resource).toURI().toURL();
- }
-
- /** Try to discover the File for the test resource */
- public File getResourceFile(String resource)
- {
- File file = new File(resource);
- if (file.exists())
- return file;
-
- file = new File(getTestResourcesDir() + "/" + resource);
- if (file.exists())
- return file;
-
- throw new IllegalArgumentException("Cannot obtain '" + getTestResourcesDir() + "/" + resource + "'");
- }
-
- public static String getTestArchiveDir()
- {
- if (testArchiveDir == null)
- testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY, "target/test-libs");
-
- return testArchiveDir;
- }
-
- public static String getTestResourcesDir()
- {
- if (testResourcesDir == null)
- testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY, "target/test-resource");
-
- return testResourcesDir;
- }
-}
Copied: jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java (from rev 2313, projects/jbpm-spec/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java)
===================================================================
--- jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java (rev 0)
+++ jbpm4/trunk/modules/api/src/main/java/org/jboss/bpm/test/IntegrationTestHelper.java 2008-09-24 14:08:56 UTC (rev 2350)
@@ -0,0 +1,213 @@
+/*
+ * 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.jboss.bpm.test;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Hashtable;
+
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.bpm.model.ObjectNameFactory;
+
+/**
+ * An integration test helper that deals with test deployment/undeployment, etc.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class IntegrationTestHelper
+{
+ private static final String SYSPROP_TEST_ARCHIVE_DIRECTORY = "test.archive.directory";
+ private static final String SYSPROP_TEST_RESOURCES_DIRECTORY = "test.resources.directory";
+ private static final String SYSPROP_TARGET_CONTAINER = "jbpm.target.container";
+
+ private static MBeanServerConnection server;
+ private static String testArchiveDir;
+ private static String testResourcesDir;
+ private static String integrationTarget;
+
+ /**
+ * Deploy the given archive
+ */
+ public void deploy(String archive) throws Exception
+ {
+ URL url = getArchiveFile(archive).toURI().toURL();
+ getDeployer().deploy(url);
+ }
+
+ /**
+ * Undeploy the given archive
+ */
+ public void undeploy(String archive) throws Exception
+ {
+ URL url = getArchiveFile(archive).toURI().toURL();
+ getDeployer().undeploy(url);
+ }
+
+ public boolean isTargetJBoss500()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss500");
+ }
+
+ public boolean isTargetJBoss423()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss423");
+ }
+
+ public boolean isTargetJBoss422()
+ {
+ String target = getIntegrationTarget();
+ return target.startsWith("jboss422");
+ }
+
+ public String getIntegrationTarget()
+ {
+ if (integrationTarget == null)
+ {
+ integrationTarget = System.getProperty(SYSPROP_TARGET_CONTAINER);
+
+ if (integrationTarget == null)
+ throw new IllegalStateException("Cannot obtain system property: " + SYSPROP_TARGET_CONTAINER);
+
+ // Read the JBoss SpecificationVersion
+ String jbossVersion = null;
+ try
+ {
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ jbossVersion = (String)getServer().getAttribute(oname, "SpecificationVersion");
+ if (jbossVersion == null)
+ throw new IllegalStateException("Cannot obtain jboss version");
+
+ if (jbossVersion.startsWith("5.0.0"))
+ jbossVersion = "jboss500";
+ else if (jbossVersion.startsWith("4.2.3"))
+ jbossVersion = "jboss423";
+ else if (jbossVersion.startsWith("4.2.2"))
+ jbossVersion = "jboss422";
+ else
+ throw new IllegalStateException("Unsupported jboss version: " + jbossVersion);
+ }
+ catch (IllegalStateException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ // ignore, we are not running on jboss-4.2 or greater
+ }
+
+ if (integrationTarget.startsWith(jbossVersion) == false)
+ throw new IllegalStateException("Integration target mismatch: " + integrationTarget + ".startsWith(" + jbossVersion + ")");
+ }
+ return integrationTarget;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static MBeanServerConnection getServer()
+ {
+ if (server == null)
+ {
+ Hashtable jndiEnv = null;
+ try
+ {
+ InitialContext iniCtx = new InitialContext();
+ jndiEnv = iniCtx.getEnvironment();
+ server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
+ }
+ catch (NamingException ex)
+ {
+ throw new RuntimeException("Cannot obtain MBeanServerConnection using jndi props: " + jndiEnv, ex);
+ }
+ }
+ return server;
+ }
+
+ private ArchiveDeployer getDeployer()
+ {
+ return new JBossArchiveDeployer(getServer());
+ }
+
+ /** Try to discover the URL for the deployment archive */
+ public URL getArchiveURL(String archive) throws MalformedURLException
+ {
+ return getArchiveFile(archive).toURI().toURL();
+ }
+
+ /** Try to discover the File for the deployment archive */
+ public File getArchiveFile(String archive)
+ {
+ File file = new File(archive);
+ if (file.exists())
+ return file;
+
+ file = new File(getTestArchiveDir() + "/" + archive);
+ if (file.exists())
+ return file;
+
+ String notSet = (getTestArchiveDir() == null ? " System property '" + SYSPROP_TEST_ARCHIVE_DIRECTORY + "' not set."
+ : "");
+ throw new IllegalArgumentException("Cannot obtain '" + getTestArchiveDir() + "/" + archive + "'." + notSet);
+ }
+
+ /** Try to discover the URL for the test resource */
+ public URL getResourceURL(String resource) throws MalformedURLException
+ {
+ return getResourceFile(resource).toURI().toURL();
+ }
+
+ /** Try to discover the File for the test resource */
+ public File getResourceFile(String resource)
+ {
+ File file = new File(resource);
+ if (file.exists())
+ return file;
+
+ file = new File(getTestResourcesDir() + "/" + resource);
+ if (file.exists())
+ return file;
+
+ throw new IllegalArgumentException("Cannot obtain '" + getTestResourcesDir() + "/" + resource + "'");
+ }
+
+ public static String getTestArchiveDir()
+ {
+ if (testArchiveDir == null)
+ testArchiveDir = System.getProperty(SYSPROP_TEST_ARCHIVE_DIRECTORY, "target/test-libs");
+
+ return testArchiveDir;
+ }
+
+ public static String getTestResourcesDir()
+ {
+ if (testResourcesDir == null)
+ testResourcesDir = System.getProperty(SYSPROP_TEST_RESOURCES_DIRECTORY, "target/test-classes");
+
+ return testResourcesDir;
+ }
+}
17 years, 6 months
JBoss JBPM SVN: r2349 - jbpm4.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 10:01:37 -0400 (Wed, 24 Sep 2008)
New Revision: 2349
Added:
jbpm4/branches/
Log:
Add branches
17 years, 6 months
JBoss JBPM SVN: r2348 - jbpm4.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 09:55:08 -0400 (Wed, 24 Sep 2008)
New Revision: 2348
Removed:
jbpm4/jpdl/
Log:
Move PVM tags to jBPM4
17 years, 6 months
JBoss JBPM SVN: r2347 - jbpm4.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 09:53:39 -0400 (Wed, 24 Sep 2008)
New Revision: 2347
Removed:
jbpm4/pvm/
Log:
Move PVM tags to jBPM4
17 years, 6 months
JBoss JBPM SVN: r2346 - in jbpm4: pvm and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-09-24 09:53:25 -0400 (Wed, 24 Sep 2008)
New Revision: 2346
Added:
jbpm4/tags/
Removed:
jbpm4/pvm/tags/
Log:
Move PVM tags to jBPM4
Copied: jbpm4/tags (from rev 2345, jbpm4/pvm/tags)
17 years, 6 months