[jboss-svn-commits] JBL Code SVN: r8302 - in labs/jbossesb/trunk/product: core/listeners core/listeners/src core/listeners/src/org/jboss/soa/esb/listeners/config core/listeners/tests/src/org/jboss/soa/esb/listeners/config install install/conf

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Dec 13 15:03:45 EST 2006


Author: kurt.stam at jboss.com
Date: 2006-12-13 15:03:42 -0500 (Wed, 13 Dec 2006)
New Revision: 8302

Added:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java
   labs/jbossesb/trunk/product/install/conf/jbossesb.xml
Modified:
   labs/jbossesb/trunk/product/core/listeners/build.xml
   labs/jbossesb/trunk/product/core/listeners/src/jboss-service.xml
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
   labs/jbossesb/trunk/product/install/build.xml
Log:
Adding ConfigurationController Service.

Modified: labs/jbossesb/trunk/product/core/listeners/build.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/build.xml	2006-12-13 19:59:34 UTC (rev 8301)
+++ labs/jbossesb/trunk/product/core/listeners/build.xml	2006-12-13 20:03:42 UTC (rev 8302)
@@ -42,8 +42,25 @@
 	
 	<target name="purge" depends="clean">
 	</target>
+	
+	<target name="generate-config-model">
+			<taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="xbeans-classpath" />
+		    <property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
+			
+			<delete dir="${gendir}" /><mkdir dir="${gendir}" />
+			
+			<xmlbean schema="${org.jboss.esb.root.dir}/etc/schemas/xml/jbossesb.xsd" 
+				classgendir="${gendir}/classes" srcgendir="${gendir}/src"
+				
+				destfile="${org.jboss.esb.listeners.distrib.dir}/lib/jbossesb-config-model.jar" classpathref="xbeans-classpath"/>
+		</target>
 
-    <target name="org.jboss.esb.listeners.compile">
+		<path id="xbeans-classpath">
+			<fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar" />
+		</path>
+		
+
+    <target name="org.jboss.esb.listeners.compile" depends="generate-config-model">
         <!-- Compile listeners -->
         <antcall target="org.jboss.esb.listeners.internal.compile"/>
         <!-- Compile listener tests -->
@@ -72,7 +89,7 @@
         <jar    destfile="${org.jboss.esb.listeners.distrib.dir}/lib/${org.jboss.esb.listeners.jar.name}.jar" 
                 basedir="${org.jboss.esb.listeners.classes.dir}" 
                 includes="**/*.class"
-		excludes="test/**"
+		        excludes="test/**"
                 />
     </target>
 	
@@ -99,22 +116,6 @@
 			commons-jci-core-1.0-406301.jar,commons-jci-eclipse-3.2.0.666.jar"/></copy>
 	</target>
 	
-	<target name="generate-config-model">
-		<taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="xbeans-classpath" />
-	    <property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
-		
-		<delete dir="${gendir}" /><mkdir dir="${gendir}" />
-		
-		<xmlbean schema="${org.jboss.esb.root.dir}/etc/schemas/xml/jbossesb.xsd" 
-			classgendir="${gendir}/classes" srcgendir="${gendir}/src"
-			
-			destfile="${gendir}/jbosesb-config-model.jar" classpathref="xbeans-classpath"/>
-	</target>
-
-	<path id="xbeans-classpath">
-		<fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar" />
-	</path>
-	
     <target name="org.jboss.esb.listeners.test" description="Run tests for this module">
         <!-- Compile listener tests -->
         <ant dir="tests" target="org.jboss.esb.listeners.internal.test"/>

Modified: labs/jbossesb/trunk/product/core/listeners/src/jboss-service.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/jboss-service.xml	2006-12-13 19:59:34 UTC (rev 8301)
+++ labs/jbossesb/trunk/product/core/listeners/src/jboss-service.xml	2006-12-13 20:03:42 UTC (rev 8302)
@@ -2,6 +2,12 @@
 
 <server>
   <!--  Starts the listener controler -->
+  <mbean code="org.jboss.soa.esb.listeners.config.ConfigurationControllerService" 
+  	     name="jboss.org:service=ConfigurationController"
+  	     description="Configuration controller which generated the config files for the listener and gateway controllers">
+    <attribute name="ConfigurationFile">jbossesb.xml</attribute>
+  </mbean>
+  <!--  Starts the listener controler -->
   <mbean code="org.jboss.soa.esb.listeners.message.EsbListenerControllerService" 
   	     name="jboss.org:service=EsbListenerController"
   	     description="ESB Aware Listener">

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java	2006-12-13 19:59:34 UTC (rev 8301)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java	2006-12-13 20:03:42 UTC (rev 8302)
@@ -110,18 +110,11 @@
 		mLogger.info("Exiting Config Controller...");
 	}
 	/**
-	 * Getter. Returns true if the end is requested.
-	 * @return true if the end is requested.
-	 */
-	public boolean isEndRequested() {
-		return mIsEndRequested;
-	}
-	/**
 	 * Setter, to request the end of processing.
 	 * @param isEndRequested
 	 */
-	public void setEndRequested(boolean isEndRequested) {
-		this.mIsEndRequested = isEndRequested;
+	public void requestEnd() {
+		mIsEndRequested = true;
 	}
 	/**
 	 * Check the file timestamp and return true when it changes. In other

Added: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java	2006-12-13 19:59:34 UTC (rev 8301)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java	2006-12-13 20:03:42 UTC (rev 8302)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.soa.esb.listeners.config;
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+import org.jboss.system.ServiceMBeanSupport;
+/**
+ * Service to manage the configurationController when deployed to the appserver.
+ * 
+ * @author Kurt Stam
+ *
+ */
+public class ConfigurationControllerService extends ServiceMBeanSupport implements ConfigurationControllerServiceMBean
+{
+	private ConfigurationController	configurationController;
+	private Logger logger = Logger.getLogger(this.getClass());
+	private String configurationFile="jbossesb.xml";
+	/**
+	 * Starts the gateways.
+	 */
+	protected void startService() throws Exception 
+	{
+		logger.info("starting message configuration controller with config file " + configurationFile);
+		String confDir = System.getProperty("jboss.server.config.url");
+		URI uri = new URI(confDir);
+		confDir = uri.getPath();
+		String configFile = confDir + configurationFile;
+		configurationController = new ConfigurationController(configFile);
+		new Thread(configurationController).start();
+	}
+	/**
+	 * Stops the gateways.
+	 */
+	protected void stopService() throws Exception 
+	{
+		logger.info("shutting down message aware listener...");
+		configurationController.requestEnd();
+	}
+	/**
+	 * Gets the config file. The name of the file can be set in the jboss-service.xml.
+	 */
+	public String getConfigurationFile() {
+		return configurationFile;
+	}
+	/**
+	 * Sets the config file.
+	 */
+	public void setConfigurationFile(String configurationFile) {
+		this.configurationFile = configurationFile;
+	}
+	
+}

Added: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java	2006-12-13 19:59:34 UTC (rev 8301)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java	2006-12-13 20:03:42 UTC (rev 8302)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.soa.esb.listeners.config;
+
+import org.jboss.system.ServiceMBean;
+/**
+ * 
+ * @author Kurt Stam
+ *
+ */
+public interface ConfigurationControllerServiceMBean extends ServiceMBean
+{
+   // Configure getters and setters for the configFile attribute
+   String getConfigurationFile();
+   void setConfigurationFile(String ConfigurationFile);
+}

Modified: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java	2006-12-13 19:59:34 UTC (rev 8301)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java	2006-12-13 20:03:42 UTC (rev 8302)
@@ -47,7 +47,7 @@
 		Thread controller = new Thread(configurationController);
 		controller.start();
 		Thread.sleep(4000);
-		configurationController.setEndRequested(true);
+		configurationController.requestEnd();
 	}
 	
 	public static junit.framework.Test suite() {

Modified: labs/jbossesb/trunk/product/install/build.xml
===================================================================
--- labs/jbossesb/trunk/product/install/build.xml	2006-12-13 19:59:34 UTC (rev 8301)
+++ labs/jbossesb/trunk/product/install/build.xml	2006-12-13 20:03:42 UTC (rev 8302)
@@ -14,7 +14,9 @@
 		<!-- conf -->
 		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb-properties.xml" overwrite="true"
 				       todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/conf" />
-		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb-gateway.xml" overwrite="true"
+		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb.xml" overwrite="true"
+					   todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/conf" />
+		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb.xml" overwrite="true"
 		       todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/conf" />
 		<copy  file="${org.jboss.esb.deployment.conf}/jbossesb-listener.xml" overwrite="true"
 			   todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/conf" />

Added: labs/jbossesb/trunk/product/install/conf/jbossesb.xml
===================================================================
--- labs/jbossesb/trunk/product/install/conf/jbossesb.xml	2006-12-13 19:59:34 UTC (rev 8301)
+++ labs/jbossesb/trunk/product/install/conf/jbossesb.xml	2006-12-13 20:03:42 UTC (rev 8302)
@@ -0,0 +1,4 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://www.jboss.org/soa/esb/listeners/config">
+
+</jbossesb>
\ No newline at end of file




More information about the jboss-svn-commits mailing list