summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServlet.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/contrib/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/CometServlet.java13
1 files changed, 5 insertions, 8 deletions
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 9f4d56ef71..d199a77a68 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
@@ -40,6 +40,8 @@ import org.atmosphere.util.XSSHtmlFilter;
public class CometServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final String METEOR_KEY = "org.apache.tuscany.comet.meteor";
+ public static final String ENDPOINT_KEY = "org.apache.tuscany.sca.binding.comet.endpoint";
+ public static final String OPERATION_KEY = "org.apache.tuscany.sca.binding.comet.operation";
protected transient RuntimeEndpoint wire;
protected transient Operation operation;
@@ -47,7 +49,6 @@ public class CometServlet extends HttpServlet {
@Override
public void init(ServletConfig config) throws ServletException {
- System.out.println("Entering CometServlet#init...");
super.init(config);
filters = new LinkedList<BroadcastFilter>();
filters.add(new XSSHtmlFilter());
@@ -56,9 +57,8 @@ public class CometServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- System.out.println("Entering CometServlet#doGet...");
Meteor meteor = Meteor.build(req, SCOPE.REQUEST, filters, null);
- meteor.addListener(new EventsLogger());
+ // meteor.addListener(new EventsLogger());
req.getSession().setAttribute(METEOR_KEY, meteor);
resp.setContentType("text/html");
meteor.suspend(-1);
@@ -66,11 +66,8 @@ public class CometServlet extends HttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- System.out.println("Entering CometServlet#doPost...");
- System.out.println("Getting attributes from servlet context...");
- this.wire = (RuntimeEndpoint)getServletContext().getAttribute("org.apache.tuscany.sca.binding.comet.endpoint");
- this.operation = (Operation)getServletContext().getAttribute("org.apache.tuscany.sca.binding.comet.operation");
- System.out.println("Getting Meteor...");
+ this.wire = (RuntimeEndpoint)getServletContext().getAttribute(ENDPOINT_KEY);
+ this.operation = (Operation)getServletContext().getAttribute(OPERATION_KEY);
Meteor meteor = (Meteor)req.getSession().getAttribute(METEOR_KEY);
meteor.broadcast(invokeService(new Object[] {}));
}