git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1197537 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2011-11-04 12:38:15 +00:00
parent 0018f4a3ad
commit e0b23f27e2
5 changed files with 59 additions and 10 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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 TransportServerSupport {
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());

View File

@ -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 TextWireFormat {
public XStream getXStream() {
if (xStream == null) {
xStream = createXStream();
// make it work in OSGi env
xStream.setClassLoader(getClass().getClassLoader());
}
return xStream;
}