[jbpm-commits] JBoss JBPM SVN: r4271 - in jbpm4/trunk/modules: enterprise/src/test/java/org/jbpm/test and 16 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Mar 18 04:27:47 EDT 2009


Author: heiko.braun at jboss.com
Date: 2009-03-18 04:27:46 -0400 (Wed, 18 Mar 2009)
New Revision: 4271

Added:
   jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/classloading/
   jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/classloading/CustomClass.java
   jbpm4/trunk/modules/enterprise/src/test/resources/classloading/
   jbpm4/trunk/modules/enterprise/src/test/resources/classloading/META-INF/
   jbpm4/trunk/modules/enterprise/src/test/resources/classloading/META-INF/process.jpdl.xml
   jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/mgmt/
   jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/mgmt/ServerConfig.java
   jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/mgmt/
   jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/mgmt/ServerConfig.java
   jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/
   jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/AbstractServerConfig.java
   jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/AbstractServerConfigMBean.java
   jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfig.java
   jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfigFactory.java
   jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/util/ObjectNameFactory.java
Removed:
   jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm.deployer.cfg.xml
   jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/JBPMService.java
Modified:
   jbpm4/trunk/modules/enterprise/scripts/antrun-test-jars.xml
   jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestCase.java
   jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
   jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/JBPMDeployer.java
   jbpm4/trunk/modules/integration/jboss4/src/main/resources/jbpm.beans/META-INF/jboss-beans.xml
   jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm-service-jboss-beans.xml
   jbpm4/trunk/modules/integration/spi/src/main/resources/jboss-service.xml
Log:
Deployer exception handling. Classloading test stub. ServerConfig added

Modified: jbpm4/trunk/modules/enterprise/scripts/antrun-test-jars.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/scripts/antrun-test-jars.xml	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/enterprise/scripts/antrun-test-jars.xml	2009-03-18 08:27:46 UTC (rev 4271)
@@ -10,64 +10,76 @@
 
 <project>
 
-	<description>PVM test archive</description>
+  <description>PVM test archive</description>
 
-	<target name="build-jars" description="Build the test modules.">
+  <target name="build-jars" description="Build the test modules.">
 
-	  <mkdir dir="${build.dir}/test-libs"/>
+    <mkdir dir="${build.dir}/test-libs"/>
 
-		<war destfile="${build.dir}/test-libs/jbpm-enterprise-test.war"
+    <war destfile="${build.dir}/test-libs/jbpm-enterprise-test.war"
          webxml="${test.resources.dir}/command/WEB-INF/web.xml">
-			<webinf dir="${test.resources.dir}/command/WEB-INF">
-				<exclude name="web.xml" />
-			</webinf>
+      <webinf dir="${test.resources.dir}/command/WEB-INF">
+        <exclude name="web.xml" />
+      </webinf>
       <lib dir="${build.dir}/test-dependencies">
         <include name="aspectjrt*.jar"/>
         <include name="cactus*.jar"/>
         <include name="junit*.jar"/>
       </lib>
-		  <classes dir="${build.dir}/test-classes">
-		    <include name="org/jbpm/test/enterprise/*" />
-		    <include name="org/jbpm/enterprise/internal/ejb/*" />
-		  </classes>
-		</war>
+      <classes dir="${build.dir}/test-classes">
+        <include name="org/jbpm/test/enterprise/*" />
+        <include name="org/jbpm/enterprise/internal/ejb/*" />
+      </classes>
+    </war>
 
-	  <jar destfile="${build.dir}/test-libs/jbpm-enterprise-test.jar">
-	    <fileset dir="${build.dir}/test-classes">
-	      <include name="org/jbpm/enterprise/internal/custom/*" />
-	    </fileset>
-	  </jar>
+    <jar destfile="${build.dir}/test-libs/jbpm-enterprise-test.jar">
+      <fileset dir="${build.dir}/test-classes">
+        <include name="org/jbpm/enterprise/internal/custom/*" />
+      </fileset>
+    </jar>
 
-	  <ear destfile="${build.dir}/test-libs/jbpm-enterprise-test.ear"
+    <ear destfile="${build.dir}/test-libs/jbpm-enterprise-test.ear"
          appxml="${test.resources.dir}/command/META-INF/application.xml">
-	    <!-- build artifact -->
-			<fileset dir="${build.dir}" includes="${build.finalName}.jar" />
-	    <!-- test modules -->
-	    <fileset dir="${build.dir}/test-libs" includes="jbpm-enterprise-test.war" />
-	    <zipfileset dir="${build.dir}/test-libs" includes="jbpm-enterprise-test.jar" prefix="lib" />
-	   
-		</ear>
+      <!-- build artifact -->
+      <fileset dir="${build.dir}" includes="${build.finalName}.jar" />
+      <!-- test modules -->
+      <fileset dir="${build.dir}/test-libs" includes="jbpm-enterprise-test.war" />
+      <zipfileset dir="${build.dir}/test-libs" includes="jbpm-enterprise-test.jar" prefix="lib" />
 
-		<!-- Please add alphabetically -->
+    </ear>
 
+    <!-- Please add alphabetically -->
+
+    <!-- jbpm-classloading-test-->
+    <jar destfile="${build.dir}/test-libs/jbpm-classloading-test.jar">
+      <fileset dir="${build.dir}/test-classes">
+        <include name="org/jbpm/test/classloading/*" />
+      </fileset>
+      <fileset dir="${build.dir}/test-classes/classloading">
+        <include name="META-INF/*" />
+      </fileset>
+    </jar>
+
+
+    <!-- jbpm-deployer-test -->
     <jar destfile="${build.dir}/test-libs/jbpm-deployer-test.jar">
-	    <fileset dir="${build.dir}/test-classes">
-	      <include name="org/jbpm/test/deployer/*" />
-	    </fileset>
+      <fileset dir="${build.dir}/test-classes">
+        <include name="org/jbpm/test/deployer/*" />
+      </fileset>
       <fileset dir="${build.dir}/test-classes/deployer">
-	      <include name="META-INF/*" />
-	    </fileset>
+        <include name="META-INF/*" />
+      </fileset>
     </jar>
 
     <war destfile="${build.dir}/test-libs/jbpm-deployer-test.war"
          webxml="${test.resources.dir}/deployer/WEB-INF/web.xml">
-			<webinf dir="${test.resources.dir}/deployer/WEB-INF">
-				<exclude name="web.xml" />
-			</webinf>
-		  <classes dir="${build.dir}/test-classes">
-		    <include name="org/jbpm/test/deployer/DeployerTestServlet.class" />		    
-		  </classes>
-		</war>
+      <webinf dir="${test.resources.dir}/deployer/WEB-INF">
+        <exclude name="web.xml" />
+      </webinf>
+      <classes dir="${build.dir}/test-classes">
+        <include name="org/jbpm/test/deployer/DeployerTestServlet.class" />
+      </classes>
+    </war>
 
   </target>
 

Added: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/classloading/CustomClass.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/classloading/CustomClass.java	                        (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/classloading/CustomClass.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.test.classloading;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class CustomClass
+{
+  private String val = "World";
+
+  public String hello()
+	{
+    System.out.println("*** CustomClass: Hello " + val);
+    return val;
+	}
+}

Modified: jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestCase.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestCase.java	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/enterprise/src/test/java/org/jbpm/test/deployer/DeployerTestCase.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -49,6 +49,12 @@
 
   public void testDeploymentExists()
   {
+    if(testHelper.isTargetJBoss500() == false)
+    {
+      System.out.println("FIXME JBPM-2111: DeployerTestCase on AS 4.2.x");
+      return;
+    }
+    
     String response =
         HTTP.get("http://"+System.getProperty("jboss.bind.address")+":8080/jbpm-deployer-test", null);
 

Added: jbpm4/trunk/modules/enterprise/src/test/resources/classloading/META-INF/process.jpdl.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/src/test/resources/classloading/META-INF/process.jpdl.xml	                        (rev 0)
+++ jbpm4/trunk/modules/enterprise/src/test/resources/classloading/META-INF/process.jpdl.xml	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<process name="Classloading" xmlns="http://jbpm.org/4/jpdl">
+  <start name="start1" g="105,71,48,48">
+    <transition name="to invoke class" to="invoke class" g="-84,-18"/>
+  </start>
+
+  <java name="invoke class"
+        g="88,167,92,52"
+        class="org.jbpm.test.classloading.CustomClass"
+        method="hello"
+        var="answer">
+
+    <transition name="to state1" to="state1" g="-46,-18"/>
+  </java>
+
+  <state g="227,203,92,52" name="state1">
+      <transition g="-46,-18" name="first transition" to="end1"/>
+   </state>
+
+  <end name="end1" g="104,271,48,48"/>
+</process>
\ No newline at end of file

Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -147,7 +147,7 @@
   {
     if(ProcessInstanceRef.STATE.ENDED==nextState)
     {
-      // TODO: It's actually a delte call. Once we got the 'cancel' notion this should be changed
+      // TODO: It's actually a delete call. Once we got the 'cancel' notion this should be changed
       ExecutionService execService = this.processEngine.getExecutionService();
       Execution exec = execService.findExecution(executionId);
       if(null==exec)

Modified: jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/JBPMDeployer.java
===================================================================
--- jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/JBPMDeployer.java	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/JBPMDeployer.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -62,9 +62,7 @@
   public JBPMDeployer()
   {
     initializeMainDeployer();
-    this.adaptor = new DeploymentAdaptor();
-
-    System.out.println("Started JBPMDeployer");
+    this.adaptor = new DeploymentAdaptor();   
   }
 
   /**

Added: jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/mgmt/ServerConfig.java
===================================================================
--- jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/mgmt/ServerConfig.java	                        (rev 0)
+++ jbpm4/trunk/modules/integration/jboss4/src/main/java/org/jbpm/integration/jboss4/mgmt/ServerConfig.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss4.mgmt;
+
+import org.jbpm.integration.spi.mgmt.AbstractServerConfig;
+import org.jbpm.integration.util.MBeanServerLocator;
+
+import javax.management.MBeanServer;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ServerConfig extends AbstractServerConfig
+{
+
+  public String getImplementationTitle()
+  {
+    return getClass().getPackage().getImplementationTitle();
+  }
+
+  public String getImplementationVersion()
+  {
+    return getClass().getPackage().getImplementationVersion();
+  }
+
+  /**
+   * In AS 4 it's not provided by MC, hence we do the lookup
+   * @return
+   */
+  public MBeanServer getMbeanServer()
+  {
+    return new MBeanServerLocator().getMbeanServer(); 
+  }
+}
\ No newline at end of file

Modified: jbpm4/trunk/modules/integration/jboss4/src/main/resources/jbpm.beans/META-INF/jboss-beans.xml
===================================================================
--- jbpm4/trunk/modules/integration/jboss4/src/main/resources/jbpm.beans/META-INF/jboss-beans.xml	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/integration/jboss4/src/main/resources/jbpm.beans/META-INF/jboss-beans.xml	2009-03-18 08:27:46 UTC (rev 4271)
@@ -12,7 +12,19 @@
     </property>
   </bean>
 
+  <!--
+     JBPMService
+  -->
   <bean name="org.jbpm:service=ProcessEngine"
-        class="org.jbpm.integration.spi.JBPMServiceImpl"/>
+        class="org.jbpm.integration.spi.JBPMService">
+    <property name="serverConfig"><inject bean="org.jbpm:service=ServerConfig"/></property>
+  </bean>
 
+  <!--
+     ServerConfig
+  -->
+  <bean name="org.jbpm:service=ServerConfig"
+        class="org.jbpm.integration.jboss5.mgmt.ServerConfig">    
+  </bean>
+
 </deployment>
\ No newline at end of file

Added: jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/mgmt/ServerConfig.java
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/mgmt/ServerConfig.java	                        (rev 0)
+++ jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/mgmt/ServerConfig.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jboss5.mgmt;
+
+import org.jbpm.integration.spi.mgmt.AbstractServerConfig;
+
+/**
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class ServerConfig extends AbstractServerConfig
+{
+
+  public String getImplementationTitle()
+  {
+    return getClass().getPackage().getImplementationTitle();
+  }
+
+  public String getImplementationVersion()
+  {
+    return getClass().getPackage().getImplementationVersion();
+  }
+}

Modified: jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm-service-jboss-beans.xml
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm-service-jboss-beans.xml	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm-service-jboss-beans.xml	2009-03-18 08:27:46 UTC (rev 4271)
@@ -1,11 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <deployment xmlns="urn:jboss:bean-deployer:2.0">
-  
+
   <!--
      JBPM Service
   -->
   <bean name="org.jbpm:service=ProcessEngine"
-        class="org.jbpm.integration.spi.JBPMServiceImpl"/>
-  
+        class="org.jbpm.integration.spi.JBPMService">
+    <property name="serverConfig"><inject bean="org.jbpm:service=ServerConfig"/></property>
+  </bean>
+
+  <!--
+     ServerConfig
+  -->
+  <bean name="org.jbpm:service=ServerConfig"
+        class="org.jbpm.integration.jboss4.mgmt.ServerConfig">
+    <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+  </bean>
+
+
 </deployment>
\ No newline at end of file

Deleted: jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm.deployer.cfg.xml
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm.deployer.cfg.xml	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm.deployer.cfg.xml	2009-03-18 08:27:46 UTC (rev 4271)
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  jBPM4 deployer configuration.
-  The deployer deals with the transaction management on it's own.
-  (UserTransaction)
--->
-
-<jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
-
-  <process-engine-context>
-
-    <deployer-manager>
-      <assign-file-type>
-        <file extension=".jpdl.xml" type="jpdl" />
-      </assign-file-type>
-      <parse-jpdl />
-      <check-process /> <!--Covered by VersionTimestampPolicy -->
-      <check-problems />
-      <save policy="org.jbpm.pvm.internal.wire.binding.VersionTimestampPolicy"/>
-    </deployer-manager>
-
-    <process-service />
-    <execution-service />
-    <management-service />
-
-    <command-service>
-      <retry-interceptor />
-      <environment-interceptor />
-    </command-service>
-
-    <hibernate-configuration resource="hibernate.cfg.xml"/>
-
-    <hibernate-session-factory />
-
-    <id-generator />
-    <types resource="jbpm.pvm.types.xml" />
-
-    <business-calendar>
-      <monday    hours="9:00-12:00 and 12:30-17:00"/>
-      <tuesday   hours="9:00-12:00 and 12:30-17:00"/>
-      <wednesday hours="9:00-12:00 and 12:30-17:00"/>
-      <thursday  hours="9:00-12:00 and 12:30-17:00"/>
-      <friday    hours="9:00-12:00 and 12:30-17:00"/>
-      <holiday period="01/07/2008 - 31/08/2008"/>
-    </business-calendar>
-
-  </process-engine-context>
-
-  <transaction-context>
-    <hibernate-session current="true"/>    
-    <pvm-db-session />
-    <job-db-session />
-    <ejb-timer-session />
-  </transaction-context>
-
-</jbpm-configuration>

Deleted: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/JBPMService.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/JBPMService.java	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/JBPMService.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.spi;
-
-import org.jbpm.ProcessEngine;
-
-/**
- * A JBPM service implementation that will be installed into the AS kernel.
- *
- * @author Heiko.Braun <heiko.braun at jboss.com>
- */
-public interface JBPMService
-{  
-  void start();
-  void stop();
-
-  ProcessEngine getProcessEngine();
-}

Added: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/AbstractServerConfig.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/AbstractServerConfig.java	                        (rev 0)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/AbstractServerConfig.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.mgmt;
+
+import org.jboss.logging.Logger;
+import org.jbpm.integration.util.ObjectNameFactory;
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import java.io.File;
+
+/**
+ * Basic implementation of a ServerConfig.
+ * Concrete implementations reside with the container integration impl.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @author darran.lofthouse at jboss.com
+ * @author Heiko.Braun at jboss.com
+ * 
+ * @since 08-May-2006
+ */
+public abstract class AbstractServerConfig implements AbstractServerConfigMBean
+{
+  private static final Logger log = Logger.getLogger(AbstractServerConfig.class);
+
+  // The MBeanServer
+  private MBeanServer mbeanServer;
+  
+  public MBeanServer getMbeanServer()
+  {
+    return mbeanServer;
+  }
+
+  public void setMbeanServer(MBeanServer mbeanServer)
+  {
+    this.mbeanServer = mbeanServer;
+  }
+
+  public abstract String getImplementationTitle();
+
+  public abstract String getImplementationVersion();
+
+  public File getServerTempDir()
+  {
+    try
+    {
+      ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+      File dir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
+      return dir;
+    }
+    catch (JMException e)
+    {
+      return null;
+    }
+  }
+
+  public File getHomeDir()
+  {
+    try
+    {
+      ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+      File dir = (File)getMbeanServer().getAttribute(oname, "HomeDir");
+      return dir;
+    }
+    catch (JMException e)
+    {
+      return null;
+    }
+  }
+
+  public File getServerDataDir()
+  {
+    try
+    {
+      ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+      File dir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
+      return dir;
+    }
+    catch (JMException e)
+    {
+      return null;
+    }
+  }  
+
+  public void create() throws Exception
+  {
+    getMbeanServer().registerMBean(this, AbstractServerConfigMBean.OBJECT_NAME);
+  }
+
+  public void destroy() throws Exception
+  {
+    getMbeanServer().unregisterMBean(AbstractServerConfigMBean.OBJECT_NAME);
+  }
+}
\ No newline at end of file

Added: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/AbstractServerConfigMBean.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/AbstractServerConfigMBean.java	                        (rev 0)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/AbstractServerConfigMBean.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.mgmt;
+
+import javax.management.ObjectName;
+
+import org.jbpm.integration.util.ObjectNameFactory;
+
+public interface AbstractServerConfigMBean extends ServerConfig
+{
+   /** The object name in the MBean server */
+   ObjectName OBJECT_NAME = ObjectNameFactory.create("org.jbpm:service=ServerConfig");
+}

Added: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfig.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfig.java	                        (rev 0)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfig.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.mgmt;
+
+import java.io.File;
+
+/**
+ * Interface to container independent config
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public interface ServerConfig
+{
+  /** The default bean name */
+  String BEAN_NAME = "org.jbpm:service=ServerConfig";
+  
+  String getImplementationTitle();
+
+  String getImplementationVersion();
+
+  File getHomeDir();
+
+  File getServerTempDir();
+
+  File getServerDataDir(); 
+}
\ No newline at end of file

Added: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfigFactory.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfigFactory.java	                        (rev 0)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/spi/mgmt/ServerConfigFactory.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.mgmt;
+
+import org.jbpm.integration.util.KernelAwareSPIFactory;
+
+/**
+ * Factory to container independent config
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @author Heiko.Braun at jboss.com
+ * 
+ * @since 08-May-2006
+ */
+public class ServerConfigFactory
+{
+   public static ServerConfig getServerConfig()
+   {
+     return new KernelAwareSPIFactory().getKernelProvidedSPI(
+       ServerConfig.BEAN_NAME, ServerConfig.class  
+     );
+   }
+}
\ No newline at end of file

Added: jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/util/ObjectNameFactory.java
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/util/ObjectNameFactory.java	                        (rev 0)
+++ jbpm4/trunk/modules/integration/spi/src/main/java/org/jbpm/integration/util/ObjectNameFactory.java	2009-03-18 08:27:46 UTC (rev 4271)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.util;
+
+import java.util.Hashtable;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+/**
+ * A simple factory for creating safe object names.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public class ObjectNameFactory
+{
+  public static ObjectName create(String name)
+  {
+    try
+    {
+      return new ObjectName(name);
+    }
+    catch (MalformedObjectNameException e)
+    {
+      throw new Error("Invalid ObjectName: " + name + "; " + e);
+    }
+  }
+
+  public static ObjectName create(String domain, String key, String value)
+  {
+    try
+    {
+      return new ObjectName(domain, key, value);
+    }
+    catch (MalformedObjectNameException e)
+    {
+      throw new Error("Invalid ObjectName: " + domain + "," + key + "," + value + "; " + e);
+    }
+  }
+
+  public static ObjectName create(String domain, Hashtable table)
+  {
+    try
+    {
+      return new ObjectName(domain, table);
+    }
+    catch (MalformedObjectNameException e)
+    {
+      throw new Error("Invalid ObjectName: " + domain + "," + table + "; " + e);
+    }
+  }
+}

Modified: jbpm4/trunk/modules/integration/spi/src/main/resources/jboss-service.xml
===================================================================
--- jbpm4/trunk/modules/integration/spi/src/main/resources/jboss-service.xml	2009-03-18 08:26:36 UTC (rev 4270)
+++ jbpm4/trunk/modules/integration/spi/src/main/resources/jboss-service.xml	2009-03-18 08:27:46 UTC (rev 4271)
@@ -4,7 +4,7 @@
       a Configuration capable of dynamically updating the
       config settings
   -->
-  <mbean code="org.jboss.security.auth.login.DynamicLoginConfig" name="org.jboss.jbpm:service=LoginConfig">
+  <mbean code="org.jboss.security.auth.login.DynamicLoginConfig" name="org.jbpm:service=LoginConfig">
     <attribute name="PolicyConfig" serialDataType="jbxb">
       <jaas:policy xsi:schemaLocation="urn:jboss:security-config:4.1 resource:security-config_4_1.xsd" xmlns:jaas="urn:jboss:security-config:4.1"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">




More information about the jbpm-commits mailing list