diff options
author | fmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-03 18:46:58 +0000 |
---|---|---|
committer | fmoga <fmoga@13f79535-47bb-0310-9956-ffa450edef68> | 2010-08-03 18:46:58 +0000 |
commit | c6d8ce981070daff40ef8b23558187066973924f (patch) | |
tree | 8a32c3e24ad69f687deb6d3741e154ec35c14e91 /sca-java-2.x/contrib/modules | |
parent | d4cb9c36eb969b9b06fb0d469fabd8e378affcb1 (diff) |
Set org.atmosphere.useNative to true in order to skip the TuscanyServletFilter exception regarding Servlets 3.0 and use native APIs.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@982001 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/contrib/modules')
4 files changed, 16 insertions, 36 deletions
diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/pom.xml b/sca-java-2.x/contrib/modules/binding-comet-runtime/pom.xml index 9ff94ca831..61c53e974e 100644 --- a/sca-java-2.x/contrib/modules/binding-comet-runtime/pom.xml +++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/pom.xml @@ -53,27 +53,12 @@ <artifactId>tuscany-host-http</artifactId> <version>2.0-SNAPSHOT</version> </dependency> - <dependency> - <groupId>org.codehaus.jackson</groupId> - <artifactId>jackson-core-asl</artifactId> - <version>1.5.4</version> - </dependency> - <dependency> - <groupId>org.codehaus.jackson</groupId> - <artifactId>jackson-mapper-asl</artifactId> - <version>1.5.4</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents</groupId> - <artifactId>httpclient</artifactId> - <version>4.0</version> - </dependency> <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> + <groupId>javax</groupId> + <artifactId>javaee-web-api</artifactId> + <version>6.0</version> <scope>provided</scope> </dependency> diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServiceBindingProvider.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServiceBindingProvider.java index 3aeff7269f..7081081a14 100644 --- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServiceBindingProvider.java +++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServiceBindingProvider.java @@ -44,9 +44,10 @@ public class CometServiceBindingProvider implements ServiceBindingProvider { ComponentService service = endpoint.getService(); Interface serviceInterface = service.getInterfaceContract().getInterface(); for (Operation op : serviceInterface.getOperations()) { - // CometServlet servlet = new CometServlet(endpoint, op); MeteorServlet servlet = new MeteorServlet(); servlet.addInitParameter("org.atmosphere.servlet", "org.apache.tuscany.sca.binding.comet.runtime.CometServlet"); + // TODO fix TuscanyServletFilter to use Servlets 3.0 + servlet.addInitParameter("org.atmosphere.useNative", "true"); String path = endpoint.getBinding().getURI() + "/" + op.getName(); servletHost.addServletMapping(path, servlet); System.out.println("Adding attributes to servlet context..."); diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServlet.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServlet.java index 7b8b39dcce..9f4d56ef71 100644 --- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServlet.java +++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServlet.java @@ -45,18 +45,6 @@ public class CometServlet extends HttpServlet { protected transient Operation operation; private List<BroadcastFilter> filters; - public CometServlet() { - } - - public CometServlet(RuntimeEndpoint wire, Operation operation) { - System.out.println("Entering CometServlet constructor..."); - this.wire = wire; - this.operation = operation; - filters = new LinkedList<BroadcastFilter>(); - filters.add(new XSSHtmlFilter()); - filters.add(new ScriptFilter()); - } - @Override public void init(ServletConfig config) throws ServletException { System.out.println("Entering CometServlet#init..."); diff --git a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java index 0b22515f7a..e58f06c91e 100644 --- a/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java +++ b/sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java @@ -10,10 +10,16 @@ import org.apache.tuscany.sca.node.NodeFactory; public class CometTest extends TestCase { public void testComet() { - String location = ContributionLocationHelper.getContributionLocation("test.composite"); - Node node = NodeFactory.newInstance().createNode("test.composite", new Contribution("c1", location)); - node.start(); - node.stop(); + try { + String location = ContributionLocationHelper.getContributionLocation("test.composite"); + Node node = NodeFactory.newInstance().createNode("test.composite", new Contribution("c1", location)); + node.start(); + // System.out.println("Press any key to stop the node."); + // System.in.read(); + node.stop(); + } catch (Exception e) { + fail("Exception caught!"); + } } - + } |