| Commit in servicemix/tooling/jboss-deployer on MAIN | |||
| src/main/java/org/servicemix/jboss/deployment/JBIService.java | +19 | -1 | 1.1 -> 1.2 |
| /JBIDeployer.java | +27 | -12 | 1.3 -> 1.4 |
| .cvsignore | +3 | added 1.1 | |
| project.xml | +2 | -35 | 1.1 -> 1.2 |
| +51 | -48 | ||
Added support for dropping servicemix.xml style deployments into the JBoss deploy directory, this means you can leverage the SpringJBIContainer within your JBoss server. The files need to have the extension *-sm.xml.
servicemix/tooling/jboss-deployer/src/main/java/org/servicemix/jboss/deployment
diff -u -r1.1 -r1.2 --- JBIService.java 2 Aug 2005 19:09:26 -0000 1.1 +++ JBIService.java 13 Aug 2005 17:10:09 -0000 1.2 @@ -25,6 +25,7 @@
import org.jboss.system.ServiceMBeanSupport; import org.servicemix.jbi.container.JBIContainer;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
/** * This is the deployer that handles picking up and deploying a JBI package out
@@ -114,6 +115,23 @@
} /**
+ * Request the JBI Container install the given ServiceMix XML
+ *
+ * @param archive
+ * The name of the archive to install
+ *
+ * @jmx.managed-operation
+ */
+ public void installServiceMixXml(String archive) {
+ // Ok, we are going to use the spring infrastructure
+ // to create a container
+ log.info("Creating ServiceMix JBI installer from XML [" + archive + "]");
+ FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(
+ archive);
+ context.getBean("jbi");
+ }
+
+ /**
* Sets the location of the transaction manager to use * * @param transactionManager
@@ -160,7 +178,7 @@
// Lets get the transaction manager from JNDI InitialContext initCtxt = new InitialContext();
- Object transactionManager = initCtxt.lookup(this.transactionManager);
+ Object transactionManager = initCtxt.lookup(this.transactionManager);
jbiContainer.setTransactionManager(transactionManager); jbiContainer.init();
servicemix/tooling/jboss-deployer/src/main/java/org/servicemix/jboss/deployment
diff -u -r1.3 -r1.4 --- JBIDeployer.java 8 Aug 2005 12:45:03 -0000 1.3 +++ JBIDeployer.java 13 Aug 2005 17:10:09 -0000 1.4 @@ -53,21 +53,27 @@
public boolean accepts(DeploymentInfo di) {
// To be accepted the deployment's root name must end in jar or zip
String urlStr = di.url.getFile();
- if (!urlStr.endsWith(".jar") && !urlStr.endsWith(".zip")) {
+ if (!urlStr.endsWith(".jar") && !urlStr.endsWith(".zip")
+ && !urlStr.endsWith("-sm.xml")) {
return false; }
- // However the jar must also contain an META-INF/jbi.xml
boolean accepts = false;
- try {
- URL dd = di.localCl.findResource("META-INF/jbi.xml");
- if (dd != null) {
- log.debug("Found a META-INF/jbi.xml file, di: " + di);
- accepts = true;
+ if (urlStr.endsWith(".jar") || urlStr.endsWith(".zip")) {
+ // 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) {
+ log.debug("Found a META-INF/jbi.xml file, di: " + di);
+ accepts = true;
+ }
+ } catch (Exception ignore) {
}
- } catch (Exception ignore) {
+ } else {
+ // If is ends with -sm.xml then we just accept it
+ accepts = true;
}
-
+
return accepts; }
@@ -82,6 +88,8 @@
*/
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");
@@ -89,9 +97,16 @@
log
.info("ServiceMix deployer passing deployment to JBI container ["
+ di.url.toExternalForm() + "]");
- getServer().invoke(jbiContainerMBean, "installArchive",
- new Object[] { di.url.toExternalForm() },
- new String[] { "java.lang.String" });
+ if (urlStr.endsWith(".jar") || urlStr.endsWith(".zip")) {
+ getServer().invoke(jbiContainerMBean, "installArchive",
+ new Object[] { di.url.toExternalForm() },
+ new String[] { "java.lang.String" });
+ } else {
+ getServer().invoke(jbiContainerMBean, "installServiceMixXml",
+ new Object[] { di.url.toExternalForm() },
+ new String[] { "java.lang.String" });
+ }
+
} catch (Exception e) {
throw new DeploymentException(
"ServiceMix deployer unable to deploy: " + di, e);
servicemix/tooling/jboss-deployer
.cvsignore added at 1.1
diff -N .cvsignore --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ .cvsignore 13 Aug 2005 17:10:09 -0000 1.1 @@ -0,0 +1,3 @@
+target +.classpath +.project
servicemix/tooling/jboss-deployer
diff -u -r1.1 -r1.2 --- project.xml 2 Aug 2005 19:09:26 -0000 1.1 +++ project.xml 13 Aug 2005 17:10:09 -0000 1.2 @@ -42,7 +42,7 @@
<dependency> <groupId>servicemix</groupId> <artifactId>servicemix</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>1.0-M2</version>
<properties> <sar.bundle>true</sar.bundle> </properties>
@@ -94,45 +94,30 @@
<dependency> <groupId>mx4j</groupId> <artifactId>mx4j</artifactId>
- <version>2.1.1</version> - <properties> - <sar.bundle>true</sar.bundle> - </properties>
+ <version>2.1.1</version>
</dependency> <dependency> <groupId>mx4j</groupId> <artifactId>mx4j-jmx</artifactId> <version>2.1.1</version>
- <properties> - <sar.bundle>true</sar.bundle> - </properties>
</dependency> <dependency> <groupId>mx4j</groupId> <artifactId>mx4j-remote</artifactId> <version>2.1.1</version>
- <properties> - <sar.bundle>true</sar.bundle> - </properties>
</dependency> <dependency> <groupId>mx4j</groupId> <artifactId>mx4j-tools</artifactId> <version>2.1.1</version>
- <properties> - <sar.bundle>true</sar.bundle> - </properties>
</dependency> <dependency> <groupId>mx4j</groupId> <artifactId>mx4j-impl</artifactId> <version>2.1.1</version>
- <properties> - <sar.bundle>true</sar.bundle> - </properties>
</dependency> <!--For remote management tasks-->
@@ -140,9 +125,6 @@
<dependency> <id>ant</id> <version>1.6</version>
- <properties> - <lib>true</lib> - </properties>
</dependency> <dependency>
@@ -150,17 +132,11 @@
<artifactId>commons-logging</artifactId> <version>1.0.3</version> <url>http://jakarta.apache.org/commons/logging/</url>
- <properties> - <sar.bundle>true</sar.bundle> - </properties>
</dependency> <dependency> <id>concurrent</id> <version>1.3.4</version>
- <properties> - <sar.bundle>true</sar.bundle> - </properties>
</dependency> <dependency>
@@ -208,26 +184,17 @@
<groupId>xerces</groupId> <artifactId>xercesImpl</artifactId> <version>2.6.2</version>
- <properties> - <lib>true</lib> - </properties>
</dependency> <dependency> <groupId>xerces</groupId> <artifactId>xmlParserAPIs</artifactId> <version>2.6.2</version>
- <properties> - <lib>true</lib> - </properties>
</dependency> <!-- mostly included for some DOM/SAX tools we could maybe replace with JAXP versions --> <dependency> <id>xalan</id> <version>2.6.0</version>
- <properties> - <lib>true</lib> - </properties>
</dependency> <dependency>
