Skip to content

Instantly share code, notes, and snippets.

protected void queueWriteIO(AtmosphereResource r, Deliver deliver, AtomicInteger count) throws InterruptedException {
if (deliver.async) {
// The onStateChange/onRequest may change the isResumed value, hence we need to make sure only one thread flip
// the switch to garantee the Entry will be cached in the order it was broadcasted.
// Without synchronizing we may end up with a out of order BroadcasterCache queue.
if (!bc.getBroadcasterCache().getClass().equals(BroadcasterCache.DEFAULT.getClass().getName())) {
if (r.isResumed() || r.isCancelled()) {
logger.trace("AtmosphereResource {} has been resumed or cancelled, unable to Broadcast message {}", r.uuid(), deliver.message);
/**
10:29:38,577 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "prime.war" (runtime-name: "prime.war")
10:29:39,375 INFO [org.jboss.web] (ServerService Thread Pool -- 63) JBAS018210: Register web context: /prime
10:29:39,379 INFO [org.apache.catalina.core] (ServerService Thread Pool -- 63) JBWEB001093: The listener com.sun.faces.config.ConfigureListener is already configured for this context, the duplicate definition has been ignored
10:29:39,387 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 63) Initializing Mojarra 2.1.19-jbossorg-1 20131024-0833 for context '/prime'
10:29:39,794 INFO [org.primefaces.webapp.PostConstructApplicationEventListener] (ServerService Thread Pool -- 63) Running on PrimeFaces 5.1.9
10:29:39,808 INFO [org.atmosphere.cpr.AtmosphereFramework] (ServerService Thread Pool -- 63) Installed AtmosphereInterceptor Atmosphere LifeCycle with priority AFTER_DEFAULT
10:29:39,809 INFO [org.atmosphere.cp
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building primefaces 5.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://oss.sonatype.org/content/repositories/snapshots/org/atmosphere/atmosphere-project/2.3.0-SNAPSHOT/atmosphere-project-2.3.0-20150220.195549-170.pom
Downloaded: https://oss.sonatype.org/content/repositories/snapshots/org/atmosphere/atmosphere-project/2.3.0-SNAPSHOT/atmosphere-project-2.3.0-20150220.195549-170.pom (21 KB at 41.3 KB/sec)
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ primefaces ---
[INFO] Deleting /Users/jfarcand/workspace/primefaces/target
[INFO]
> db.getCollection("2014").find( {$and : [{ 'away.name': 'Canadiens'}, {'periods.events.event_type' : 'emptynetgoal'}]}).count()
5
> db.getCollection("2014").find( {$and : [{ 'home.name': 'Canadiens'}, {'periods.events.event_type' : 'emptynetgoal'}]}).count()
4
@jfarcand
jfarcand / java
Created February 5, 2015 16:13
Jetty 9 with Atmosphere
public class Main {
private static final Logger log = LoggerFactory.getLogger(Main.class);
public static void main(String[] args) throws Exception {
Main main = new Main();
main.run();
}
private void run() throws Exception {
Server server = new Server();
07:33:40.696 [localhost-startStop-1] INFO o.atmosphere.cpr.AtmosphereFramework - Atmosphere is using async support: org.atmosphere.container.Tomcat7Servlet30SupportWithWebSocket running under container: Apache Tomcat/7.0.54 using javax.servlet/3.0
07:33:40.697 [localhost-startStop-1] INFO o.atmosphere.cpr.AtmosphereFramework - Atmosphere Framework 2.2.4 started.
07:33:40.697 [localhost-startStop-1] INFO o.atmosphere.cpr.AtmosphereFramework -
For Atmosphere Framework Commercial Support, visit
http://www.async-io.org/ or send an email to support@async-io.org
Jan 5, 2015 7:33:40 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /Users/jfarcand/workspace/containers/shared_webapps/atmosphere-jersey-pubsub.war has finished in 1,369 ms
07:33:40.805 [Thread-9] INFO o.atmosphere.cpr.AtmosphereFramework - Latest version of Atmosphere's JavaScript Client 2.2.6
[INFO] Webapp directory = /Users/jfarcand/workspace/2samples/samples/jersey-pubsub/src/main/webapp
2015-01-05 07:30:46.588:INFO:oejs.Server:main: jetty-9.1.2.v20140210
2015-01-05 07:30:47.158:INFO:oeja.AnnotationConfiguration:main: Scanned 1 container path jars, 9 WEB-INF/lib jars, 2 WEB-INF/classes dirs in 244ms for context o.e.j.m.p.JettyWebAppContext@65b3ed91{/,[file:/Users/jfarcand/workspace/2samples/samples/jersey-pubsub/src/main/webapp/, file:/Users/jfarcand/workspace/2samples/samples/jersey-pubsub/target/tmp/javascript-2_2_6_war1/],STARTING}{file:/Users/jfarcand/workspace/2samples/samples/jersey-pubsub/src/main/webapp/}
2015-01-05 07:30:47.506:INFO:/:main: Initializing AtmosphereFramework
07:30:47.633 [main] INFO org.atmosphere.util.IOUtils - META-INF/services/org.atmosphere.cpr.AtmosphereFramework not found in class loader
07:30:47.659 [main] INFO o.atmosphere.cpr.AtmosphereFramework - Installing BroadcastFilter class(es) org.atmosphere.client.TrackMessageSizeFilter
07:30:47.670 [main] INFO o.atmos
AsyncHttpClient c = new AsyncHttpClient(new AsyncHttpClientConfig.Builder().(new SSLEngineFactory() {
@Override
public SSLEngine newSSLEngine(String s, int i) throws GeneralSecurityException {
SSLEngine sslEngine = sslContext.createSSLEngine();
sslEngine.setUseClientMode(true);
sslEngine.setEnabledCipherSuites(new String[]{"SSL_DH_anon_WITH_RC4_128_MD5"});
return sslEngine;
}
}).build());
2014-12-16 13:57:10.821:INFO:oejs.Server:main: jetty-9.2.3.v20140905
2014-12-16 13:57:13.108:INFO:/:main: Initializing AtmosphereFramework
Dec 16, 2014 1:57:14 PM com.hazelcast.instance.DefaultAddressPicker
INFO: [LOCAL] [dev] [3.3] Prefer IPv4 stack is true.
Dec 16, 2014 1:57:14 PM com.hazelcast.instance.DefaultAddressPicker
INFO: [LOCAL] [dev] [3.3] Picked Address[147.214.226.10]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
Dec 16, 2014 1:57:14 PM com.hazelcast.spi.impl.BasicOperationScheduler
INFO: [147.214.226.10]:5701 [dev] [3.3] Starting with 8 generic operation threads and 8 partition operation threads.
Dec 16, 2014 1:57:14 PM com.hazelcast.system
INFO: [147.214.226.10]:5701 [dev] [3.3] Hazelcast 3.3 (20140907) starting at Address[147.214.226.10]:5701