broken version. would work with Athmosphere 0.7.2

will update to 0.9 ... need some refactoring
This commit is contained in:
Lucas Pleß 2012-03-10 23:57:15 +01:00
parent a1feb25187
commit dfba009524
9 changed files with 89 additions and 62 deletions

45
pom.xml
View File

@ -7,10 +7,11 @@
<packaging>war</packaging>
<properties>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
<org.springframework.version>3.1.0.RELEASE</org.springframework.version>
<!--<jettyVersion>7.2.0.v20101020</jettyVersion>-->
<jettyVersion>8.1.0.RC4</jettyVersion>
<org.slf4j.version>1.6.4</org.slf4j.version>
<atmosphere.version>0.9-SNAPSHOT</atmosphere.version>
</properties>
<repositories>
@ -20,6 +21,7 @@
<url>https://repository.jboss.org/nexus/content/repositories/releases</url>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>org.eclipse.repository.development</id>
<name>Jetty Repo</name>
@ -120,8 +122,20 @@
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>0.7.2</version>
<version>${atmosphere.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-ping</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-compat-jetty</artifactId>
<version>${atmosphere.version}</version>
</dependency>
<!--<dependency>-->
@ -162,21 +176,22 @@
<source>1.6</source>
<target>1.6</target>
</configuration>
<version>2.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>sources</goal>
</goals>
</execution>
</executions>
</plugin>
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-dependency-plugin</artifactId>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>install</id>-->
<!--<phase>install</phase>-->
<!--<goals>-->
<!--<goal>sources</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<plugin>
<groupId>org.mortbay.jetty</groupId>

View File

@ -15,13 +15,13 @@ import java.util.Map;
@Controller
public class RestController {
private static final Logger LOGGER = LoggerFactory.getLogger(RestController.class);
private Validator validator;
// private Validator validator;
private BuntiController controller;
@Autowired
public void setValidator(Validator validator) {
this.validator = validator;
}
// @Autowired
// public void setValidator(Validator validator) {
// this.validator = validator;
// }
@Autowired
public final void setController(BuntiController controller) {

View File

@ -13,6 +13,7 @@ public final class AtmosphereUtils {
public static AtmosphereResource<HttpServletRequest, HttpServletResponse> getAtmosphereResource(
HttpServletRequest request) {
AtmosphereResource<HttpServletRequest, HttpServletResponse> resource =
(AtmosphereResource<HttpServletRequest, HttpServletResponse>) request.getAttribute(AtmosphereServlet.ATMOSPHERE_RESOURCE);

View File

@ -2,14 +2,21 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd ">
<context:component-scan base-package="de.ctdo.bunti"/>
<context:component-scan base-package="de.ctdo.bunti.web*"/>
<!-- Configures the @Controller programming model -->
<mvc:annotation-driven />
<mvc:annotation-driven>
<mvc:argument-resolvers>
<bean class="de.ctdo.bunti.websocket.AtmosphereResourceArgumentResolver" />
</mvc:argument-resolvers>
</mvc:annotation-driven>
<!-- Forwards requests to the "/" resource to the "welcome" view -->
<mvc:view-controller path="/" view-name="index"/>
@ -23,17 +30,6 @@
<property name="suffix" value=".jsp" />
</bean>
<task:annotation-driven scheduler="myScheduler"/>
<task:scheduler id="myScheduler" pool-size="3"/>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:bunti.properties"/>
</bean>
<bean class="de.ctdo.bunti.dmx.DMXMixerImpl">
<property name="artNetDeviceAddress" value="${artnet.deviceAddress}"/>
</bean>
<!--<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" />-->
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
<context:component-scan base-package="de.ctdo.bunti">
<context:exclude-filter type="regex" expression="de\.ctdo\.bunti\.web*"/>
</context:component-scan>
<task:annotation-driven scheduler="myScheduler"/>
<task:scheduler id="myScheduler" pool-size="3"/>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:bunti.properties"/>
</bean>
<bean class="de.ctdo.bunti.dmx.DMXMixerImpl">
<property name="artNetDeviceAddress" value="${artnet.deviceAddress}"/>
</bean>
</beans>

View File

@ -38,7 +38,7 @@
<!-- Root Logger -->
<root>
<priority value="warn" />
<priority value="info" />
<appender-ref ref="console" />
</root>

View File

@ -1,3 +0,0 @@
Manifest-Version: 1.0
Class-Path:

View File

@ -20,7 +20,7 @@
$(document).ready(
function() {
var Socket = "MozWebSocket" in window ? MozWebSocket : WebSocket;
ws = new Socket("ws://" + window.location.hostname + ":" + window.location.port + "/bunti_server/bunti");
ws = new Socket("ws://" + window.location.hostname + ":" + window.location.port + "/buntisocket");
ws.onmessage = function (message) {
//$("#messages").append("<p>" + message.data + "</p>");

View File

@ -3,14 +3,18 @@
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>bunti_server</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<description>CTDO bunti control Server</description>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:META-INF/spring/root-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
@ -29,19 +33,6 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--<servlet>-->
<!--<servlet-name>dispatcher</servlet-name>-->
<!--<servlet-class>-->
<!--org.springframework.web.servlet.DispatcherServlet-->
<!--</servlet-class>-->
<!--<load-on-startup>1</load-on-startup>-->
<!--</servlet>-->
<session-config>
<session-timeout>25</session-timeout>
</session-config>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class>
@ -75,7 +66,7 @@
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/servlet-context.xml</param-value>
<param-value>classpath:/META-INF/spring/mvc/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>