[jbpm-commits] JBoss JBPM SVN: r2937 - in jbpm3/branches/tdiesler: modules/integration and 6 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Fri Nov 14 12:57:12 EST 2008
Author: thomas.diesler at jboss.com
Date: 2008-11-14 12:57:12 -0500 (Fri, 14 Nov 2008)
New Revision: 2937
Added:
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java
jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java
jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-cfg-beans.xml
jbpm3/branches/tdiesler/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider
Removed:
jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-beans.xml
Modified:
jbpm3/branches/tdiesler/modules/integration/pom.xml
jbpm3/branches/tdiesler/modules/integration/src/
jbpm3/branches/tdiesler/pom.xml
Log:
Add integration layer
Modified: jbpm3/branches/tdiesler/modules/integration/pom.xml
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/pom.xml 2008-11-14 17:51:14 UTC (rev 2936)
+++ jbpm3/branches/tdiesler/modules/integration/pom.xml 2008-11-14 17:57:12 UTC (rev 2937)
@@ -36,6 +36,12 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-cts</artifactId>
+ <scope>provided</scope>
+ <type>zip</type>
+ </dependency>
+ <dependency>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jbpm-jpdl</artifactId>
<version>${version}</version>
@@ -47,5 +53,31 @@
<version>${version}</version>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-cts</artifactId>
+ <type>zip</type>
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>src/test</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Property changes on: jbpm3/branches/tdiesler/modules/integration/src
___________________________________________________________________
Name: svn:ignore
+ test
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -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.integration.client;
+
+//$Id$
+
+import java.util.Set;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.Service;
+import org.jbpm.integration.service.MutableService;
+
+/**
+ * A process engine with public access
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessEngineImpl extends ProcessEngine
+{
+ public void setServices(Set<Service> services)
+ {
+ this.services = services;
+
+ // Set this engine on every mutable service
+ for (Service service : services)
+ {
+ if (service instanceof MutableService)
+ {
+ MutableService mutService = (MutableService)service;
+ mutService.setProcessEngine(this);
+ }
+ }
+ }
+}
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/client/ProcessEngineImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.runtime;
+
+//$Id$
+
+import org.jbpm.api.client.Token;
+
+/**
+ * An interceptor that invokes the Node.execute
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 07-Oct-2008
+ */
+public class NodeExecuteInterceptor implements NodeInterceptor
+{
+ @Override
+ public void execute(RuntimeContext rtContext)
+ {
+ Token token = rtContext.getToken();
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeExecuteInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.runtime;
+
+//$Id$
+
+/**
+ * A node interceptor
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 07-Oct-2008
+ */
+public interface NodeInterceptor
+{
+ void execute (RuntimeContext rtContext);
+}
\ No newline at end of file
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/NodeInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,68 @@
+/*
+ * 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.integration.runtime;
+
+//$Id$
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jbpm.api.client.Token;
+
+/**
+ * A runtime context that passes through a chain of interceptors.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 07-Oct-2008
+ */
+public class RuntimeContext
+{
+ private List<NodeInterceptor> interceptors = new ArrayList<NodeInterceptor>();
+ private int itorIndex;
+
+ private Token token;
+
+ public Token getToken()
+ {
+ return token;
+ }
+
+ public void setToken(Token token)
+ {
+ this.token = token;
+ this.itorIndex = 0;
+ }
+
+ void addInterceptor(NodeInterceptor itor)
+ {
+ interceptors.add(itor);
+ }
+
+ protected void next()
+ {
+ if (itorIndex < interceptors.size())
+ {
+ NodeInterceptor itor = interceptors.get(itorIndex++);
+ itor.execute(this);
+ }
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/runtime/RuntimeContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.service;
+
+// $Id$
+
+import java.net.URI;
+import java.util.Map;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.DialectHandler;
+import org.jbpm.api.service.DialectHandlerService;
+
+/**
+ * A registry that maps namespaceURI to a {@link DialectHandler}
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class DialectHandlerServiceImpl extends DialectHandlerService implements MutableService
+{
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ public void setDialectHandlers(Map<URI, DialectHandler> dialectHandlers)
+ {
+ this.dialectHandlers = dialectHandlers;
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/DialectHandlerServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.service;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.Service;
+
+/**
+ * A mutable service
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public interface MutableService extends Service
+{
+ void setProcessEngine(ProcessEngine engine);
+}
\ No newline at end of file
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/MutableService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,137 @@
+/*
+ * 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.integration.service;
+
+// $Id$
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.hibernate.Session;
+import org.jbpm.api.ProcessNotFoundException;
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Node;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.model.ProcessDefinition;
+import org.jbpm.api.service.PersistenceService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An in-memory persistence service.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 17-Sep-2008
+ */
+public class NoopPersistenceServiceImpl extends PersistenceService implements MutableService
+{
+ // Provide logging
+ final Logger log = LoggerFactory.getLogger(NoopPersistenceServiceImpl.class);
+
+ private Map<ObjectName, ProcessDefinition> procDefs = new HashMap<ObjectName, ProcessDefinition>();
+ private Map<ObjectName, Process> procs = new HashMap<ObjectName, Process>();
+ private Map<ObjectName, Node> nodes = new HashMap<ObjectName, Node>();
+
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ @Override
+ public Session createSession()
+ {
+ return null;
+ }
+
+ @Override
+ public ObjectName saveProcessDefinition(ProcessDefinition procDef)
+ {
+ procDefs.put(procDef.getKey(), procDef);
+ return procDef.getKey();
+ }
+
+ @Override
+ public ProcessDefinition loadProcessDefinition(ObjectName procDefID)
+ {
+ ProcessDefinition procDef = procDefs.get(procDefID);
+ if (procDef == null)
+ throw new ProcessNotFoundException("Cannot find process: " + procDefID);
+
+ return procDef;
+ }
+
+ @Override
+ public void deleteProcessDefinition(ProcessDefinition procDef)
+ {
+ procDefs.remove(procDef.getKey());
+ }
+
+ @Override
+ public ObjectName saveProcess(Process proc)
+ {
+ procs.put(proc.getKey(), proc);
+
+ for (Node node : proc.getNodes())
+ nodes.put(node.getKey(), node);
+
+ return proc.getKey();
+ }
+
+ @Override
+ public Process loadProcess(ObjectName procID)
+ {
+ Process proc = procs.get(procID);
+ if (proc == null)
+ throw new ProcessNotFoundException("Cannot find process: " + procID);
+
+ return proc;
+ }
+
+ @Override
+ public void deleteProcess(Process proc)
+ {
+ procs.remove(proc.getKey());
+
+ for (Node node : proc.getNodes())
+ nodes.remove(node.getKey());
+ }
+
+ @Override
+ public ObjectName saveNode(Session session, Node node)
+ {
+ return node.getKey();
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public <T extends Node> T loadNode(Session session, Class<T> nodeImpl, ObjectName nodeID)
+ {
+ T node = (T)nodes.get(nodeID);
+ if (node == null)
+ throw new ProcessNotFoundException("Cannot find node: " + nodeID);
+
+ return node;
+ }
+}
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/NoopPersistenceServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.service;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.model.Process;
+import org.jbpm.api.service.ProcessBuilderService;
+import org.jbpm.api.model.builder.ProcessBuilder;
+
+/**
+ * The ProcessBuilder can be used to build a {@link Process} dynamically.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessBuilderServiceImpl extends ProcessBuilderService implements MutableService
+{
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ @Override
+ public ProcessBuilder getProcessBuilder()
+ {
+ return null;
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessBuilderServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.service;
+
+// $Id$
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.ProcessDefinitionService;
+
+/**
+ * The ProcessDefinitionService is the entry point to create, find and otherwise manage process definitions.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessDefinitionServiceImpl extends ProcessDefinitionService implements MutableService
+{
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessDefinitionServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,86 @@
+/*
+ * 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.integration.service;
+
+// $Id$
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jbpm.api.client.ProcessEngine;
+import org.jbpm.api.service.ProcessInstanceService;
+import org.jbpm.integration.runtime.NodeInterceptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ProcessService is the entry point to create, find and otherwise manage processes.
+ *
+ * @author thomas.diesler at jboss.com
+ * @since 18-Jun-2008
+ */
+public class ProcessServiceImpl extends ProcessInstanceService implements MutableService
+{
+ // Provide logging
+ final static Logger log = LoggerFactory.getLogger(ProcessServiceImpl.class);
+
+ private List<NodeInterceptor> nodeInterceptors = new ArrayList<NodeInterceptor>();
+
+ @Override
+ public void setProcessEngine(ProcessEngine engine)
+ {
+ super.setProcessEngine(engine);
+ }
+
+ public void setInterceptors(List<String> itorClassNames)
+ {
+ for (String itorClass : itorClassNames)
+ {
+ NodeInterceptor itor = loadNodeInterceptor(itorClass);
+ nodeInterceptors.add(itor);
+ }
+ }
+
+ public List<NodeInterceptor> getNodeInterceptors()
+ {
+ return Collections.unmodifiableList(nodeInterceptors);
+ }
+
+ private NodeInterceptor loadNodeInterceptor(String className)
+ {
+ NodeInterceptor itor = null;
+ if (className != null)
+ {
+ try
+ {
+ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
+ itor = (NodeInterceptor)ctxLoader.loadClass(className).newInstance();
+ }
+ catch (Exception ex)
+ {
+ log.error("Cannot load interceptor: " + className, ex);
+ }
+ }
+ return itor;
+ }
+}
\ No newline at end of file
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/java/org/jbpm/integration/service/ProcessServiceImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-beans.xml
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-beans.xml 2008-11-14 17:51:14 UTC (rev 2936)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-beans.xml 2008-11-14 17:57:12 UTC (rev 2937)
@@ -1,29 +0,0 @@
-<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
- xmlns="urn:jboss:bean-deployer:2.0">
-
- <!-- The Kernel Locator -->
- <bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator"/>
-
- <!-- The process engine -->
- <bean name="jBPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
- <property name="processDefinitionManager"><inject bean="jBPMProcessDefinitionManager"/></property>
- <property name="processInstanceManager"><inject bean="jBPMProcessInstanceManager"/></property>
- <property name="executionManager"><inject bean="jBPMExecutionManager"/></property>
- </bean>
-
- <!-- The process definition manager -->
- <bean name="jBPMProcessDefinitionManager" class="org.jbpm.integration.client.ProcessDefinitionManagerImpl">
- <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
- </bean>
-
- <!-- The process instance manager -->
- <bean name="jBPMProcessInstanceManager" class="org.jbpm.integration.client.ProcessInstanceManagerImpl">
- <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
- </bean>
-
- <!-- The execution manager -->
- <bean name="jBPMExecutionManager" class="org.jbpm.integration.client.ExecutionManagerImpl">
- <property name="processEngine"><inject bean="jBPMProcessEngine" state="Instantiated"/></property>
- </bean>
-
-</deployment>
\ No newline at end of file
Added: jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-cfg-beans.xml
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-cfg-beans.xml (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-cfg-beans.xml 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1,45 @@
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- The KernelLocator -->
+ <bean name="KernelLocator" class="org.jboss.kernel.plugins.util.KernelLocator" />
+
+ <!-- The ProcessEngine -->
+ <bean name="jBPMProcessEngine" class="org.jbpm.integration.client.ProcessEngineImpl">
+ <property name="services">
+ <set elementClass="org.jbpm.api.service.Service">
+ <inject bean="jBPMDialectHandlerService" />
+ <inject bean="jBPMProcessBuilderService" />
+ <inject bean="jBPMProcessDefinitionService" />
+ <inject bean="jBPMProcessService" />
+ </set>
+ </property>
+ </bean>
+
+ <!-- The PersistenceService -->
+ <bean name="jBPMPersistenceService" class="org.jbpm.integration.service.NoopPersistenceServiceImpl"/>
+
+ <!-- The ProcessService -->
+ <bean name="jBPMProcessService" class="org.jbpm.integration.service.ProcessServiceImpl" >
+ <property name="interceptors">
+ <list elementClass="java.lang.String">
+ <value>org.jbpm.integration.runtime.NodeExecuteInterceptor</value>
+ </list>
+ </property>
+ </bean>
+
+ <!-- The DialectHandlerService -->
+ <bean name="jBPMDialectHandlerService" class="org.jbpm.integration.service.DialectHandlerServiceImpl" >
+ <property name="dialectHandlers">
+ <map keyClass="java.net.URI" valueClass="org.jbpm.api.service.DialectHandler">
+ <entry><key>urn:jbpm.jboss:api-0.1</key><value><inject bean="jBPMDialectHandlerAPI10"/></value></entry>
+ </map>
+ </property>
+ </bean>
+ <bean name="jBPMDialectHandlerAPI10" class="org.jbpm.dialect.api10.DialectHandlerImpl"/>
+
+ <!-- Other Services -->
+ <bean name="jBPMProcessBuilderService" class="org.jbpm.integration.service.ProcessBuilderServiceImpl" />
+ <bean name="jBPMProcessDefinitionService" class="org.jbpm.integration.service.ProcessDefinitionServiceImpl" />
+
+ </deployment>
Property changes on: jbpm3/branches/tdiesler/modules/integration/src/main/resources/jbpm-cfg-beans.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm3/branches/tdiesler/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider
===================================================================
--- jbpm3/branches/tdiesler/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider (rev 0)
+++ jbpm3/branches/tdiesler/modules/integration/src/main/resources/org.jbpm.api.client.ConfigurationProvider 2008-11-14 17:57:12 UTC (rev 2937)
@@ -0,0 +1 @@
+org.jbpm.api.client.internal.MicrocontainerConfigurationProvider
\ No newline at end of file
Modified: jbpm3/branches/tdiesler/pom.xml
===================================================================
--- jbpm3/branches/tdiesler/pom.xml 2008-11-14 17:51:14 UTC (rev 2936)
+++ jbpm3/branches/tdiesler/pom.xml 2008-11-14 17:57:12 UTC (rev 2937)
@@ -95,6 +95,12 @@
<version>${jbpm.api.version}</version>
</dependency>
<dependency>
+ <groupId>org.jbpm.jbpm4</groupId>
+ <artifactId>jbpm-spec-cts</artifactId>
+ <version>${jbpm.api.version}</version>
+ <type>zip</type>
+ </dependency>
+ <dependency>
<groupId>org.jbpm.jbpm3</groupId>
<artifactId>jsf-console</artifactId>
<version>${jbpm.jsf-console.version}</version>
More information about the jbpm-commits
mailing list