[jboss-cvs] JBoss Messaging SVN: r5584 - in trunk/src/main/org/jboss/messaging: servlet and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 6 16:21:59 EST 2009
Author: ataylor
Date: 2009-01-06 16:21:58 -0500 (Tue, 06 Jan 2009)
New Revision: 5584
Added:
trunk/src/main/org/jboss/messaging/servlet/
trunk/src/main/org/jboss/messaging/servlet/JBMServlet.java
trunk/src/main/org/jboss/messaging/servlet/JBMSessionListener.java
Log:
added new targets to build sar and war and added framework for servlet transport
Added: trunk/src/main/org/jboss/messaging/servlet/JBMServlet.java
===================================================================
--- trunk/src/main/org/jboss/messaging/servlet/JBMServlet.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/servlet/JBMServlet.java 2009-01-06 21:21:58 UTC (rev 5584)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.messaging.servlet;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.servlet.ServletException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ */
+public class JBMServlet extends HttpServlet
+{
+ protected void doRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException
+ {
+ HttpSession session = httpServletRequest.getSession();
+ httpServletResponse.setStatus(HttpServletResponse.SC_OK);
+ httpServletResponse.getWriter().append("JBMServlet.doRequest");
+ }
+
+ protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException
+ {
+ doRequest(httpServletRequest, httpServletResponse);
+ }
+
+ protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException
+ {
+ doRequest(httpServletRequest, httpServletResponse);
+ }
+}
Added: trunk/src/main/org/jboss/messaging/servlet/JBMSessionListener.java
===================================================================
--- trunk/src/main/org/jboss/messaging/servlet/JBMSessionListener.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/servlet/JBMSessionListener.java 2009-01-06 21:21:58 UTC (rev 5584)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.messaging.servlet;
+
+import javax.servlet.http.HttpSessionListener;
+import javax.servlet.http.HttpSessionEvent;
+
+/**
+ * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
+ */
+public class JBMSessionListener implements HttpSessionListener
+{
+ public JBMSessionListener()
+ {
+ super();
+ }
+
+ public void sessionCreated(HttpSessionEvent event)
+ {
+ System.out.println("JBMSessionListener.sessionCreated");
+ event.getSession().setMaxInactiveInterval(5000);
+ }
+
+ public void sessionDestroyed(HttpSessionEvent event)
+ {
+ System.out.println("JBMSessionListener.sessionDestroyed");
+ }
+}
More information about the jboss-cvs-commits
mailing list