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
plugins { | |
compile ':spring-security-core:1.2.7.3' | |
compile ':mongodb:1.0.0.GA' | |
compile ':webxml:1.4.1' | |
compile ':ws-client:1.0' | |
runtime ':resources:1.1.6' | |
runtime ':jquery:1.8.0' | |
runtime ':lesscss-resources:1.3.0.3' | |
build ':tomcat:2.2.0' | |
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
modules = { | |
application { | |
resource url:'js/application.js' | |
} | |
bootstrap { | |
resource url:'less/custom-bootstrap.less',attrs:[rel: "stylesheet/less", type:'css'] | |
dependsOn 'jquery' | |
dependsOn 'bootstrapJs' | |
} |
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
GROUP Animals by same class type | |
---------------------------------------------- | |
Animal: { | |
Class: BIRD | |
Species: Crow | |
Vertebrate: true | |
Color: java.awt.Color[r=0,g=0,b=0] | |
}; | |
Animal: { | |
Class: BIRD |
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 { |
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.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
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
<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
<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
@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()); |