From 68b44c76a88235d6f36b1f528d247536c1a7a72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Mon, 12 Mar 2012 00:18:20 +0100 Subject: [PATCH] removed atmosphere from project --- pom.xml | 64 ++++--------------- .../AtmosphereResourceArgumentResolver.java | 30 --------- .../ctdo/bunti/websocket/AtmosphereUtils.java | 25 -------- .../bunti/websocket/WebSocketController.java | 57 ----------------- .../META-INF/spring/mvc/servlet-context.xml | 9 +-- src/main/webapp/WEB-INF/web.xml | 30 +-------- 6 files changed, 16 insertions(+), 199 deletions(-) delete mode 100644 src/main/java/de/ctdo/bunti/websocket/AtmosphereResourceArgumentResolver.java delete mode 100644 src/main/java/de/ctdo/bunti/websocket/AtmosphereUtils.java delete mode 100644 src/main/java/de/ctdo/bunti/websocket/WebSocketController.java diff --git a/pom.xml b/pom.xml index 4a53ae8..c877eb5 100644 --- a/pom.xml +++ b/pom.xml @@ -8,10 +8,8 @@ 3.1.0.RELEASE - - 8.1.0.RC4 + 7.2.0.v20101020 1.6.4 - 0.9-SNAPSHOT @@ -119,40 +117,6 @@ 1.2 - - org.atmosphere - atmosphere-runtime - ${atmosphere.version} - compile - - - org.atmosphere - atmosphere-ping - - - - - - org.atmosphere - atmosphere-compat-jetty - ${atmosphere.version} - - - - - - - - - - - org.aspectj - aspectjrt - 1.6.9 - compile - - - junit junit @@ -179,19 +143,19 @@ 2.3.2 - - - - - - - - - - - - - + + org.apache.maven.plugins + maven-dependency-plugin + + + install + install + + sources + + + + org.mortbay.jetty diff --git a/src/main/java/de/ctdo/bunti/websocket/AtmosphereResourceArgumentResolver.java b/src/main/java/de/ctdo/bunti/websocket/AtmosphereResourceArgumentResolver.java deleted file mode 100644 index fe14b33..0000000 --- a/src/main/java/de/ctdo/bunti/websocket/AtmosphereResourceArgumentResolver.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * - */ -package de.ctdo.bunti.websocket; - -import javax.servlet.http.HttpServletRequest; - -import org.atmosphere.cpr.AtmosphereResource; -import org.springframework.core.MethodParameter; -import org.springframework.web.bind.support.WebArgumentResolver; -import org.springframework.web.context.request.NativeWebRequest; - -public class AtmosphereResourceArgumentResolver implements WebArgumentResolver { - - - /* (non-Javadoc) - * @see org.springframework.web.bind.support.WebArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.context.request.NativeWebRequest) - */ - @Override - public Object resolveArgument(MethodParameter methodParameter, NativeWebRequest webRequest) throws Exception { - - if (AtmosphereResource.class.isAssignableFrom(methodParameter.getParameterType())) { - return AtmosphereUtils.getAtmosphereResource(webRequest.getNativeRequest(HttpServletRequest.class)); - } else { - return WebArgumentResolver.UNRESOLVED; - } - - } - -} diff --git a/src/main/java/de/ctdo/bunti/websocket/AtmosphereUtils.java b/src/main/java/de/ctdo/bunti/websocket/AtmosphereUtils.java deleted file mode 100644 index 6259bc1..0000000 --- a/src/main/java/de/ctdo/bunti/websocket/AtmosphereUtils.java +++ /dev/null @@ -1,25 +0,0 @@ -package de.ctdo.bunti.websocket; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.atmosphere.cpr.AtmosphereResource; -import org.atmosphere.cpr.AtmosphereServlet; -import org.springframework.util.Assert; - -public final class AtmosphereUtils { - - - public static AtmosphereResource getAtmosphereResource( - HttpServletRequest request) { - - - AtmosphereResource resource = - (AtmosphereResource) request.getAttribute(AtmosphereServlet.ATMOSPHERE_RESOURCE); - - Assert.notNull(resource,"AtmosphereResource could not be located for the request. Check that AtmosphereServlet is configured correctly in web.xml"); - - return resource; - } - -} diff --git a/src/main/java/de/ctdo/bunti/websocket/WebSocketController.java b/src/main/java/de/ctdo/bunti/websocket/WebSocketController.java deleted file mode 100644 index 30c51df..0000000 --- a/src/main/java/de/ctdo/bunti/websocket/WebSocketController.java +++ /dev/null @@ -1,57 +0,0 @@ -package de.ctdo.bunti.websocket; - -import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.atmosphere.cpr.AtmosphereResource; -import org.atmosphere.cpr.Broadcaster; -import org.codehaus.jackson.map.ObjectMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; - -@Controller -public class WebSocketController { - private static final Logger LOGGER = LoggerFactory.getLogger(WebSocketController.class); - - - @RequestMapping(value="/buntisocket", method=RequestMethod.GET) - @ResponseBody - public void websockets(final AtmosphereResource event) { - - - - final HttpServletRequest req = event.getRequest(); -// final HttpServletResponse res = event.getResponse(); - - LOGGER.debug("call to websockets " + req.toString()); - - final ObjectMapper mapper = new ObjectMapper(); - - event.suspend(); - - final Broadcaster bc = event.getBroadcaster(); - - bc.scheduleFixedBroadcast(new Callable() { - - private long sinceId = 0; - - @Override - public String call() throws Exception { - LOGGER.debug("call was called"); - - return mapper.writeValueAsString("blafaselblubb"); - } - - }, 10, TimeUnit.SECONDS); - - } - -} - diff --git a/src/main/resources/META-INF/spring/mvc/servlet-context.xml b/src/main/resources/META-INF/spring/mvc/servlet-context.xml index 8d459ec..83cf152 100644 --- a/src/main/resources/META-INF/spring/mvc/servlet-context.xml +++ b/src/main/resources/META-INF/spring/mvc/servlet-context.xml @@ -10,13 +10,7 @@ - - - - - - - + @@ -24,7 +18,6 @@ - diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index e34d5c5..369b222 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -35,35 +35,7 @@ appServlet - org.atmosphere.cpr.MeteorServlet - - org.atmosphere.servlet - org.springframework.web.servlet.DispatcherServlet - - - org.atmosphere.cpr.broadcasterClass - org.atmosphere.cpr.DefaultBroadcaster - - - org.atmosphere.cpr.broadcastFilterClasses - org.atmosphere.client.JavascriptClientFilter - - - org.atmosphere.cpr.CometSupport.maxInactiveActivity - 30 - - - org.atmosphere.useStream - true - - - org.atmosphere.useWebSocket - true - - - org.atmosphere.useNative - true - + org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:/META-INF/spring/mvc/servlet-context.xml