Ref : http://java67.blogspot.in/2014/12/strategy-pattern-in-java-with-sample.html#more
Strategy Pattern in java
Strategy Pattern in java
What made you reach today, might not be enough in future -- Keep Learning
| Name(Site/People) | Country | Key Words | |
| 1 | Adam Bien | Germany | Java EE |
| 2 | Antonio Goncalves | France | Author of Java EE 7 |
| 3 | Henrik Warne | Sweden | Thoughts on programming |
| 4 | Billy Yarosh | America | Coding Cures |
| 5 | Lars Vogel | Germany | Android and Eclipse |
| 6 | Peter Verhas | Hungary | Pure Java |
| 7 | Martin Fowler | America | Author, Speaker |
| 8 | Bozhidar Bozhanov | Bulgaria | JEE |
| 9 | Richard Warburton | UK | Java 8 Lambdas |
| 10 | Bear Giles | America | JEE |
| 11 | Marginally Interesting | Germany | Machine Learning |
| 12 | Pascal Alma | America | JEE |
| 13 | Dror Helper | America | Consultant |
| 14 | Juri Strumpflohner | Italy | JavaScript |
| 15 | Reza Rahman | America | Java EE/Glassfish |
| 16 | Phil Whelan | Canada | Web |
| 17 | Brett Porter | Australia | Co-author of Apache Maven 2 |
| 18 | Ben McCann | America | Co-founder at Connectifier |
| 19 | Java Posse | America | Some useful links |
| 20 | Mark Needham | UK | Data |
| 21 | Iris Shoor | Israel | Debug |
| 22 | Yifan Peng | America | Graduate Student |
| 23 | Nikita Salnikov Tarnovski | Estonia | Memory Leaks |
| 24 | Dustin Marx | America | Actual Events |
| 25 | Bart Bakker | Netherland | Agile |
| 26 | Gunnar Peipman | America | non-java |
| 27 | Dave Fecak | America | Job Tips for Programmers |
| 28 | JOOQ | Switzerland | SQL |
| 29 | Petri Kainulainen | Finland | Web |
| 30 | Informatech CR | Costa Rica | |
| 31 | Arun Gupta | America | Java EE |
| 32 | Mechanical Sympathy | UK | Performance |
| 33 | Extreme Enthusiasm | Italy | Agile |
| 34 | Steve Blank | America | Author of The Startup Owner's Manual |
| 35 | Oliver Gierke | Germany | SpringSource |
| 36 | Nicolas Fränkel | Switzerland | Java EE |
| 37 | Blaise Doughan | America | XML and JSON |
| 38 | Vlad Mihalcea | Romania | Software Integration |
| 39 | Kevin Lee | Australia | Web |
| 40 | Mikhail Vorontsov | Australia | Performance |
| 41 | Jakob Jenkov | Denmark | Software Architecture |
| 42 | Jim Weaver | Rich Client Java | |
| 43 | Jonathan Giles | New Zealand | Java FX |
| 44 | Stephen Chin | America | Java FX |
| 45 | Matt Raible | America | Open Source Frameworks |
| 46 | Peter Lawrey | UK | Core Java |
| 47 | Gregor Riegler | Austria | OO Design, XP |
| 48 | Jos Dirksen | Netherlands | SOA, HTML 5 |
| 49 | Alexander J. Turner | UK | Information, News And Views |
| 50 | Java Advent | ||
| 51 | John Purcell | Hungary | Tutorials |
| 52 | Transylvania JUG | UK | |
| 53 | Java Roots | Spring | |
| 54 | Java Training | Greece | training |
| 55 | Allan Kelly | UK | Software |
| 56 | Samuel Santos | Portugal | Java EE |
| 57 | Steve Smith | UK | Agile |
| 58 | Niklas Schlimm | Germany | Multithreading |
| 59 | Shrutarshi Basu | America | PhD, Computer Science |
| 60 | Anton Arhipov | Estonia | Java EE |
| 61 | Charles Nutter | America | JVM |
| 62 | RedStack | America | SOA, JVM |
| 63 | James Bloom | America | JVM |
| 64 | Pierre-Hugues Charbonneau | Canada | Java EE |
| 65 | Eugen Paraschiv | Romania | Java Web |
| 66 | Wayne Beaton | America | Eclipse |
| 67 | Jeff Atwood | America | Stack Overflow |
| Program Creek | America | Deep Understanding of Java Core |
package mypackage;
public interface HelloWorld extends java.rmi.Remote {
public java.lang.String sayHello() throws java.rmi.RemoteException;
}
package mypackage;
public interface HelloWorld extends java.rmi.Remote {
public java.lang.String sayHello() throws java.rmi.RemoteException;
}
SET WAS_HOME=C:\Program Files\WebSphere\AppServer5.1 call "%WAS_HOME%\bin\setupcmdline.bat" "%JAVA_HOME%\bin\javac" -extdirs "%WAS_CLASSPATH%;%WAS_EXT_DIRS%;." mypackage\*.java
call "%WAS_HOME%\bin\Java2WSDL" -style document -use literal -verbose -location http://localhost:9080/HelloWorldWAR/services/HelloWorld mypackage.HelloWorld
WSWS3429I: Binding-specific properties are {MIMEStyle=WSDL11, use=literal, debug=false,
style=document,
bindingName=HelloWorld, encodingStyle=http://schemas.xmlsoap.org/soap/encoding/,
verbose=true, wrapped=true, portTypeName=HelloWorld, servicePortName=HelloWorld,
intfNS=http://mypackage, location=
http://localhost:9080/HelloWorldWAR/services/HelloWorld,
soapAction=DEFAULT}
WSWS3010I: Info: Generating portType {http://mypackage}HelloWorld
WSWS3010I: Info: Generating message {http://mypackage}sayHelloRequest
WSWS3010I: Info: Generating message {http://mypackage}sayHelloResponse
WSWS3010I: Info: Generating binding {http://mypackage}HelloWorldSoapBinding
WSWS3010I: Info: Generating service {http://mypackage}HelloWorldService
WSWS3010I: Info: Generating port HelloWorld
call "%WAS_HOME%\bin\WSDL2Java" -genJava overwrite -genXML overwrite -role server -container web -verbose -output . HelloWorld.wsdl
WSWS3185I: Info: Parsing XML file: HelloWorld.wsdl WSWS3282I: Info: Generating .\mypackage\HelloWorld.java. WSWS3282I: Info: Generating .\mypackage\HelloWorldSoapBindingImpl.java. WSWS3282I: Info: Generating .\WEB-INF\webservices.xml. WSWS3282I: Info: Generating .\WEB-INF\ibm-webservices-bnd.xmi. WSWS3282I: Info: Generating .\WEB-INF\ibm-webservices-ext.xmi. WSWS3282I: Info: Generating .\WEB-INF\HelloWorld_mapping.xml.
package mypackage;
public class HelloWorldSoapBindingImpl implements mypackage.HelloWorld{
public java.lang.String sayHello() throws java.rmi.RemoteException {
return null;
}
}
package mypackage;
public interface HelloWorld extends java.rmi.Remote {
public java.lang.String sayHello() throws java.rmi.RemoteException;
}
package mypackage;
public class HelloWorldSoapBindingImpl implements mypackage.HelloWorld{
public java.lang.String () throws java.rmi.RemoteException {
return "Hello World";
}
}
"%JAVA_HOME%\bin\javac" -extdirs "%WAS_CLASSPATH%;%WAS_EXT_DIRS%;." mypackage\*.java
WEB-INF\classes\mypackage\HelloWorld.class WEB-INF\classes\mypackage\HelloWorld.java WEB-INF\classes\mypackage\HelloWorldSoapBindingImpl.class WEB-INF\classes\mypackage\HelloWorldSoapBindingImpl.java
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app id="WebApp"> <display-name>HelloWorldWAR</display-name> <servlet> <servlet-name>mypackage_HelloWorldSoapBindingImpl</servlet-name> <servlet-class>mypackage.HelloWorldSoapBindingImpl</servlet-class> <load-on-startup>1</load-on-startup> </servlet> </web-app>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE webservices PUBLIC "-//IBM Corporation, Inc.//DTD J2EE Web services 1.0//EN"
"http://www.ibm.com/webservices/dtd/j2ee_web_services_1_0.dtd">
<webservices>
<webservice-description>
<webservice-description-name>HelloWorldService</webservice-description-name>
<wsdl-file>WEB-INF/wsdl/HelloWorld.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/HelloWorld_mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>HelloWorld</port-component-name>
<wsdl-port>
<namespaceURI>http://mypackage</namespaceURI>
<localpart>HelloWorld</localpart>
</wsdl-port>
<service-endpoint-interface>mypackage.HelloWorld</service-endpoint-interface>
<service-impl-bean>
<servlet-link>??SET THIS TO servlet-name ELEMENT OF web.xml??</servlet-link>
</service-impl-bean>
</port-component>
</webservice-description>
</webservices>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE webservices PUBLIC "-//IBM Corporation, Inc.//DTD J2EE Web services 1.0//EN"
"http://www.ibm.com/webservices/dtd/j2ee_web_services_1_0.dtd">
<webservices>
<webservice-description>
<webservice-description-name>HelloWorldService</webservice-description-name>
<wsdl-file>WEB-INF/wsdl/HelloWorld.wsdl</wsdl-file>
<jaxrpc-mapping-file>WEB-INF/HelloWorld_mapping.xml</jaxrpc-mapping-file>
<port-component>
<port-component-name>HelloWorld</port-component-name>
<wsdl-port>
<namespaceURI>http://mypackage</namespaceURI>
<localpart>HelloWorld</localpart>
</wsdl-port>
<service-endpoint-interface>mypackage.HelloWorld</service-endpoint-interface>
<service-impl-bean>
<servlet-link>mypackage_HelloWorldSoapBindingImpl</servlet-link>
</service-impl-bean>
</port-component>
</webservice-description>
</webservices>