summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/contrib')
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/pom.xml21
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServiceBindingProvider.java3
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServlet.java12
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/src/test/java/org/apache/tuscany/sca/test/CometTest.java16
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!");
+ }
}
-
+
}