<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>1.0.0.RC1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.5</version>
</dependency>
web.xml
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Push Servlet</servlet-name>
<url-pattern>/primepush/*</url-pattern>
</servlet-mapping>
如果在点击3或7之后出现以下警告:
警告:GRIZZLY0024:终止进程被中断。 java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1325) at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:414) at com.sun.grizzly.http.ProcessorTask.terminateProcess(ProcessorTask.java:1021) at com.sun.grizzly.arp.DefaultAsyncExecutor.finishResponse(DefaultAsyncExecutor.java:186) at com.sun.grizzly.arp.DefaultAsyncExecutor.finishExecute(DefaultAsyncExecutor.java:210) at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:133) at com.sun.grizzly.comet.CometEngine.flushPostExecute(CometEngine.java:426) at com.sun.grizzly.comet.CometEngine.interrupt0(CometEngine.java:405) at com.sun.grizzly.comet.CometEngine.interrupt(CometEngine.java:383) at com.sun.grizzly.comet.CometContext.resumeCometHandler(CometContext.java:442) at org.atmosphere.container.GrizzlyCometSupport.resume(GrizzlyCometSupport.java:172) at org.atmosphere.container.GrizzlyCometSupport.action(GrizzlyCometSupport.java:184) at org.atmosphere.container.GrizzlyCometSupport.action(GrizzlyCometSupport.java:81) at org.atmosphere.cpr.AtmosphereResourceImpl.resume(AtmosphereResourceImpl.java:317) at org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(AbstractReflectorAtmosphereHandler.java:146) at org.atmosphere.cpr.DefaultBroadcaster.broadcast(DefaultBroadcaster.java:853) at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:768) at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:801) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)