Title: [868] branches/servicemix-2.0/trunk/tooling/jboss-deployer: SM-196 : updage jboss-deployer

Diff

Deleted: branches/servicemix-2.0/trunk/tooling/jboss-deployer/.cvsignore (867 => 868)

--- branches/servicemix-2.0/trunk/tooling/jboss-deployer/.cvsignore	2005-11-18 14:17:45 UTC (rev 867)
+++ branches/servicemix-2.0/trunk/tooling/jboss-deployer/.cvsignore	2005-11-18 15:18:25 UTC (rev 868)
@@ -1,3 +0,0 @@
-target
-.classpath
-.project

Modified: branches/servicemix-2.0/trunk/tooling/jboss-deployer/project.properties (867 => 868)

--- branches/servicemix-2.0/trunk/tooling/jboss-deployer/project.properties	2005-11-18 14:17:45 UTC (rev 867)
+++ branches/servicemix-2.0/trunk/tooling/jboss-deployer/project.properties	2005-11-18 15:18:25 UTC (rev 868)
@@ -26,4 +26,5 @@
 
 maven.javadoc.links=http://java.sun.com/j2se/1.4.1/docs/api/,http://java.sun.com/j2ee/1.4/docs/api/ 
 maven.javadoc.source=1.4
-maven.javadoc.additionalparam = -linksource
\ No newline at end of file
+maven.javadoc.additionalparam = -linksource
+

Modified: branches/servicemix-2.0/trunk/tooling/jboss-deployer/project.xml (867 => 868)

--- branches/servicemix-2.0/trunk/tooling/jboss-deployer/project.xml	2005-11-18 14:17:45 UTC (rev 867)
+++ branches/servicemix-2.0/trunk/tooling/jboss-deployer/project.xml	2005-11-18 15:18:25 UTC (rev 868)
@@ -2,20 +2,11 @@
 
 <project>
 	<pomVersion>3</pomVersion>
+  <extend>${basedir}/../../etc/project.xml</extend>
+  
 	<name>ServiceMix JBoss Deployer</name>
 	<id>jboss-deployer</id>
-	<groupId>servicemix</groupId>
-	<currentVersion>1.0</currentVersion>
 
-	<organization>
-		<name>ServiceMix.</name>
-		<url>http://www.servicemix.co.com</url>
-		<logo>
-			http://www.logicblaze.com/images/logos/products/ServiceMix/ServiceMix_logo_150.jpg
-		</logo>
-	</organization>
-	<logo></logo>
-
 	<inceptionYear>2005</inceptionYear>
 
 	<shortDescription>
@@ -40,14 +31,6 @@
 	<contributors></contributors>
 
 	<dependencies>
-		<dependency>
-			<groupId>servicemix</groupId>
-			<artifactId>servicemix</artifactId>
-			<version>1.0</version>
-			<properties>
-				<sar.bundle>true</sar.bundle>
-			</properties>
-		</dependency>
 
 		<!--  JBoss 4.0.2 libs -->
 		<dependency>
@@ -66,10 +49,28 @@
 			<version>4.0.2</version>
 		</dependency>
 
+		<!-- JCA container and transaction manaqer -->
+		<dependency>
+			<id>jencks+all</id>
+			<version>${jencks_version}</version>
+			<properties>
+				<lib>true</lib>
+				<sar.bundle>true</sar.bundle>
+			</properties>
+		</dependency>
+
 		<!--  Required to support XDoclet gen -->
 		<dependency>
 			<id>xjavadoc</id>
 			<groupId>xdoclet</groupId>
+			<artifactId>maven-xdoclet-plugin</artifactId>
+			<version>1.2</version>
+			<type>plugin</type>
+			<url>http://xdoclet.sf.net</url>
+		</dependency>
+		<dependency>
+			<id>xjavadoc</id>
+			<groupId>xdoclet</groupId>
 			<artifactId>xjavadoc</artifactId>
 			<version>1.0.3</version>
 			<type>jar</type>
@@ -93,126 +94,93 @@
 
 		<!--  Pulled over from ServiceMix  -->
 		<dependency>
-			<groupId>mx4j</groupId>
-			<artifactId>mx4j</artifactId>
-			<version>2.1.1</version>
+			<id>servicemix+jbi</id>
+			<version>${pom.currentVersion}</version>
+			<properties>
+				<sar.bundle>true</sar.bundle>
+			</properties>
 		</dependency>
-		<dependency>
-			<groupId>mx4j</groupId>
-			<artifactId>mx4j-jmx</artifactId>
-			<version>2.1.1</version>
-		</dependency>
 
 		<dependency>
-			<groupId>mx4j</groupId>
-			<artifactId>mx4j-remote</artifactId>
-			<version>2.1.1</version>
+			<id>servicemix+core</id>
+			<version>${pom.currentVersion}</version>
+			<properties>
+				<sar.bundle>true</sar.bundle>
+			</properties>
 		</dependency>
 
 		<dependency>
-			<groupId>mx4j</groupId>
-			<artifactId>mx4j-tools</artifactId>
-			<version>2.1.1</version>
+			<id>concurrent</id>
+			<version>${concurrent_version}</version>
+			<properties>
+				<lib>true</lib>
+				<sar.bundle>true</sar.bundle>
+			</properties>
 		</dependency>
 
 		<dependency>
-			<groupId>mx4j</groupId>
-			<artifactId>mx4j-impl</artifactId>
-			<version>2.1.1</version>
-		</dependency>
-
-		<dependency>
-			<id>jencks+all</id>
-			<version>1.0-M1</version>
+			<id>backport-util-concurrent</id>
+			<version>${backport_util_concurrent_version}</version>
 			<properties>
 				<lib>true</lib>
 				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
 
-		<!--For remote management tasks-->
-
 		<dependency>
-			<id>ant</id>
-			<version>1.6</version>
+			<id>wsdl4j</id>
+			<version>${wsdl4j_version}</version>
+			<properties>
+				<optional>true</optional>
+				<sar.bundle>true</sar.bundle>
+			</properties>
 		</dependency>
 
 		<dependency>
-			<groupId>commons-logging</groupId>
-			<artifactId>commons-logging</artifactId>
-			<version>1.0.3</version>
-			<url>http://jakarta.apache.org/commons/logging/</url>
-		</dependency>
-
-		<dependency>
-			<id>concurrent</id>
-			<version>1.3.4</version>
-		</dependency>
-
-		<dependency>
 			<id>commons-beanutils</id>
-			<version>1.7.0</version>
+			<version>${commons_beanutils_version}</version>
 			<properties>
+				<lib>true</lib>
 				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
 
-
-		<!-- for DOM, SAX, StAX and XPath support -->
-
 		<dependency>
-			<groupId>servicemix</groupId>
-			<artifactId>jaxp</artifactId>
-			<version>1.3</version>
+			<id>xml-apis</id>
+			<version>${xml_apis_version}</version>
 			<properties>
+				<lib>true</lib>
 				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
 
 		<dependency>
 			<id>stax+api</id>
-			<version>1.0</version>
+			<version>${stax_api_version}</version>
 			<properties>
+				<lib>true</lib>
 				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
 
-		<!-- possible StAX implementations: START -->
-
-		<!-- fast implementation of StAX -->
 		<dependency>
-			<groupId>woodstox</groupId>
-			<artifactId>wstx-asl</artifactId>
-			<version>2.0</version>
+			<id>jaxen</id>
+			<version>${jaxen_version}</version>
 			<properties>
+				<optional>true</optional>
 				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
 
-
+		<!-- for spring integration -->
 		<dependency>
-			<groupId>xerces</groupId>
-			<artifactId>xercesImpl</artifactId>
-			<version>2.6.2</version>
-		</dependency>
-		<dependency>
-			<groupId>xerces</groupId>
-			<artifactId>xmlParserAPIs</artifactId>
-			<version>2.6.2</version>
-		</dependency>
-
-		<!-- mostly included for some DOM/SAX tools we could maybe replace with JAXP versions -->
-		<dependency>
-			<id>xalan</id>
-			<version>2.6.0</version>
-		</dependency>
-
-		<dependency>
-			<groupId>servicemix</groupId>
+			<groupId>springframework</groupId>
 			<artifactId>spring</artifactId>
-			<version>1.2.2-dev-2</version>
+			<version>${spring_version}</version>
 			<properties>
+				<lib>true</lib>
 				<sar.bundle>true</sar.bundle>
+				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
 
@@ -220,38 +188,60 @@
 		<!-- utility library for adapting StAX to SAX and JAXP Source -->
 		<dependency>
 			<id>stax-utils</id>
-			<version>snapshot-20040917</version>
+			<version>${stax_utils_version}</version>
 			<properties>
-				<sar.bundle>true</sar.bundle>
+				<lib>true</lib>
 			</properties>
 		</dependency>
 
+		<!--  for custom XML parsing -->
 		<dependency>
-			<id>activemq</id>
-			<version>3.1-M6</version>
+			<groupId>org.xbean</groupId>
+			<artifactId>xbean-spring</artifactId>
+			<version>${xbean_version}</version>
+			<url>http://www.xbean.org</url>
 			<properties>
 				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
+		<dependency>
+			<groupId>annogen</groupId>
+			<artifactId>annogen</artifactId>
+			<version>${annogen_version}</version>
+		</dependency>
+		<dependency>
+			<groupId>qdox</groupId>
+			<artifactId>qdox</artifactId>
+			<version>${qdox_version}</version>
+		</dependency>
 
-		<!-- JCA container -->
+		<!--  for ActiveMQ 3.x -->
 		<dependency>
-			<id>activemq+container</id>
-			<version>3.1-M6</version>
+			<id>activemq</id>
+			<version>${activemq_version}</version>
 			<properties>
+				<lib>true</lib>
 				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
-
-		<!-- JCA RA for testing -->
 		<dependency>
 			<id>activemq+ra</id>
-			<version>3.1-M6</version>
+			<version>${activemq_version}</version>
 			<properties>
+				<lib>true</lib>
 				<sar.bundle>true</sar.bundle>
 			</properties>
 		</dependency>
 
+		<!-- For clustering services -->
+		<dependency>
+			<id>activecluster</id>
+			<version>${activecluster_version}</version>
+			<properties>
+				<optional>true</optional>
+				<sar.bundle>true</sar.bundle>
+			</properties>
+		</dependency>
 	</dependencies>
 
 	<build>

Added: branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/examples/filebinding-sm.xml (867 => 868)

--- branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/examples/filebinding-sm.xml	2005-11-18 14:17:45 UTC (rev 867)
+++ branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/examples/filebinding-sm.xml	2005-11-18 15:18:25 UTC (rev 868)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://xbean.org/schemas/spring/1.0"
+	xmlns:spring="http://xbean.org/schemas/spring/1.0"
+	xmlns:sm="http://servicemix.org/config/1.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"	
+	xmlns:foo="http://servicemix.org/demo/">
+
+	<!-- the JBI container -->
+	<sm:container id="jbi" useMBeanServer="false"
+		createMBeanServer="false" dumpStats="true" statsInterval="10">
+
+		<sm:activationSpecs>
+
+			<!-- Write files to the outbox directory -->
+			<sm:activationSpec componentName="fileSender"
+				service="foo:fileSender">
+				<sm:component>
+					<bean xmlns="http://xbean.org/schemas/spring/1.0"
+						class="org.servicemix.components.file.FileWriter">
+						<property name="directory" value="outbox" />
+						<property name="marshaler">
+							<bean
+								class="org.servicemix.components.util.DefaultFileMarshaler">
+								<property name="fileName">
+									<bean
+										class="org.servicemix._expression_.JaxenStringXPathExpression">
+										<constructor-arg
+											value="concat('sample_', /sample/@id, '.xml')" />
+									</bean>
+								</property>
+							</bean>
+						</property>
+					</bean>
+				</sm:component>
+			</sm:activationSpec>
+
+			<!-- Look for files in the inbox directory -->
+			<sm:activationSpec componentName="filePoller"
+				destinationService="foo:fileSender" service="foo:filePoller">
+				<sm:component>
+					<bean xmlns="http://xbean.org/schemas/spring/1.0"
+						class="org.servicemix.components.file.FilePoller">
+						<property name="workManager" ref="workManager" />
+						<property name="file" value="inbox" />
+						<property name="period" value="1000" />
+					</bean>
+				</sm:component>
+			</sm:activationSpec>
+		</sm:activationSpecs>
+	</sm:container>
+
+	<!-- the work manager (thread pool) for this container -->
+	<bean id="workManager"
+		class="org.jencks.factory.WorkManagerFactoryBean">
+		<property name="threadPoolSize" value="30" />
+	</bean>
+
+</beans>
+

Modified: branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/main/java/org/servicemix/jboss/deployment/JBIDeployer.java (867 => 868)

--- branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/main/java/org/servicemix/jboss/deployment/JBIDeployer.java	2005-11-18 14:17:45 UTC (rev 867)
+++ branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/main/java/org/servicemix/jboss/deployment/JBIDeployer.java	2005-11-18 15:18:25 UTC (rev 868)
@@ -60,7 +60,7 @@
 
 		boolean accepts = false;
 		if (urlStr.endsWith(".jar") || urlStr.endsWith(".zip")) {
-			// However the jar/zip must also contain an META-INF/jbi.xml			
+			// However the jar/zip must also contain an META-INF/jbi.xml
 			try {
 				URL dd = di.localCl.findResource("META-INF/jbi.xml");
 				if (dd != null) {
@@ -73,7 +73,7 @@
 			// If is ends with -sm.xml then we just accept it
 			accepts = true;
 		}
-		
+
 		return accepts;
 	}
 
@@ -89,7 +89,7 @@
 	public void create(DeploymentInfo di) throws DeploymentException {
 		try {
 			String urlStr = di.url.getFile();
-			
+
 			if (jbiContainerMBean == null) {
 				throw new DeploymentException(
 						"The ServiceMix JBI container is not defined in Deployer");
@@ -106,7 +106,7 @@
 						new Object[] { di.url.toExternalForm() },
 						new String[] { "java.lang.String" });
 			}
-			
+
 		} catch (Exception e) {
 			throw new DeploymentException(
 					"ServiceMix deployer unable to deploy: " + di, e);
@@ -127,7 +127,29 @@
 	 * @jmx.managed-operation
 	 */
 	public void destroy(DeploymentInfo di) {
+		try {
+			String urlStr = di.url.getFile();
 
+			if (jbiContainerMBean == null) {
+				throw new DeploymentException(
+						"The ServiceMix JBI container is not defined in Deployer");
+			}
+			log
+					.info("ServiceMix deployer passing deployment to JBI container ["
+							+ di.url.toExternalForm() + "]");
+			if (urlStr.endsWith(".jar") || urlStr.endsWith(".zip")) {
+				getServer().invoke(jbiContainerMBean, "uninstallArchive",
+						new Object[] { di.url.toExternalForm() },
+						new String[] { "java.lang.String" });
+			} else {
+				getServer().invoke(jbiContainerMBean, "uninstallServiceMixXml",
+						new Object[] { di.url.toExternalForm() },
+						new String[] { "java.lang.String" });
+			}
+		} catch (Exception e) {
+			log.error("Unable to destroy deployment [" + di.getCanonicalName()
+					+ "]");
+		}
 	}
 
 	/**

Modified: branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/main/java/org/servicemix/jboss/deployment/JBIService.java (867 => 868)

--- branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/main/java/org/servicemix/jboss/deployment/JBIService.java	2005-11-18 14:17:45 UTC (rev 867)
+++ branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/main/java/org/servicemix/jboss/deployment/JBIService.java	2005-11-18 15:18:25 UTC (rev 868)
@@ -18,14 +18,19 @@
 package org.servicemix.jboss.deployment;
 
 import java.io.File;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import javax.jbi.JBIException;
 import javax.jbi.management.DeploymentException;
 import javax.naming.InitialContext;
 
 import org.jboss.system.ServiceMBeanSupport;
+import org.servicemix.jbi.config.spring.XBeanProcessor;
 import org.servicemix.jbi.container.JBIContainer;
-import org.springframework.context.support.FileSystemXmlApplicationContext;
+import org.xbean.spring.context.ClassPathXmlApplicationContext;
 
 /**
  * This is the deployer that handles picking up and deploying a JBI package out
@@ -43,6 +48,8 @@
 
 	private String transactionManager = "java:/TransactionManager";
 
+	private Map containerMap = new HashMap();
+
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -115,6 +122,24 @@
 	}
 
 	/**
+	 * Request the JBI Container uninstall the given archive
+	 * 
+	 * @param archive
+	 *            The name of the archive to install
+	 * 
+	 * @jmx.managed-operation
+	 */
+	public void uninstallArchive(String archive) {
+		try {
+			jbiContainer.removeArchive(archive);
+		} catch (DeploymentException e) {
+			throw new RuntimeException(
+					"ServiceMix JBIContainer unable to uninstall archive ["
+							+ archive + "]", e);
+		}
+	}
+
+	/**
 	 * Request the JBI Container install the given ServiceMix XML
 	 * 
 	 * @param archive
@@ -128,12 +153,34 @@
 		log
 				.info("Creating ServiceMix JBI installer from XML [" + archive
 						+ "]");
-		FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(
-				archive);
-		context.getBean("jbi");
+		List processors = Arrays.asList(new Object[] { new XBeanProcessor() });
+		containerMap.put(archive, new ClassPathXmlApplicationContext(archive,
+				processors));
 	}
 
 	/**
+	 * Request the JBI Container uninstall the given ServiceMix XML
+	 * 
+	 * @param archive
+	 *            The name of the archive to install
+	 * 
+	 * @jmx.managed-operation
+	 */
+	public void uninstallServiceMixXml(String archive) {
+		// Ok, we are going to use the spring infrastructure
+		// to create a container
+		log.info("Destroying ServiceMix JBI installer from XML [" + archive
+				+ "]");
+		ClassPathXmlApplicationContext context = (ClassPathXmlApplicationContext) containerMap
+				.get(archive);
+		if (context != null)
+			context.destroy();
+		else
+			log.warn("Unable to find deployed JBI container for XML ["
+					+ archive + "]");
+	}
+
+	/**
 	 * Sets the location of the transaction manager to use
 	 * 
 	 * @param transactionManager

Modified: branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/sar/META-INF/jboss-service.xml (867 => 868)

--- branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/sar/META-INF/jboss-service.xml	2005-11-18 14:17:45 UTC (rev 867)
+++ branches/servicemix-2.0/trunk/tooling/jboss-deployer/src/sar/META-INF/jboss-service.xml	2005-11-18 15:18:25 UTC (rev 868)
@@ -12,7 +12,7 @@
 
 	<mbean code="org.servicemix.jboss.deployment.JBIService"
 		name="org.servicemix:service=JBIService">
-		<depends>jboss:service=TransactionManager"</depends>
+		<depends>jboss:service=TransactionManager</depends>
 		<attribute name="TransactionManager">java:/TransactionManager</attribute>  -->
 	</mbean>
 </server>

Reply via email to