This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.atmosphere</groupId> | |
<artifactId>atmosphere-runtime</artifactId> | |
<version>0.9.5</version> | |
</dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<Context> | |
<Loader delegate="true"/> | |
</Context> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = new $.atmosphere.AtmosphereRequest(); | |
request.transport = 'websocket'; | |
request.url = "<c:url value='/twitter/concurrency'/>"; | |
request.contentType = "application/json"; | |
request.fallbackTransport = 'streaming'; | |
request.onMessage = function(response){ | |
buildTemplate(response); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequestMapping(value="/twitter/concurrency") | |
@ResponseBody | |
public void twitterAsync(AtmosphereResource atmosphereResource){ | |
final ObjectMapper mapper = new ObjectMapper(); | |
this.suspend(atmosphereResource); | |
final Broadcaster bc = atmosphereResource.getBroadcaster(); | |
logger.info("Atmo Resource Size: " + bc.getAtmosphereResources().size()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Connector port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" | |
connectionTimeout="600000" | |
redirectPort="8443" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet> | |
<servlet-name>feeds</servlet-name> | |
<servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> | |
<init-param> | |
<param-name>org.atmosphere.servlet</param-name> | |
<param-value>org.springframework.web.servlet.DispatcherServlet</param-value> | |
</init-param> | |
<init-param> | |
<param-name>org.atmosphere.cpr.broadcasterClass</param-name> | |
<param-value>org.atmosphere.cpr.DefaultBroadcaster</param-value> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package java.util; | |
public interface Comparator<T> { | |
public int compare(T t, T t1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.keaplogik.examples.model.animals; | |
import java.awt.Color; | |
public interface Animal { | |
public enum AnimalClass { | |
MAMMAL, | |
BIRD, | |
FISH, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Run a demo for supplying different strategies to sort a list | |
* of animals. | |
* | |
* @author keaplogik | |
*/ | |
public class RunAnimalStrategyDemo { | |
public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.keaplogik.examples.design.patterns.strategy; | |
import com.keaplogik.examples.model.animals.Animal; | |
import java.util.Comparator; | |
/** | |
* Holds concrete strategies for working with animal lists. | |
* @keaplogik | |
*/ | |
public enum AnimalListStrategy { |
OlderNewer