You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2011/11/04 13:38:15 UTC
svn commit: r1197537 - in /activemq/trunk: activemq-karaf/
activemq-karaf/src/main/resources/ activemq-optional/
activemq-optional/src/main/java/org/apache/activemq/transport/http/
activemq-optional/src/main/java/org/apache/activemq/transport/xstream/
Author: dejanb
Date: Fri Nov 4 12:38:15 2011
New Revision: 1197537
URL: http://svn.apache.org/viewvc?rev=1197537&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3579 - http transport in osgi
Modified:
activemq/trunk/activemq-karaf/pom.xml
activemq/trunk/activemq-karaf/src/main/resources/features.xml
activemq/trunk/activemq-optional/pom.xml
activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java
activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
Modified: activemq/trunk/activemq-karaf/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/pom.xml?rev=1197537&r1=1197536&r2=1197537&view=diff
==============================================================================
--- activemq/trunk/activemq-karaf/pom.xml (original)
+++ activemq/trunk/activemq-karaf/pom.xml Fri Nov 4 12:38:15 2011
@@ -31,7 +31,7 @@
<description>Provides resources for running ActiveMQ in Apache Karaf</description>
<properties>
- <xpp3-bundle-version>1.1.4c_3</xpp3-bundle-version>
+ <xpp3-bundle-version>1.1.4c_5</xpp3-bundle-version>
<jodatime-bundle-version>1.5.2_2</jodatime-bundle-version>
<jdom-bundle-version>1.1_3</jdom-bundle-version>
<dom4j-bundle-version>1.6.1_2</dom4j-bundle-version>
Modified: activemq/trunk/activemq-karaf/src/main/resources/features.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-karaf/src/main/resources/features.xml?rev=1197537&r1=1197536&r2=1197537&view=diff
==============================================================================
--- activemq/trunk/activemq-karaf/src/main/resources/features.xml (original)
+++ activemq/trunk/activemq-karaf/src/main/resources/features.xml Fri Nov 4 12:38:15 2011
@@ -30,6 +30,7 @@
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.oro/2.0.8_3</bundle>
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity/1.7_1</bundle>
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jasypt/1.6_1</bundle>
+ <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/1.9.0</bundle>
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xpp3/${xpp3-bundle-version}</bundle>
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.joda-time/${jodatime-bundle-version}</bundle>
<bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jdom/${jdom-bundle-version}</bundle>
@@ -59,6 +60,12 @@
<bundle>mvn:org.apache.activemq/activemq-blueprint/${activemq-version}</bundle>
</feature>
+ <feature name="activemq-optional" version="${activemq-version}" resolver="(obr)">
+ <feature version="${activemq-version}">activemq-blueprint</feature>
+ <feature varesion="[7.0,8.0)">jetty</feature>
+ <bundle>mvn:org.apache.activemq/activemq-optional/${activemq-version}</bundle>
+ </feature>
+
<!-- do "features:install war" before installing this one -->
<feature name="activemq-web-console" version="${activemq-version}" resolver="(obr)">
<feature version="[2,3)">war</feature>
Modified: activemq/trunk/activemq-optional/pom.xml
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/pom.xml?rev=1197537&r1=1197536&r2=1197537&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/pom.xml (original)
+++ activemq/trunk/activemq-optional/pom.xml Fri Nov 4 12:38:15 2011
@@ -28,6 +28,7 @@
<artifactId>activemq-optional</artifactId>
<packaging>jar</packaging>
<name>ActiveMQ :: Optional</name>
+ <description>Optional ActiveMQ features</description>
<repositories>
@@ -206,7 +207,44 @@
<build>
<plugins>
-
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+ <Fragment-Host>org.apache.activemq.activemq-core</Fragment-Host>
+ <Export-Package>
+ org.apache.activemq.transport.http*;version=${project.version};-noimport:=;-split-package:=merge-last,
+ org.apache.activemq.transport.https*;version=${project.version};-noimport:=;-split-package:=merge-last
+ </Export-Package>
+ <Import-Package>
+ org.eclipse.jetty*;version="[7.0,8.0)";resolution:=optional,
+ !org.apache.activemq.transport.ws*;version=${project.version};,
+ !org.apache.activemq.transport.xstream;version=${project.version};,
+ !org.apache.activemq.transport.util;version=${project.version};,
+ org.apache.activemq*;version=${project.version};resolution:=optional
+ </Import-Package>
+ </instructions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
<!-- Configure which tests are included/excuded -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java?rev=1197537&r1=1197536&r2=1197537&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTransportServer.java Fri Nov 4 12:38:15 2011
@@ -16,9 +16,6 @@
*/
package org.apache.activemq.transport.http;
-import java.net.InetSocketAddress;
-import java.net.URI;
-
import org.apache.activemq.command.BrokerInfo;
import org.apache.activemq.transport.TransportServerSupport;
import org.apache.activemq.transport.util.TextWireFormat;
@@ -29,6 +26,10 @@ import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.GzipHandler;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+
+import java.net.InetSocketAddress;
+import java.net.URI;
public class HttpTransportServer extends TransportServerSupport {
@@ -83,7 +84,9 @@ public class HttpTransportServer extends
ServletContextHandler contextHandler =
new ServletContextHandler(server, "/", ServletContextHandler.NO_SECURITY);
- contextHandler.addServlet(HttpTunnelServlet.class, "/");
+ ServletHolder holder = new ServletHolder();
+ holder.setServlet(new HttpTunnelServlet());
+ contextHandler.addServlet(holder, "/");
contextHandler.setAttribute("acceptListener", getAcceptListener());
contextHandler.setAttribute("wireFormat", getWireFormat());
Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java?rev=1197537&r1=1197536&r2=1197537&view=diff
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/transport/xstream/XStreamWireFormat.java Fri Nov 4 12:38:15 2011
@@ -16,17 +16,16 @@
*/
package org.apache.activemq.transport.xstream;
-import java.io.IOException;
-import java.io.Reader;
-
import com.thoughtworks.xstream.XStream;
-
import org.apache.activemq.command.Command;
import org.apache.activemq.command.MarshallAware;
import org.apache.activemq.command.MessageDispatch;
import org.apache.activemq.transport.util.TextWireFormat;
import org.apache.activemq.wireformat.WireFormat;
+import java.io.IOException;
+import java.io.Reader;
+
/**
* A {@link WireFormat} implementation which uses the <a
* href="http://xstream.codehaus.org/>XStream</a> library to marshall commands
@@ -93,6 +92,8 @@ public class XStreamWireFormat extends T
public XStream getXStream() {
if (xStream == null) {
xStream = createXStream();
+ // make it work in OSGi env
+ xStream.setClassLoader(getClass().getClassLoader());
}
return xStream;
}