<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8048745819635601540</atom:id><lastBuildDate>Fri, 23 Oct 2009 17:29:32 +0000</lastBuildDate><title>Java Wave</title><description>Useful Information about Java, Latest IDE's in market, Web services</description><link>http://javawave.blogspot.com/</link><managingEditor>noreply@blogger.com (Muthukumar Dhanagopal)</managingEditor><generator>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/JavaWave" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1388330908386483938</guid><pubDate>Mon, 04 May 2009 05:36:00 +0000</pubDate><atom:updated>2009-05-03T22:40:28.934-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Utils</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><category domain="http://www.blogger.com/atom/ns#">String Utility</category><title>Convert a String to Lower Case in Java</title><description>Here this post will show you how to convert a string to lower case in Java. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;String actualValue = "JAVA WAVE";  &lt;br /&gt;  &lt;br /&gt;String lowerCase = actualValue.toLowerCase();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-1388330908386483938?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2009/05/convert-string-to-lower-case-in-java.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-9008221090730650907</guid><pubDate>Tue, 10 Mar 2009 05:30:00 +0000</pubDate><atom:updated>2009-03-09T22:33:05.534-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Generate a unique identifier with java.util.UUID</title><description>&lt;span style="font-weight:bold;"&gt;Java SE 5 has introduced the java.util.UUID class to easily generate Universally Unique Identifier (UUID)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.util.UUID;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * This class is used to generate UUID and return it as a String object&lt;br /&gt; * &lt;br /&gt; * @author dhanago&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;public class GenerateUUID&lt;br /&gt;{&lt;br /&gt;    /**&lt;br /&gt;     * method to return UUID as a String object&lt;br /&gt;     * &lt;br /&gt;     * @return&lt;br /&gt;     */&lt;br /&gt;    public static String getUUID()&lt;br /&gt;    {&lt;br /&gt; return UUID.randomUUID().toString();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-9008221090730650907?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2009/03/generate-unique-identifier-with.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-8488104082741997256</guid><pubDate>Wed, 04 Mar 2009 06:40:00 +0000</pubDate><atom:updated>2009-03-03T22:41:26.626-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Java utility to read from resource bundle or properties file</title><description>&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * dataSource.properties is loaded to a resource bundle.&lt;br /&gt;     */&lt;br /&gt;    public static ResourceBundle resourceBundle = ResourceBundle.getBundle(&lt;br /&gt;            "sample.prop.health");&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This method will return the value of the property from the resource&lt;br /&gt;     * bundle.&lt;br /&gt;     *&lt;br /&gt;     * @param key&lt;br /&gt;     *            property key&lt;br /&gt;     * @return property value&lt;br /&gt;     */&lt;br /&gt;    public static String getProperty(String key)&lt;br /&gt;    {&lt;br /&gt;        String value = null;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            value = resourceBundle.getString(key);&lt;br /&gt;        }&lt;br /&gt;        catch (MissingResourceException missingResourceException)&lt;br /&gt;        {&lt;br /&gt;            Logger.getLogger(Utility.class.getName()).&lt;br /&gt;                    log(Level.SEVERE,&lt;br /&gt;                    "Resource Bundle not found",&lt;br /&gt;                    missingResourceException);&lt;br /&gt;        }&lt;br /&gt;        return value;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-8488104082741997256?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2009/03/java-utility-to-read-from-resource.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1513380325595158694</guid><pubDate>Wed, 04 Mar 2009 06:37:00 +0000</pubDate><atom:updated>2009-03-03T22:38:59.896-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Java method to format the current date to yyyy-MM-dd using SimpleDateFormat.</title><description>&lt;pre&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This method will format the current date to yyyy-MM-dd.&lt;br /&gt;     * @return&lt;br /&gt;     *      current date as String.&lt;br /&gt;     */&lt;br /&gt;    public static String formatedCurrentDate()&lt;br /&gt;    {&lt;br /&gt;        String toDate = new Date().toString();&lt;br /&gt;        SimpleDateFormat formatter = new SimpleDateFormat(&lt;br /&gt;                "EEE MMM yyyy hh:mm:ss zzz");&lt;br /&gt;        Date date = formatter.parse(toDate,&lt;br /&gt;                new ParsePosition(0));&lt;br /&gt;&lt;br /&gt;        toDate = new SimpleDateFormat("yyyy-MM-dd").format(date);&lt;br /&gt;        return toDate;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-1513380325595158694?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2009/03/java-method-to-format-current-date-to.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-5660228247246989612</guid><pubDate>Wed, 04 Mar 2009 06:27:00 +0000</pubDate><atom:updated>2009-03-03T22:29:22.220-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Java method to return a File object from the file path specified</title><description>&lt;pre&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This method will return a file from the path specified.&lt;br /&gt;     *&lt;br /&gt;     * @param path&lt;br /&gt;     *            path of the file name.&lt;br /&gt;     * @param fileName&lt;br /&gt;     *            Name of the file.&lt;br /&gt;     * @return File object&lt;br /&gt;     */&lt;br /&gt;    public static File readFileFromPath(String path, String fileName)&lt;br /&gt;    {&lt;br /&gt;        String fileNameWithPath = null;&lt;br /&gt;        if (path.endsWith("/"))&lt;br /&gt;        {&lt;br /&gt;            fileNameWithPath = path + fileName;&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            fileNameWithPath = path + "/" + fileName;&lt;br /&gt;        }&lt;br /&gt;        File file = new File(fileNameWithPath);&lt;br /&gt;&lt;br /&gt;        return file;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-5660228247246989612?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2009/03/java-method-to-return-file-object-from.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-4371942812228623271</guid><pubDate>Wed, 04 Mar 2009 06:24:00 +0000</pubDate><atom:updated>2009-03-03T22:26:12.628-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Reading file as String in Java</title><description>&lt;pre&gt;&lt;br /&gt;    /** This method will read a file as String&lt;br /&gt;     * @param filePath&lt;br /&gt;     * @return file as String&lt;br /&gt;     * @throws java.io.IOException&lt;br /&gt;     */&lt;br /&gt;    public static String readFileAsString(String filePath)&lt;br /&gt;            throws java.io.IOException&lt;br /&gt;    {&lt;br /&gt;        StringBuffer fileData = new StringBuffer(1000);&lt;br /&gt;        BufferedReader reader = new BufferedReader(new FileReader(filePath));&lt;br /&gt;        char[] buf = new char[1024];&lt;br /&gt;        int numRead = 0;&lt;br /&gt;        while ((numRead = reader.read(buf)) != -1)&lt;br /&gt;        {&lt;br /&gt;            String readData = String.valueOf(buf,&lt;br /&gt;                    0,&lt;br /&gt;                    numRead);&lt;br /&gt;            fileData.append(readData);&lt;br /&gt;            buf = new char[1024];&lt;br /&gt;        }&lt;br /&gt;        reader.close();&lt;br /&gt;        return fileData.toString();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-4371942812228623271?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2009/03/reading-file-as-string-in-java.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-2117484138611298227</guid><pubDate>Wed, 04 Mar 2009 06:17:00 +0000</pubDate><atom:updated>2009-03-03T22:22:47.879-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Java method to replace every occurences of a string within another string</title><description>&lt;pre&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This method will replace every occurences of a string within another&lt;br /&gt;     * string.&lt;br /&gt;     *&lt;br /&gt;     * @param target&lt;br /&gt;     *          is the original string&lt;br /&gt;     * @param from&lt;br /&gt;     *          is the string to be replaced&lt;br /&gt;     * @param to&lt;br /&gt;     *          is the string which will used to replace&lt;br /&gt;     * @return&lt;br /&gt;     *          changed new string&lt;br /&gt;     */&lt;br /&gt;    public static String replace(String target, String from, String to)&lt;br /&gt;    {&lt;br /&gt;        int start = target.indexOf(from);&lt;br /&gt;        if (start == -1)&lt;br /&gt;        {&lt;br /&gt;            return target;&lt;br /&gt;        }&lt;br /&gt;        int fromLength = from.length();&lt;br /&gt;        char[] targetChars = target.toCharArray();&lt;br /&gt;        StringBuffer buffer = new StringBuffer();&lt;br /&gt;        int copyFrom = 0;&lt;br /&gt;        while (start != -1)&lt;br /&gt;        {&lt;br /&gt;            buffer.append(targetChars,&lt;br /&gt;                    copyFrom,&lt;br /&gt;                    start - copyFrom);&lt;br /&gt;            buffer.append(to);&lt;br /&gt;            copyFrom = start + fromLength;&lt;br /&gt;            start = target.indexOf(from,&lt;br /&gt;                    copyFrom);&lt;br /&gt;        }&lt;br /&gt;        buffer.append(targetChars,&lt;br /&gt;                copyFrom,&lt;br /&gt;                targetChars.length - copyFrom);&lt;br /&gt;        return buffer.toString();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-2117484138611298227?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2009/03/java-method-to-replace-every-occurences.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-8981775674905512891</guid><pubDate>Tue, 02 Dec 2008 08:15:00 +0000</pubDate><atom:updated>2008-12-02T00:28:26.996-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Converting Java String to double</title><description>&lt;span style="font-weight: bold;"&gt;The following code will convert Java String into double data type.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;package com.javaWave.blogSpot;&lt;br /&gt;&lt;br /&gt;public class String2double {&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @param args&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  // String myString = "javaWave"; // do this if you want an exception&lt;br /&gt;&lt;br /&gt;  String myString = "100.00";&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   double convertedValue = &lt;br /&gt;    Double.valueOf(myString.trim()).doubleValue();&lt;br /&gt;   System.out.println("convertedValue = " + convertedValue);&lt;br /&gt;  } catch (NumberFormatException nfe) {&lt;br /&gt;   System.out.println("NumberFormatException: " &lt;br /&gt;     + nfe.getMessage());&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-8981775674905512891?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2008/12/converting-java-string-to-double.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-3196745170777268412</guid><pubDate>Sun, 10 Aug 2008 16:59:00 +0000</pubDate><atom:updated>2008-08-10T10:05:26.094-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">hibernate</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">NetBeans</category><title>Hibernate support in Netbeans IDE 6.1</title><description>&lt;a href="http://www.netbeans.tv/screencasts/Hibernate-Support-in-the-NetBeans-IDE-370/"&gt;http://www.netbeans.tv/screencasts/Hibernate-Support-in-the-NetBeans-IDE-370/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-3196745170777268412?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2008/08/hibernate-support-in-netbeans-ide-61.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-985721734158158028</guid><pubDate>Sat, 26 Jul 2008 13:56:00 +0000</pubDate><atom:updated>2008-07-26T07:33:24.728-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Core Java Notes- Part I</title><description>&lt;strong&gt;Designing a class&lt;/strong&gt;:&lt;br /&gt;Think about objects created from the class.&lt;br /&gt;· Things the object knows about itself-&gt; instance variable&lt;br /&gt;· Things the object does-&gt; methods.&lt;br /&gt;&lt;em&gt;Note: think of instance as another way of saying object.&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;Difference between a class and a object&lt;/strong&gt;:&lt;br /&gt;&lt;em&gt;Note: a class is not an object&lt;/em&gt;&lt;br /&gt;-&gt;class is used to construct an object&lt;br /&gt;A class is an blueprint for an object&lt;br /&gt;-&gt; tells the virtual machine how to make an object of the particular type.&lt;br /&gt;Example: An object is like one entry in your address book.&lt;br /&gt;&lt;strong&gt;The two uses of main&lt;/strong&gt;:&lt;br /&gt;1. To test your real class.&lt;br /&gt;2. To launch/ start your java application.&lt;br /&gt;&lt;strong&gt;The Heap&lt;/strong&gt;&lt;br /&gt;Each time an object is created in java, it goes into an area of memory known as the Heap. All objects created live on the heap.&lt;br /&gt;&lt;em&gt;Note: The java heap is actually called as Garbage collectable heap.&lt;/em&gt;&lt;br /&gt;Java manages the memory for you. When the JVM can see that an object can never be used again, that object becomes eligible for garbage collection. And if you are running low on memory, the garbage collector will run, throw out the unreachable objects, and free up the space, so that the space can be reused.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Marking a method as public and static&lt;/strong&gt;:&lt;br /&gt;Marking a method as public and static makes it behave much like a ‘global’.&lt;br /&gt;&lt;em&gt;Note: Any code in any class of your application can access a public static method.&lt;/em&gt;&lt;br /&gt;If you mark a variable as public, static and final, you have essentially made a globally available constant.&lt;br /&gt;&lt;strong&gt;Variables&lt;/strong&gt;&lt;br /&gt;2 flavours of variables,&lt;br /&gt;· Primitive&lt;br /&gt;· Reference&lt;br /&gt;&lt;strong&gt;Primitive&lt;/strong&gt;: Hold fundamental values including integers, Booleans and floating point numbers.&lt;br /&gt;&lt;strong&gt;Object references&lt;/strong&gt;: hold, well, references to objects.&lt;br /&gt;&lt;strong&gt;Two declare a variable you must follow two rules&lt;/strong&gt;:&lt;br /&gt;1. variables must have a type.&lt;br /&gt;2. variables must have a name.&lt;br /&gt;&lt;em&gt;Example&lt;/em&gt;:&lt;br /&gt;int count&lt;br /&gt;here,&lt;br /&gt;int ==&gt; Type, and&lt;br /&gt;count ==&gt; Name.&lt;br /&gt;&lt;em&gt;Note: A variable is just a container that holds something&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;You can assign a value to a variable in one of several ways including&lt;/strong&gt;:&lt;br /&gt;&gt; Type a literal value after the equal sign, eg., x=12, isgod=true; etc.,&lt;br /&gt;&gt; assign the value of one variable to another (x=y).&lt;br /&gt;&gt; use an expression combining the two. Eg.(x=y+43).&lt;br /&gt;&lt;em&gt;Note: You need a name and a type for your variables&lt;/em&gt;&lt;br /&gt;int size = 32&lt;br /&gt;here ,&lt;br /&gt;int ==&gt; Type,&lt;br /&gt;size ==&gt; Name, and&lt;br /&gt;32 ==&gt; Literal&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Safe naming rules for a class method or variable&lt;/strong&gt;:&lt;br /&gt;· it must start with a letter, underscore(_), or dollar sign($).you can’t start a name with a number.&lt;br /&gt;· After the first character you can use the number as well.&lt;br /&gt;· It can be anything you like, subject to those two rules, just so long as it isn’t one of java’s reserved words.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reserved words Table:&lt;/strong&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5227325433590089730" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 481px; CURSOR: hand; HEIGHT: 46px; TEXT-ALIGN: center" height="104" alt="" src="http://3.bp.blogspot.com/_OIoG5Xsg62c/SIswyUqAiAI/AAAAAAAAAto/uRr1dCYddX0/s320/reserved+words.png" width="499" border="0" /&gt; &lt;strong&gt;Non-Primitive Variables/Objects&lt;/strong&gt;:&lt;br /&gt;There is actually no such thing as an object variables&lt;br /&gt;There is only an object reference variable.&lt;br /&gt;An object reference variable holds bits that representation way to access an object. And the JVM knows how to use the reference to get to the object.&lt;br /&gt;&lt;em&gt;Note: Objects live in one place-the garbage collectible heap!&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Arrays&lt;/strong&gt;&lt;/em&gt;: Arrays are always objects, whether they are declared to hold primitives or object references.&lt;br /&gt;&lt;em&gt;Note: once you have declared an array, you can’t put anything in it except things that are of the declared array type.&lt;br /&gt;&lt;/em&gt;&lt;strong&gt;Bullet Points&lt;/strong&gt;:&lt;br /&gt;Variables come in two flavours,&lt;br /&gt;1. Primitive&lt;br /&gt;2. Reference&lt;br /&gt;Variables must always be declared with a name and a type.&lt;br /&gt;A primitive variable value is the bits representing a way to get to an object on the heap.&lt;br /&gt;A reference variable is like a remote control using the dot operator (.) on a reference variable is like pressing a button on the remote control to access a method or instance variable.&lt;br /&gt;A reference variable has a value of null when it is not referencing any object.&lt;br /&gt;An array is always an object, even if the array is declared to hold primitives. There is no such thing as a primitive array, only an array that holds primitives&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Note: Java is pass-by-value (i.e) pass-by-copy.&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Bullet Points&lt;/strong&gt;:&lt;br /&gt;· Classes define what an object knows and what an object does.&lt;br /&gt;· Things an object knows are its instance variables(state).&lt;br /&gt;· Things an object does are its methods(behaviour).&lt;br /&gt;· Methods can use instance variables so that objects of the same type can behave differently.&lt;br /&gt;· A method can have parameters, which means you can pass one or more values into the method.&lt;br /&gt;· The number and type of values you pass in must match the order and type of the parameters declared by the method.&lt;br /&gt;· Values passed in and out of methods can be implicitly promoted to a larger type or explicitly cast to a smaller type.&lt;br /&gt;· The value you pass as an argument to a method can be a literal value (2, ‘c’,etc) or a variable of the declared parameter type (for example, x where x is an int variable).&lt;br /&gt;· A method must declare a return type. A void return type means the method doesn’t return type.&lt;br /&gt;&lt;strong&gt;Encapsulation ==&gt; Hide the data&lt;/strong&gt;:&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Rule of thumb&lt;/em&gt;&lt;/strong&gt;: Mark your instance variables private and provide public getters and setters for access control.&lt;br /&gt;&lt;strong&gt;The difference between instance and local variable&lt;/strong&gt;.&lt;br /&gt;instance variable are declared inside a class but not within a method.&lt;br /&gt;local variables are declared within a method.&lt;br /&gt;local variables must be initialized before use.&lt;br /&gt;&lt;em&gt;Note: Local variables do not get a default value! The compiler complains if you try to use a local variable before the variable is initialized.&lt;br /&gt;Note: Method parameters are virtually the same as local variables. But method parameters will never get a compiler error telling you that a parameter variable might not have been initialized.&lt;br /&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-985721734158158028?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2008/07/core-java-notes-part-i.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_OIoG5Xsg62c/SIswyUqAiAI/AAAAAAAAAto/uRr1dCYddX0/s72-c/reserved+words.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-6529806886811471198</guid><pubDate>Mon, 14 Apr 2008 15:54:00 +0000</pubDate><atom:updated>2008-04-14T10:27:06.053-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">scheduler</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Quartz</category><title>Quartz Job Scheduler -- Part II (Example, Simple Trigger)</title><description>In this example we will see how to implement a Simple scheduler with the help of Quartz Framework.&lt;br /&gt;&lt;br /&gt;Our application will just print Hello World on console after specified time.&lt;br /&gt;&lt;br /&gt;For implementing the scheduler using quartz we need two classes.&lt;br /&gt;1.  which will implement &lt;span style="font-style: italic;"&gt;org.quartz.Job&lt;/span&gt; interface, and the other&lt;br /&gt;2.  the scheduler class which will start the scheduler.&lt;br /&gt;&lt;br /&gt;Now we will see the code which will implement Job interface:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;package com.MyQuartz.simple;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import java.util.Date;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import org.quartz.Job;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import org.quartz.JobExecutionContext;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import org.quartz.JobExecutionException;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt; * @author dhanago&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;public class HelloJob implements Job {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;    public void execute(JobExecutionContext jobExecutionContext)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;            throws JobExecutionException {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        System.out.println("Hello World -- Executed on : " + new Date());&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here,&lt;br /&gt;    execute() --&gt; is an overridden method. When ever Job interface is implemented its execute() of method should be overridden. &lt;span style="font-style: italic;"&gt;Note that any component you want to schedule should implement Job interface.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    JobExecutionContext --&gt; is passed as an parameter to the execute() method. this provides the job instance which provides the job instance with information about its run-time environment. From this we will get the job detail information and also some important information regarding its triggers etc.,&lt;br /&gt;&lt;br /&gt;Now we will see the code which will start the scheduler:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;package com.MyQuartz.simple;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import java.util.Date;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import java.util.logging.Level;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import java.util.logging.Logger;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import org.quartz.JobDetail;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import org.quartz.Scheduler;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import org.quartz.SchedulerException;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import org.quartz.SimpleTrigger;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;import org.quartz.impl.StdSchedulerFactory;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt; * @author dhanago&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;public class StartScheduler {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;    public void startScheduler()&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;            throws SchedulerException {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        Scheduler scheduler = new StdSchedulerFactory().getScheduler();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        scheduler.start();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        JobDetail jobDetail = new JobDetail(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;                "MyJob", scheduler.DEFAULT_GROUP, HelloJob.class);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        SimpleTrigger simpleTrigger = new SimpleTrigger(&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;                "MyTrigger", scheduler.DEFAULT_GROUP, new Date(),&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;                null, SimpleTrigger.REPEAT_INDEFINITELY, 60L * 1000L);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        scheduler.scheduleJob(jobDetail, simpleTrigger);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;    public static void main(String args[]) {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        StartScheduler startScheduler = new StartScheduler();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        try {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;            startScheduler.startScheduler();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        catch (SchedulerException ex) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;            Logger.getLogger(StartScheduler.class.getName()).&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;                    log(Level.SEVERE, null, ex);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here,&lt;br /&gt;&lt;br /&gt;&lt;p style="font-family: arial; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;    &lt;/b&gt;StdSchedulerFactory():&lt;b&gt; &lt;/b&gt;A Class StdSchedulerFactory is a class and it is implementation of SchedulerFactory interface. Here it just using for create an instance of SchedulerFactory instance.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;    &lt;/b&gt;Scheduler: Scheduler interface is the main interface (API) to this functionality. It provides some simple operations like scheduling jobs, &lt;b&gt; &lt;/b&gt;unscheduling jobs, starting/stopping/pausing the scheduler.&lt;/span&gt;&lt;/p&gt;  &lt;p style="font-family: arial; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;    &lt;/b&gt;start(): This method is used to starts the Scheduler's threads that fire Triggers. At the first time when we create the Scheduler it is in "stand-by" mode, and will not fire triggers. The scheduler can also be send back into stand-by mode by invoking the standby() method.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;    &lt;/b&gt;JobDetail(String name, String group, Class jobclass): The JobDetail object is created at the time the Job is added to scheduler. It contains various property settings like job name, group name and job class name. It can be used to store state information for a given instance of job class.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;    &lt;/b&gt;SimpleTrigger(String name, String group, Date startTime, Date endTime, int repeatCount, long repeatInterval): Trigger objects are used to firing the execution of jobs. When you want to schedule the job, instantiate the trigger and set the properties to provide the scheduling.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;    &lt;/b&gt;DEFAULT_GROUP: It is a constant, specified that &lt;b&gt; &lt;/b&gt;Job and &lt;b&gt; &lt;/b&gt;Trigger instances are belongs to which group..&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;    &lt;/b&gt;REPEAT_INDEFINITELY: It is a constant used to indicate the 'repeat count' of the trigger is indefinite.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-family: arial; color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;&lt;b&gt;    &lt;/b&gt;scheduleJob(JobDetail &lt;/span&gt;&lt;span style="font-size:100%;"&gt;jobDetail&lt;/span&gt;&lt;span style="font-size:100%;"&gt;, SimpleTrigger s&lt;/span&gt;&lt;span style="font-size:100%;"&gt;impleTrigger&lt;/span&gt;&lt;span style="font-size:100%;"&gt;): This method is used to add the JobDetail to the Scheduler, and associate the Trigger with it.&lt;/span&gt;&lt;/p&gt;OutPut:&lt;br /&gt;&lt;br /&gt;&lt;img src="file:///C:/Users/SRIHAR%7E1/AppData/Local/Temp/moz-screenshot-2.jpg" alt="" /&gt;&lt;br /&gt;init:&lt;br /&gt;deps-jar:&lt;br /&gt;compile-single:&lt;br /&gt;run-single:&lt;br /&gt;log4j:WARN No appenders could be found for logger (org.quartz.simpl.SimpleThreadPool).&lt;br /&gt;log4j:WARN Please initialize the log4j system properly.&lt;br /&gt;Hello World -- Executed on : Mon Apr 14 22:52:25 IST 2008&lt;br /&gt;Hello World -- Executed on : Mon Apr 14 22:53:25 IST 2008&lt;br /&gt;Hello World -- Executed on : Mon Apr 14 22:54:25 IST 2008&lt;br /&gt;Hello World -- Executed on : Mon Apr 14 22:55:25 IST 2008&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-6529806886811471198?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2008/04/quartz-job-scheduler-part-ii-example.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1572131741395265628</guid><pubDate>Mon, 07 Apr 2008 15:01:00 +0000</pubDate><atom:updated>2008-04-13T07:08:56.241-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">scheduler</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Quartz</category><title>Quartz Job Scheduler -- Part 1 (Setting up development project in Netbeans 6.1 beta)</title><description>&lt;span style="font-weight: bold;"&gt;Setting up development project in Netbeans 6.1 beta&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-family:arial;"&gt;Step 1 :&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Run Netbeans IDE and create a New Java project opening the new project creation wizard like below. &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_OIoG5Xsg62c/R_o5bWDT7MI/AAAAAAAAAq0/lRQlhv752cA/s1600-h/newProject.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_OIoG5Xsg62c/R_o5bWDT7MI/AAAAAAAAAq0/lRQlhv752cA/s320/newProject.jpg" alt="" id="BLOGGER_PHOTO_ID_5186521062809267394" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_OIoG5Xsg62c/SAIRwDI0JtI/AAAAAAAAAsU/DBbSDkg95OU/s1600-h/newProject.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_OIoG5Xsg62c/SAIRwDI0JtI/AAAAAAAAAsU/DBbSDkg95OU/s320/newProject.jpg" alt="" id="BLOGGER_PHOTO_ID_5188729237857904338" border="0" /&gt;&lt;/a&gt;Step 2:  Click on the Next button and enter the project name. Here i am giving the name as "MyQuartz".  Click on finish.  (see the below figure)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_OIoG5Xsg62c/SAISZzI0JvI/AAAAAAAAAsg/uZVh-oIlos8/s1600-h/projName.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_OIoG5Xsg62c/SAISZzI0JvI/AAAAAAAAAsg/uZVh-oIlos8/s320/projName.jpg" alt="" id="BLOGGER_PHOTO_ID_5188729955117442802" border="0" /&gt;&lt;/a&gt;Step 3: Download Quartz from the location --&gt; &lt;a href="http://www.opensymphony.com/quartz/download.action"&gt;http://www.opensymphony.com/quartz/download.action&lt;/a&gt; . Once downloaded extract the archive to a location.&lt;br /&gt;Step 4: The below table explains the files inside the extracted archive.&lt;br /&gt;&lt;br /&gt;&lt;table border="1" cellpadding="0" cellspacing="1" height="124" width="500"&gt;   &lt;tbody&gt;&lt;tr&gt;     &lt;td height="19" width="163"&gt;&lt;b&gt;Files/Directory&lt;/b&gt;&lt;/td&gt;     &lt;td height="19" width="325"&gt;&lt;b&gt;Purpose&lt;/b&gt;&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="76" width="163"&gt;quartz-all-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height="76" width="325"&gt;  Quartz library includes the core Quartz components and all optional packages. If       you are using this library then no other quartz-*.jars       need to include.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;quartz-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height="17" width="325"&gt;core Quartz library.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;quartz-jboss-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height="17" width="325"&gt;  optional JBoss  Quartz extensions such as&lt;br /&gt;the Quartz startup MBean, QuartzService.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;quartz-oracle-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height="17" width="325"&gt;  optional Oracle specific Quartz extensions such as&lt;br /&gt;the OracleDelegate&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;quartz-weblogic-&lt;ver&gt;.jar&lt;/ver&gt;&lt;/td&gt;     &lt;td height="17" width="325"&gt; optional WebLogic specific Quartz extensions such&lt;br /&gt;as the WebLogicDelegate&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;build.xml&lt;/td&gt;     &lt;td height="17" width="325"&gt;               an "ANT" build file, for building Quartz.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;docs&lt;/td&gt;     &lt;td height="17" width="325"&gt;         root directory of all       documentation&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;docs/wikidocs&lt;/td&gt;     &lt;td height="17" width="325"&gt;               the main documentation for Quartz.  Start with       the "index.html"&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;docs/dbTables&lt;/td&gt;     &lt;td height="17" width="325"&gt;    sql scripts for creating Quartz database tables in       a variety of different databases. &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;src/java/org/quartz&lt;/td&gt;     &lt;td height="17" width="325"&gt;     the main package of the Quartz project, containing the 'public' (client-side) API for       the scheduler&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;src/java/org/quartz/core&lt;/td&gt;     &lt;td height="17" width="325"&gt;    a package containing the 'private' (server-side)&lt;br /&gt;               components of Quartz.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;src/java/org/quartz/simpl&lt;/td&gt;     &lt;td height="17" width="325"&gt; this package contains simple implementations of&lt;br /&gt;               Quartz support modules (JobStores, ThreadPools,&lt;br /&gt;               Loggers, etc.) that have no dependencies on external (third-party) products.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;src/java/org/quartz/impl&lt;/td&gt;     &lt;td height="17" width="325"&gt;  this package contains implementations of Quartz&lt;br /&gt;               support modules (JobStores, ThreadPools, Loggers, etc.) that may have dependencies on       external (third-party) products - but may be more robust.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;src/java/org/quartz/utils&lt;/td&gt;     &lt;td height="17" width="325"&gt; this package contains some utility/helper components used through-out the main Quartz       components.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;src/examples/org/quartz&lt;/td&gt;     &lt;td height="17" width="325"&gt;  this directory contains some examples       usage of Quartz. &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;webapp&lt;/td&gt;     &lt;td height="17" width="325"&gt;      this directory contains       a simple web-app for managing&lt;br /&gt;Quartz schedulers.&lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;     &lt;td height="17" width="163"&gt;lib&lt;/td&gt;     &lt;td height="17" width="325"&gt;                     this directory contains       all third-party libraries that are needed to use all of the features of Quartz.&lt;/td&gt;   &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;Step 5: Open Add JAR/Folder wizard in netbeans like shown below.&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_OIoG5Xsg62c/SAIS4zI0JwI/AAAAAAAAAso/6sJIO2BnlF8/s1600-h/projectWin.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_OIoG5Xsg62c/SAIS4zI0JwI/AAAAAAAAAso/6sJIO2BnlF8/s320/projectWin.jpg" alt="" id="BLOGGER_PHOTO_ID_5188730487693387522" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;Step 6: Add "quartz-all-1.6.0.jar" and all other jars found inside "lib" folder.  See the below figure to see the added jars to the project.&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_OIoG5Xsg62c/SAITRjI0JxI/AAAAAAAAAsw/oBf-NLEDfjo/s1600-h/libs.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_OIoG5Xsg62c/SAITRjI0JxI/AAAAAAAAAsw/oBf-NLEDfjo/s320/libs.jpg" alt="" id="BLOGGER_PHOTO_ID_5188730912895149842" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_OIoG5Xsg62c/R_pDv2DT7PI/AAAAAAAAArM/23gfh_BqeeQ/s1600-h/libs.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_OIoG5Xsg62c/R_pDv2DT7PI/AAAAAAAAArM/23gfh_BqeeQ/s320/libs.jpg" alt="" id="BLOGGER_PHOTO_ID_5186532410112863474" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Step 7: Now the Development Environment is ready.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-1572131741395265628?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2008/04/quartz-job-scheduler-part-1-setting-up.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_OIoG5Xsg62c/R_o5bWDT7MI/AAAAAAAAAq0/lRQlhv752cA/s72-c/newProject.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-976088838887988332</guid><pubDate>Thu, 20 Mar 2008 23:40:00 +0000</pubDate><atom:updated>2008-03-20T16:42:04.200-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">jars</category><title>Collection of Jars in One place</title><description>From the below URL we can find the collection of Java related jars in one place.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.java2s.com/Code/Jar/CatalogJar.htm"&gt;http://www.java2s.com/Code/Jar/CatalogJar.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-976088838887988332?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2008/03/collection-of-jars-in-one-place.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-9092410587661093780</guid><pubDate>Thu, 20 Mar 2008 23:16:00 +0000</pubDate><atom:updated>2008-03-20T16:20:42.603-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IDE</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">NetBeans</category><title>Highlights of NetBeans 6.1</title><description>Highlights of NetBeans 6.1 include:&lt;br /&gt;&lt;br /&gt;* JavaScript support such as semantic highlighting, code completion, type analysis, quick fixes, semantic checks and refactoring;&lt;br /&gt;&lt;br /&gt;* Performance enhancements including faster startup and code completion;&lt;br /&gt;&lt;br /&gt;* Spring framework support with features such as configuration file support, code completion and hyperlinks to speed navigation;&lt;br /&gt;&lt;br /&gt;* New MySQL support in the Database Explorer to make it easier to create, launch and view MySQL databases;&lt;br /&gt;&lt;br /&gt;* Significant enhancements to the Ruby/JRuby support, including a new Ruby platform manager, support for the latest version of Rails and new hints and quick fixes in the editor;&lt;br /&gt;&lt;br /&gt;* Beta support for the ClearCase version control system - made available as a plugin from the Update Center.&lt;br /&gt;&lt;br /&gt;download from --&gt; &lt;a href="http://dlc.sun.com.edgesuite.net/netbeans/6.1/beta/ "&gt;http://dlc.sun.com.edgesuite.net/netbeans/6.1/beta/ &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-9092410587661093780?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2008/03/highlights-of-netbeans-61.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-6964764605900025115</guid><pubDate>Mon, 03 Dec 2007 08:35:00 +0000</pubDate><atom:updated>2007-12-03T01:09:03.058-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">spring</category><title>Spring - Part I</title><description>Here is the simple example to start up with spring,&lt;br /&gt;&lt;br /&gt;To write a simple spring application we need one interface, one implementation of that interface and a test client to test the implementation. Apart form that we also need a configuration XML file.&lt;br /&gt;&lt;br /&gt; One interface --&gt; Hello.java &lt;br /&gt; One implementation --&gt; HelloImpl.java&lt;br /&gt; One Test Client --&gt; HelloClient.java&lt;br /&gt; One Spring XML File --&gt; Hello.xml (Should be in the classpath).&lt;br /&gt;&lt;br /&gt;Now let us see the interface Hello.java.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;package com.javawave.spring.cli;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public interface Hello&lt;br /&gt;{&lt;br /&gt;   /**&lt;br /&gt;    * This method will return the salutation for the name passed as input&lt;br /&gt;    * param to it.&lt;br /&gt;    * &lt;br /&gt;    * @param name&lt;br /&gt;    * @return&lt;br /&gt;    */&lt;br /&gt;   public String sayHello( String name );&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above interface has only one method to say hello. This method has to be implemented in the implementation class "HelloImpl.java"&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;package com.javawave.spring.cli;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public class HelloImpl implements Hello&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   private String greet;&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * zero-arg constructor&lt;br /&gt;    */&lt;br /&gt;   public HelloImpl()&lt;br /&gt;   {&lt;br /&gt;      &lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * @param greet&lt;br /&gt;    */&lt;br /&gt;   public HelloImpl( String greet )&lt;br /&gt;   {&lt;br /&gt;      this.greet = greet;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /*&lt;br /&gt;    * (non-Javadoc)&lt;br /&gt;    * &lt;br /&gt;    * @see com.javawave.spring.cli.Hello#sayHello(java.lang.String)&lt;br /&gt;    */&lt;br /&gt;   public String sayHello( String name )&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;      return this.greet + name;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * @param greet the greet to set&lt;br /&gt;    */&lt;br /&gt;   public void setGreet( String greet )&lt;br /&gt;   {&lt;br /&gt;      this.greet = greet;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The Impl class has a property called greet. This also has a setter method "setGreet" to set the value for this property. &lt;br /&gt;&lt;br /&gt;Now let us see the spring xml. This XML file will be used for creating the objects in spring framework. This XML is also called wiring xml. Through this XML we will set the greet property of the HelloImpl class. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Hello.XML&lt;/span&gt;&lt;br /&gt;~~~~~~~~~&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE beans PUBLIC&lt;br /&gt;"-//SPRING//DTD BEAN//EN"&lt;br /&gt;"http://www.springframework.org/dtd/spring-beans.dtd"&amp;gt;&lt;br /&gt;  &amp;lt;beans&amp;gt;&lt;br /&gt;   &amp;lt;bean id="hello"&lt;br /&gt;         class="com.javawave.spring.cli.HelloImpl"&amp;gt;&lt;br /&gt;     &amp;lt;property name="greet"&amp;gt;&lt;br /&gt;       &amp;lt;value&amp;gt;Good Morning!...&amp;lt;/value&amp;gt;&lt;br /&gt;     &amp;lt;/property&amp;gt;&lt;br /&gt;   &amp;lt;/bean&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Here in the XML you can see the tag called bean which will map to the bean what you are using in the application.  It has an attribute called "id" and a attribute called  "class". The "class" attribute maps to the HelloImpl.java in our case. The property tag inside the bean tag maps to the property inside the bean class. Here in our case it is the "greet" property. The value for the property is given in the value element inside the property element. This is the value passed to the bean's property "greet" . This is how spring does the dependency injection (DI). Here what you are doing is injecting dependency through setter method. This is also called Setter Injection.&lt;br /&gt;&lt;br /&gt;Now we will see the client application "HelloClient.java" to test the "HelloImpl.java".&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;/**&lt;br /&gt; * &lt;br /&gt; */&lt;br /&gt;package com.javawave.spring.cli;&lt;br /&gt;&lt;br /&gt;import org.springframework.beans.factory.BeanFactory;&lt;br /&gt;import org.springframework.beans.factory.xml.XmlBeanFactory;&lt;br /&gt;import org.springframework.core.io.ClassPathResource;&lt;br /&gt;import org.springframework.core.io.Resource;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public class HelloClient&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   /**&lt;br /&gt;    * @param args&lt;br /&gt;    */&lt;br /&gt;   public static void main( String[] args )&lt;br /&gt;   {&lt;br /&gt;      try&lt;br /&gt;      {&lt;br /&gt;         System.out.println( "Inside main of HelloClient.." );&lt;br /&gt;         Resource resource = new ClassPathResource(&lt;br /&gt;               "com/javawave/spring/cli/Hello.xml" );&lt;br /&gt;         BeanFactory factory = new XmlBeanFactory( resource );&lt;br /&gt;         Hello hello = (Hello) factory.getBean( "hello" );&lt;br /&gt;         String result = hello.sayHello( "Man" );&lt;br /&gt;         System.out.println( result );&lt;br /&gt;      }&lt;br /&gt;      catch (Exception e)&lt;br /&gt;      {&lt;br /&gt;         System.out.println( "Exception/Error:" + e.toString() );&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This client application uses ClassPathResource to load the resource. In our case Hello.xml and it creates the factory via XmlBeanFactory. factory class has getBean method which will return a object. Here we get Hello object. So from that we can call sayHello method as shown in the above code and get the result.&lt;br /&gt;&lt;br /&gt;The Jars used for this application is:&lt;br /&gt;  spring.jar&lt;br /&gt;  commons-logging.jar&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The Output is shown below&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;Inside main of HelloClient..&lt;br /&gt;Good Morning!...Man&lt;br /&gt;Dec 3, 2007 1:59:01 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions&lt;br /&gt;INFO: Loading XML bean definitions from class path resource [com/javawave/spring/cli/Hello.xml]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-6964764605900025115?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/12/spring-part-i.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-6566860832168955380</guid><pubDate>Fri, 30 Nov 2007 09:03:00 +0000</pubDate><atom:updated>2007-11-30T01:21:50.065-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><title>Comparing two Value Objects in Java</title><description>In Java comparing two value object is not straight forward.  Here we will see how we can compare two value objects in Java.&lt;br /&gt;&lt;br /&gt;For that first we will create a value object called "MyValueObject". This value object contains two properties. 1) firstName 2) lastName. Both the properties are of type string.&lt;br /&gt;&lt;br /&gt;In the same class we also have a overridden method which does the comparison for us. This method "public boolean equals(Object obj)" takes the properties and compare them individually. if the properties values are all equal then it returns true or it will return false. By doing this our test class will just call the equals method on the object to make sure if the objects are equal or not.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Code is listed below&lt;/span&gt;.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;/*&lt;br /&gt; */&lt;br /&gt;package com.blogspot.javawave;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public class MyValueObject&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    private String firstName;&lt;br /&gt;    private String lastName;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This constructor is used to set the two properties values in the class.&lt;br /&gt;     *&lt;br /&gt;     * @param firstName&lt;br /&gt;     * @param lastName&lt;br /&gt;     */&lt;br /&gt;    public MyValueObject(String firstName,&lt;br /&gt;                          String lastName)&lt;br /&gt;    {&lt;br /&gt;        this.firstName = firstName;&lt;br /&gt;        this.lastName = lastName;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public boolean equals(Object obj)&lt;br /&gt;    {&lt;br /&gt;        boolean isEqual = false;&lt;br /&gt;        if (this.getClass() == obj.getClass())&lt;br /&gt;        {&lt;br /&gt;            MyValueObject myValueObject = (MyValueObject) obj;&lt;br /&gt;            if ((myValueObject.firstName).equals(this.firstName) &amp;amp;&amp;amp;&lt;br /&gt;                    (myValueObject.lastName).equals(this.lastName))&lt;br /&gt;            {&lt;br /&gt;                isEqual = true;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return isEqual;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Test class is given below:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;/*&lt;br /&gt; */&lt;br /&gt;package com.blogspot.javawave;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *This class is used to test compare the value object.&lt;br /&gt; *&lt;br /&gt; * @author dhanago&lt;br /&gt; */&lt;br /&gt;public class TestCompareValueObject&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * This is the main method used to test compare the value object.&lt;br /&gt;     * @param arg&lt;br /&gt;     */&lt;br /&gt;    public static void main(String[] arg)&lt;br /&gt;    {&lt;br /&gt;        MyValueObject obj1 = new MyValueObject("Muthu", "Kumar");&lt;br /&gt;        MyValueObject obj2 = new MyValueObject("Muthu", "Kumar");&lt;br /&gt;       &lt;br /&gt;        if (obj1.equals(obj2))&lt;br /&gt;        {&lt;br /&gt;            System.out.println("Both the objects are equal");&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            System.out.println("Both the objects are not equal");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This one of the way we can easily compare the value objects in Java&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-6566860832168955380?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/11/comparing-two-value-objects-in-java.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-3228240150491346279</guid><pubDate>Tue, 13 Nov 2007 16:49:00 +0000</pubDate><atom:updated>2007-11-13T08:51:03.471-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SOA</category><category domain="http://www.blogger.com/atom/ns#">Web Services</category><title>SOA principles</title><description>&lt;h2&gt;&lt;span class="mw-headline"&gt;SOA principles&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;The following &lt;b&gt;guiding principles&lt;/b&gt; define the ground rules for development, maintenance, and usage of the SOA&lt;sup id="_ref-6" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Service-oriented_architecture#_note-6" title=""&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Reuse, &lt;a href="http://en.wikipedia.org/wiki/Granularity" title="Granularity"&gt;granularity&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Modularity_%28programming%29" title="Modularity (programming)"&gt;modularity&lt;/a&gt;, composability, componentization, and &lt;a href="http://en.wikipedia.org/wiki/Interoperability" title="Interoperability"&gt;interoperability&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Compliance to standards (both common and industry-specific)&lt;/li&gt;&lt;li&gt;Services identification and categorization, provisioning and delivery, and monitoring and tracking&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The following &lt;b&gt;specific architectural principles&lt;/b&gt; for design and service definition focus on specific themes that influence the intrinsic behaviour of a system and the style of its design:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;b&gt;Service &lt;a href="http://en.wikipedia.org/wiki/Encapsulation" title="Encapsulation"&gt;Encapsulation&lt;/a&gt;&lt;/b&gt; - A lot of existing web-services are consolidated to be used under the SOA Architecture. Many a times, such services have not been planned to be under SOA.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service &lt;a href="http://en.wikipedia.org/wiki/Loose_coupling" title="Loose coupling"&gt;Loose coupling&lt;/a&gt;&lt;/b&gt; - Services maintain a relationship that minimizes dependencies and only requires that they maintain an awareness of each other&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Service-oriented_architecture#Service_contract" title=""&gt;Service contract&lt;/a&gt;&lt;/b&gt; - Services adhere to a communications agreement, as defined collectively by one or more service description documents&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service abstraction&lt;/b&gt; - Beyond what is described in the service contract, services hide logic from the outside world&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service reusability&lt;/b&gt; - Logic is divided into services with the intention of promoting reuse&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service composability&lt;/b&gt; - Collections of services can be coordinated and assembled to form composite services&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service autonomy&lt;/b&gt; – Services have control over the logic they encapsulate&lt;/li&gt;&lt;li&gt;&lt;b&gt;Service optimization&lt;/b&gt; – All else equal, high-quality services are generally considered preferable to low-quality ones&lt;/li&gt;&lt;li&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Service_discovery" title="Service discovery"&gt;Service discoverability&lt;/a&gt;&lt;/b&gt; – Services are designed to be outwardly descriptive so that they can be found and assessed via available discovery mechanisms&lt;sup id="_ref-7" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Service-oriented_architecture#_note-7" title=""&gt;[9]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;In addition, the following factors should also be taken into account when defining a SOA implementation:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;SOA Reference Architecture covers the SOA Reference Architecture, which provides a worked design of an enterprise-wide SOA implementation with detailed architecture diagrams, component descriptions, detailed requirements, design patterns, opinions about standards, patterns on regulation compliance, standards templates etc.&lt;sup id="_ref-8" class="reference"&gt;&lt;a href="http://en.wikipedia.org/wiki/Service-oriented_architecture#_note-8" title=""&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;&lt;li&gt;Life cycle management &lt;a href="http://www.soablueprint.com/whitepapers/SOAPGPart3.pdf" class="external text" title="http://www.soablueprint.com/whitepapers/SOAPGPart3.pdf" rel="nofollow"&gt;SOA Practitioners Guide Part 3: Introduction to Services Lifecycle&lt;/a&gt; introduces the Services Lifecycle and provides a detailed process for services management though the service lifecycle, from inception through to retirement or repurposing of the services. It also contains an appendix that includes organization and governance best practices, templates, comments on key SOA standards, and recommended links for more information.&lt;/li&gt;&lt;li&gt;Efficient use of system resources&lt;/li&gt;&lt;li&gt;Service maturity and performance&lt;/li&gt;&lt;li&gt;EAI Enterprise Application Integration&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-3228240150491346279?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/11/soa-principles.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-1440051681495165783</guid><pubDate>Fri, 02 Nov 2007 09:41:00 +0000</pubDate><atom:updated>2007-11-02T02:42:42.859-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Web Services</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>What is WSDL?</title><description>&lt;div class="sidebar"&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;                 WSDL stands for Web Services Description Language. A &lt;span style="font-style: italic;"&gt;WSDL &lt;/span&gt;file is an &lt;span style="font-style: italic;"&gt;XML &lt;/span&gt;document that describes a Web                  service. It specifies the location of the service and the operations (or methods) the service exposes.                 For more information about WSDL, refer to the                  &lt;a xlink="http://www.w3.org/1999/xlink" href="http://www.w3.org/TR/wsdl" target="_top"&gt;WSDL specification&lt;/a&gt;, or read the                  &lt;a xlink="http://www.w3.org/1999/xlink" href="http://www.w3schools.com/wsdl/" target="_top"&gt;WSDL tutorial&lt;/a&gt;&lt;/span&gt;             &lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-1440051681495165783?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/11/what-is-wsdl.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-4913515863435915095</guid><pubDate>Sat, 13 Oct 2007 16:22:00 +0000</pubDate><atom:updated>2007-10-13T09:25:57.940-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>Java Excel API</title><description>&lt;p&gt;&lt;b&gt;Where to get the &lt;/b&gt;&lt;b&gt;jexcelapi&lt;/b&gt;&lt;b&gt;?&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;Get the API download form --&amp;gt; &lt;a title="http://jexcelapi.sourceforge.net/" target="_blank" href="http://jexcelapi.sourceforge.net/" id="igco"&gt;http://jexcelapi.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What is jexcelapi ?&lt;/b&gt;&lt;br /&gt;&lt;p&gt;A Java API to read, write, and modify Excel spreadsheets.&lt;/p&gt;&lt;p&gt;Now java developers can read Excel spreadsheets, modify them with a convenient and&lt;br /&gt;&lt;/p&gt;&lt;p&gt;simple API, and   write the changes to any output stream (e.g. disk, HTTP, database, or&lt;br /&gt;&lt;/p&gt;&lt;p&gt;any socket).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Because it is Java, the API can be    invoked from within a servlet, thus giving access to&lt;/p&gt;&lt;p&gt; Excel spreadsheets   over internet and intranet web applications.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;b&gt;Features of jexcelapi&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;table border="0" cellpadding="3" cellspacing="0" height="218" width="573"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td colspan="2"&gt;Reads data from Excel 95, 97, 2000, &lt;span style="color:red;"&gt;XP, and 2003&lt;/span&gt; workbooks   &lt;br /&gt;Reads and writes formulas (Excel 97 and later only)  &lt;br /&gt;Generates spreadsheets in Excel 2000 format Supports font, number and date formatting Supports shading, bordering, and coloring of cells Modifies existing worksheets Is internationalized, enabling processing in almost any locale, country, language, or character encoding (formulas are currently only supported in English, French, Spanish, and German, but more can be added if translated) Supports copying of charts &lt;span style="color:red;"&gt;Supports insertion and copying of images into spreadsheets&lt;/span&gt;   Supports logging with Jakarta Commons Logging, log4j, JDK 1.4 Logger, etc   ...and much more.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;      Technical notes ==&amp;gt; &lt;a title="http://www.andykhan.com/jexcelapi/technotes.html" target="_blank" href="http://www.andykhan.com/jexcelapi/technotes.html" id="gm7t"&gt;http://www.andykhan.com/jexcelapi/technotes.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; &lt;p&gt;JExcelApi JavaDoc ==&amp;gt; &lt;a title="http://jexcelapi.sourceforge.net/resources/javadocs/index.html" target="_blank" href="http://jexcelapi.sourceforge.net/resources/javadocs/index.html" id="onja"&gt;http://jexcelapi.sourceforge.net/resources/javadocs/index.html&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;b&gt;Pre-Requirements&lt;/b&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Should be knowing basic concepts of Java.&lt;/li&gt;&lt;li&gt;Should know how to set class path to use third party Api's.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Now we will see how to read a spread sheet using this API&lt;/b&gt;:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;First of all we will create a spread sheet like the one below and store it in our local folder.&lt;/p&gt;&lt;p&gt;I am saving this file in "D:testmyFile.xls"&lt;br /&gt;&lt;/p&gt;&lt;img src="post-edit.g?blogID=3404003298352104506&amp;amp;postID=8242921327018719891" alt="" /&gt;&lt;br /&gt;&lt;img src="http://docs.google.com/File?id=dv968zb_75dfkqw2d4" /&gt;&lt;br /&gt;&lt;div id="j-za" style="padding: 1em 0pt; text-align: left;"&gt;To read the spread sheet content using jxl Api, first we have to create an object called&lt;br /&gt;Workbook. Once you create the Workbook then you will get access to individual sheets.&lt;br /&gt;Note that these sheets are Zero indexed.&lt;br /&gt;So you have to use some thing like workbook.getSheet(0);&lt;br /&gt;&lt;br /&gt;Once you get the sheet then you can easily get the cells and their content as string.&lt;br /&gt;If you want it is also possible to get the data with out changing the type as it is.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;See the sample code below (&lt;/u&gt;&lt;i&gt;&lt;u&gt;SpreadsheetReader.java&lt;/u&gt;&lt;/i&gt;&lt;u&gt;)&lt;/u&gt;.&lt;br /&gt;&lt;br /&gt;package com.jxl.dhanago;&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import jxl.Cell;&lt;br /&gt;import jxl.Sheet;&lt;br /&gt;import jxl.Workbook;&lt;br /&gt;import jxl.read.biff.BiffException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* This Java program is used to read the spread sheet and print it in&lt;br /&gt;* console output.&lt;br /&gt;*&lt;br /&gt;* @author dhanago&lt;br /&gt;*/&lt;br /&gt;public class SpreadsheetReader&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This method is used to read a spread sheet and print it in console.&lt;br /&gt;   *&lt;br /&gt;   * @param xlsPath&lt;br /&gt;   */&lt;br /&gt;  public void readSpreadSheet( String xlsPath )&lt;br /&gt;  {&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;        /*&lt;br /&gt;         * To read the spread sheet , first we have to create a workbook&lt;br /&gt;         * object like one shown below.&lt;br /&gt;         */&lt;br /&gt;        Workbook workbook = Workbook.getWorkbook( new File( xlsPath ) );&lt;br /&gt;        /*&lt;br /&gt;         * then get the sheet index 0. Note the index starts with 0.&lt;br /&gt;         */&lt;br /&gt;        Sheet sheet = workbook.getSheet( 0 );&lt;br /&gt;        /*&lt;br /&gt;         * get the cell form the sheet object like below.&lt;br /&gt;         */&lt;br /&gt;        Cell cell00 = sheet.getCell( 0, 0 );&lt;br /&gt;        Cell cell01 = sheet.getCell( 0, 1 );&lt;br /&gt;        Cell cell02 = sheet.getCell( 0, 2 );&lt;br /&gt;&lt;br /&gt;        /*&lt;br /&gt;         * now we will display the cell values as string in console output.&lt;br /&gt;         */&lt;br /&gt;        System.out.println( "Cell00 value: " + cell00.getContents() );&lt;br /&gt;        System.out.println( "Cell01 value: " + cell01.getContents() );&lt;br /&gt;        System.out.println( "Cell02 value: " + cell02.getContents() );&lt;br /&gt;         // free up memory&lt;br /&gt;        workbook.close();&lt;br /&gt;     }&lt;br /&gt;     catch (BiffException e)&lt;br /&gt;     {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;     }&lt;br /&gt;     catch (IOException e)&lt;br /&gt;     {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This is the main executable method used to test the spread sheet&lt;br /&gt;   * reader.&lt;br /&gt;   *&lt;br /&gt;   * @param args&lt;br /&gt;   */&lt;br /&gt;  public static void main( String[] args )&lt;br /&gt;  {&lt;br /&gt;     SpreadsheetReader readSpreadsheet = new SpreadsheetReader();&lt;br /&gt;     String xlsPath = "D:\test\myFile.xls";&lt;br /&gt;     readSpreadsheet.readSpreadSheet( xlsPath );&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;u&gt;OutPut for the above code:&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Cell00 value: Name&lt;br /&gt;Cell01 value: Muthukumar Dhanagopal&lt;br /&gt;Cell02 value: Krish&lt;br /&gt;&lt;br /&gt;The above code displays the cell values as string. How to get the same&lt;br /&gt;data type and display them with out converting them to string. Is that&lt;br /&gt;possible using this API?&lt;br /&gt;&lt;br /&gt;Yes, it is possible.&lt;br /&gt;&lt;i&gt;&lt;u&gt;Here is the code which does the same for you&lt;/u&gt;&lt;/i&gt;.&lt;br /&gt;It checks the cell type for LABEL,  NUMBER or DATE and then gets the value from&lt;br /&gt;the cell type cast the value to that particular data type and displays it on the console.&lt;br /&gt;&lt;br /&gt;package com.jxl.dhanago;&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;&lt;br /&gt;import jxl.Cell;&lt;br /&gt;import jxl.CellType;&lt;br /&gt;import jxl.DateCell;&lt;br /&gt;import jxl.LabelCell;&lt;br /&gt;import jxl.NumberCell;&lt;br /&gt;import jxl.Sheet;&lt;br /&gt;import jxl.Workbook;&lt;br /&gt;import jxl.read.biff.BiffException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* This java program is used to get and display the xls data according to&lt;br /&gt;* the type.&lt;br /&gt;*&lt;br /&gt;* @author dhanago&lt;br /&gt;*/&lt;br /&gt;public class ReadXLWithExactDataType&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This method is used to display the xls data with exact type.&lt;br /&gt;   *&lt;br /&gt;   * @param xlsPath&lt;br /&gt;   */&lt;br /&gt;  public void readDataWithType( String xlsPath )&lt;br /&gt;  {&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;        /*&lt;br /&gt;         * To read the spread sheet , first we have to create a workbook&lt;br /&gt;         * object like one shown below.&lt;br /&gt;         */&lt;br /&gt;        Workbook workbook = Workbook.getWorkbook( new File( xlsPath ) );&lt;br /&gt;        /*&lt;br /&gt;         * then get the sheet index 0. Note the index starts with 0.&lt;br /&gt;         */&lt;br /&gt;        Sheet sheet = workbook.getSheet( 0 );&lt;br /&gt;        /*&lt;br /&gt;         * get the cell form the sheet object like below.&lt;br /&gt;         */&lt;br /&gt;        Cell cell00 = sheet.getCell( 0, 0 );&lt;br /&gt;&lt;br /&gt;        if (cell00.getType() == CellType.LABEL)&lt;br /&gt;        {&lt;br /&gt;           System.out.println( "Type LABEL" );&lt;br /&gt;           LabelCell labelCell = (LabelCell) cell00;&lt;br /&gt;           System.out.println( "Label Cell: " + labelCell.getString() );&lt;br /&gt;        }&lt;br /&gt;        else if (cell00.getType() == CellType.NUMBER)&lt;br /&gt;        {&lt;br /&gt;           System.out.println( "Type NUMBER" );&lt;br /&gt;           NumberCell numberCell = (NumberCell) cell00;&lt;br /&gt;           System.out.println( "Number Cell: " + numberCell.getValue() );&lt;br /&gt;        }&lt;br /&gt;        else if (cell00.getType() == CellType.DATE)&lt;br /&gt;        {&lt;br /&gt;           System.out.println( "Type DATE" );&lt;br /&gt;           DateCell dateCell = (DateCell) cell00;&lt;br /&gt;           System.out.println( "Date Cell: " + dateCell.getDate() );&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;           System.out.println( "Type not supported." );&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        /*&lt;br /&gt;         * now we will display the cell values as string in console output.&lt;br /&gt;         */&lt;br /&gt;        System.out.println( "Cell00 value: " + cell00.getContents() );&lt;br /&gt;        // free up memory&lt;br /&gt;        workbook.close();&lt;br /&gt;     }&lt;br /&gt;     catch (BiffException e)&lt;br /&gt;     {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;     }&lt;br /&gt;     catch (IOException e)&lt;br /&gt;     {&lt;br /&gt;        e.printStackTrace();&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This is the main executable method used to test the spread sheet&lt;br /&gt;   * reader.&lt;br /&gt;   *&lt;br /&gt;   * @param args&lt;br /&gt;   */&lt;br /&gt;  public static void main( String[] args )&lt;br /&gt;  {&lt;br /&gt;     ReadXLWithExactDataType readXL = new ReadXLWithExactDataType();&lt;br /&gt;     String xlsPath = "D:\test\myFile.xls";&lt;br /&gt;     readXL.readDataWithType( xlsPath );&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;u&gt;The Output for the above code is&lt;/u&gt;&lt;/i&gt;:&lt;br /&gt;Type LABEL&lt;br /&gt;Label Cell: Name&lt;br /&gt;Cell00 value: Name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-4913515863435915095?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/10/java-excel-api.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-6228534997984855908</guid><pubDate>Wed, 10 Oct 2007 09:49:00 +0000</pubDate><atom:updated>2007-10-10T02:52:34.209-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Rule Engine</category><category domain="http://www.blogger.com/atom/ns#">Artificial Intelligence</category><category domain="http://www.blogger.com/atom/ns#">JBoss</category><category domain="http://www.blogger.com/atom/ns#">Drools</category><title>Rule Engine - Drools</title><description>What is a Rule Engine?&lt;br /&gt;&lt;p&gt;Artificial Intelligence (A.I.) is a very broad research area that focuses on  "Making computers think like people" and includes disciplines such as Neural  Networks, Genetic Algorithms, Decision Trees, Frame Systems and Expert Systems.  Knowledge representation is the area of A.I. concerned with how knowledge is  represented and manipulated. Expert Systems use Knowledge representation to  facilitate the codification of knowledge into a knowledge base which can be used  for reasoning - i.e. we can process data with this knowledge base to infer  conclusions. Expert Systems are also known as Knowledge-based Systems and  Knowledge-based Expert Systems and are considered 'applied artificial  intelligence'. The process of developing with an Expert System is Knowledge  Engineering. EMYCIN was one of the first "shells" for an Expert System, which  was created from the MYCIN medical diagnosis Expert System. Where-as early  Expert Systems had their logic hard coded, "shells" separated the logic from the  system, providing an easy to use environment for user input. Drools is a Rule  Engine that uses the Rule Based approached to implement an Expert System and is  more correctly classified as a Production Rule System.&lt;/p&gt; &lt;p&gt;The term "Production Rule" originates from formal grammar - where it is  described as "an abstract structure that describes a formal language precisely,  i.e., a set of rules that mathematically delineates a (usually infinite) set of  finite-length strings over a (usually finite) alphabet" (&lt;a class="ulink" href="http://en.wikipedia.org/wiki/Formal_grammar" target="_top"&gt;wikipedia&lt;/a&gt;).&lt;/p&gt;For more information visit the following URL&lt;br /&gt;&lt;a href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/html/ch02.html"&gt;https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/html/ch02.html &lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-6228534997984855908?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/10/rule-engine-drools.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-8447843447988659005</guid><pubDate>Wed, 10 Oct 2007 07:20:00 +0000</pubDate><atom:updated>2007-10-10T00:21:45.572-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IDE</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Eclipse</category><category domain="http://www.blogger.com/atom/ns#">JBoss</category><title>JBoss server in Eclipse</title><description>&lt;span style="font-weight: bold;"&gt;Defining JBoss server in Eclipse&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;Step 1 : Open Eclipse WTP all in one pack in a new work space.&lt;br /&gt;&lt;br /&gt;Step 2 : Change the perspective to J2EE Perspective if it is not currently in J2EE Perspective.&lt;br /&gt;&lt;br /&gt;Step 3 : Once the Perspective is changed to J2EE, you can see a tab called Servers in the bottom right panel along with Problems, Tasks, Properties.&lt;br /&gt;&lt;br /&gt;Step 4 : If the Servers tab is not found. Go to Eclipse menu : Windows &gt; Show view and click on Servers, so that Server tab will be displayed.&lt;br /&gt;&lt;br /&gt;Step 5 : Go to Servers tab window and right click the mouse. You will get a pop up menu called "New".&lt;br /&gt;&lt;br /&gt;Step 6 : Clicking on the New menu you will get one more pop up called "Server". Click on it.&lt;br /&gt;&lt;br /&gt;Step 7 : Now you will get Define New Server Wizard.&lt;br /&gt;&lt;br /&gt;Step 8 : In the wizard there are options to define many servers. One among them is JBoss. Click on JBoss and Expand the tree.&lt;br /&gt;&lt;br /&gt;Step 9 : Select JBoss v 4.0 and click next.&lt;br /&gt;&lt;br /&gt;Step 10 : Now give the JDK directory and JBoss home directory. Click Next.&lt;br /&gt;&lt;br /&gt;Step 11 : Now the wizard will show you the default Address, port, etc., Leave it as it is and click on Next.&lt;br /&gt;&lt;br /&gt;Step 12 : Click on finish.&lt;br /&gt;&lt;br /&gt;Step 13 : Now you can see the JBoss server listed in the Servers window and the status is Sopped.&lt;br /&gt;&lt;br /&gt;Step 14 : JBoss server is now defined in Eclipse now and its ready to use from with in Eclipse IDE.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-8447843447988659005?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/10/jboss-server-in-eclipse.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-5418282162355230520</guid><pubDate>Mon, 08 Oct 2007 12:04:00 +0000</pubDate><atom:updated>2007-10-08T22:04:57.816-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>DOM parsing technique</title><description>&lt;span style="color: rgb(0, 0, 255);font-family:Arial;font-size:85%;"  &gt; &lt;/span&gt;&lt;div style="color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;This class follows the DOM parsing technique and does the  following.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; 1.Parse the demoxml.xml file.&lt;br /&gt;2.Search for the xml node  by the name "parent1" from the xml.&lt;br /&gt;3.Create a new child node by the name  "newChild"&lt;br /&gt;4.Create a text("new child of the parent1") to the "newChild"  node&lt;br /&gt;5.Append the "newChild" node to "parent1" node.&lt;br /&gt;6.Save the  changes (transform) to the xml.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sample Code&lt;/span&gt;: (&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt;DOMParser.java)&lt;/span&gt;&lt;/div&gt; &lt;div style="color: rgb(0, 0, 0);"&gt;&lt;span style=";font-family:Arial;font-size:85%;"  &gt; &lt;/span&gt;&lt;/div&gt;package com.dom.dhanago;&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt; * This class follows the DOM parsing technique and does the following.&lt;br /&gt; * 1.Parse the demoxml.xml file. 2.Search for the xml node by the name&lt;br /&gt; * "parent1" from the xml. 3.Create a new child node by the name "newChild"&lt;br /&gt; * 4.Create a text("new child of the parent1") to the "newChild" node&lt;br /&gt; * 5.Append the "newChild" node to "parent1" node. 6.Save the changes&lt;br /&gt; * (transform) to the xml.&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;&lt;br /&gt;import javax.xml.parsers.DocumentBuilder;&lt;br /&gt;import javax.xml.parsers.DocumentBuilderFactory;&lt;br /&gt;import javax.xml.transform.Result;&lt;br /&gt;import javax.xml.transform.Source;&lt;br /&gt;import javax.xml.transform.Transformer;&lt;br /&gt;import javax.xml.transform.TransformerFactory;&lt;br /&gt;import javax.xml.transform.dom.DOMSource;&lt;br /&gt;import javax.xml.transform.stream.StreamResult;&lt;br /&gt;&lt;br /&gt;import org.w3c.dom.Document;&lt;br /&gt;import org.w3c.dom.Element;&lt;br /&gt;import org.w3c.dom.NodeList;&lt;br /&gt;&lt;br /&gt;public class DOMParser&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;   public static void main( String[] args )&lt;br /&gt;   {&lt;br /&gt;      try&lt;br /&gt;      {&lt;br /&gt;         DocumentBuilderFactory factory = DocumentBuilderFactory&lt;br /&gt;               .newInstance();&lt;br /&gt;         DocumentBuilder builder = factory.newDocumentBuilder();&lt;br /&gt;         Document document;&lt;br /&gt;         document = builder.parse( new File( "C:\\demoxml.xml" ) );&lt;br /&gt;         /*&lt;br /&gt;          * You can pass either xml file or string.To fetch the root element&lt;br /&gt;          * of the xml document.&lt;br /&gt;          */&lt;br /&gt;         Element rootEle = document.getDocumentElement();&lt;br /&gt;         /*&lt;br /&gt;          * To fetch all the child nodes of the root element.&lt;br /&gt;          */&lt;br /&gt;         NodeList childNodes = rootEle.getChildNodes();&lt;br /&gt;         /*&lt;br /&gt;          * To search an element from the whole document.&lt;br /&gt;          */&lt;br /&gt;         NodeList parentNode = document.getElementsByTagName( "parent1" );&lt;br /&gt;         /*&lt;br /&gt;          * To create a new child element by the name "newChild".&lt;br /&gt;          */&lt;br /&gt;         Element newChild = document.createElement( "newChild" );&lt;br /&gt;         /*&lt;br /&gt;          * Adding text data to "newChild".&lt;br /&gt;          */&lt;br /&gt;         newChild.appendChild( document&lt;br /&gt;               .createTextNode( "new Child of the parent1 node" ) );&lt;br /&gt;&lt;br /&gt;         /*&lt;br /&gt;          * To append the "newChild" ,created above.&lt;br /&gt;          */&lt;br /&gt;         parentNode.item( 0 ).appendChild( newChild );&lt;br /&gt;&lt;br /&gt;         TransformerFactory tranFactory = TransformerFactory.newInstance();&lt;br /&gt;         Transformer aTransformer = tranFactory.newTransformer();&lt;br /&gt;&lt;br /&gt;         /*&lt;br /&gt;          * Preparing the source which is the document created above.&lt;br /&gt;          */&lt;br /&gt;         Source srcDocument = new DOMSource( document );&lt;br /&gt;         /*&lt;br /&gt;          * Destination will be same different xml.&lt;br /&gt;          */&lt;br /&gt;         Result destxml = new StreamResult( new File( "C:\\demoxml.xml" ) );&lt;br /&gt;         /*&lt;br /&gt;          * Transforming document to destination xml.&lt;br /&gt;          */&lt;br /&gt;         aTransformer.transform( srcDocument, destxml );&lt;br /&gt;         System.out.println( "Successfully transformed" );&lt;br /&gt;      }&lt;br /&gt;      catch (Exception e)&lt;br /&gt;      {&lt;br /&gt;         System.out.println( "exec " + e );&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-5418282162355230520?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/10/dom-parsing-technique.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-2857628350230392862</guid><pubDate>Fri, 05 Oct 2007 09:54:00 +0000</pubDate><atom:updated>2007-10-05T03:39:04.922-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>Code to convert from Xml-String to Document and Document to String</title><description>package ora.in;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.StringReader;&lt;br /&gt;import java.io.StringWriter;&lt;br /&gt;&lt;br /&gt;import javax.xml.parsers.DocumentBuilder;&lt;br /&gt;import javax.xml.parsers.DocumentBuilderFactory;&lt;br /&gt;import javax.xml.parsers.FactoryConfigurationError;&lt;br /&gt;import javax.xml.parsers.ParserConfigurationException;&lt;br /&gt;import javax.xml.transform.Result;&lt;br /&gt;import javax.xml.transform.Source;&lt;br /&gt;import javax.xml.transform.Transformer;&lt;br /&gt;import javax.xml.transform.TransformerFactory;&lt;br /&gt;import javax.xml.transform.dom.DOMSource;&lt;br /&gt;import javax.xml.transform.stream.StreamResult;&lt;br /&gt;&lt;br /&gt;import org.w3c.dom.Document;&lt;br /&gt;import org.xml.sax.InputSource;&lt;br /&gt;import org.xml.sax.SAXException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Code to convert from Xml-String to Document and Document to String.&lt;br /&gt;*&lt;br /&gt;* @author Muthu&lt;br /&gt;*/&lt;br /&gt;public class S2DandD2S&lt;br /&gt;{&lt;br /&gt;  public static Document loadXmlFileToDocument( String strXml,&lt;br /&gt;        boolean ignoreComments )&lt;br /&gt;  {&lt;br /&gt;     Document docRet = null;&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;        DocumentBuilderFactory factory = DocumentBuilderFactory&lt;br /&gt;              .newInstance();&lt;br /&gt;        factory.setIgnoringComments( ignoreComments );&lt;br /&gt;        DocumentBuilder docBuilder = factory.newDocumentBuilder();&lt;br /&gt;        docRet = docBuilder.parse( new InputSource( new StringReader(&lt;br /&gt;              strXml ) ) );&lt;br /&gt;     }&lt;br /&gt;     catch (SAXException e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( "SAXException" );&lt;br /&gt;     }&lt;br /&gt;     catch (IOException e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( "IOException" );&lt;br /&gt;     }&lt;br /&gt;     catch (ParserConfigurationException e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( "ParserConfigurationException" );&lt;br /&gt;     }&lt;br /&gt;     catch (FactoryConfigurationError e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( "FactoryConfigurationError" );&lt;br /&gt;     }&lt;br /&gt;     return docRet;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * @param args&lt;br /&gt;   */&lt;br /&gt;  public static void main( String[] args )&lt;br /&gt;  {&lt;br /&gt;     try&lt;br /&gt;     {&lt;br /&gt;        String xml = "Some exception file as string&lt;javawave xsi="\&amp;quot;http://www.w3.org/2001/&amp;quot;"&gt;&lt;/javawave&gt;";&lt;br /&gt;&lt;br /&gt;        Document document = loadXmlFileToDocument( xml, false );&lt;br /&gt;        TransformerFactory tranFactory = TransformerFactory.newInstance();&lt;br /&gt;        Transformer aTransformer = tranFactory.newTransformer();&lt;br /&gt;&lt;br /&gt;        Source srcDocument = new DOMSource( document );&lt;br /&gt;&lt;br /&gt;        // Preparing the source which is the document created above.&lt;br /&gt;        StringWriter writer = new StringWriter();&lt;br /&gt;        Result destxml = new StreamResult( writer );&lt;br /&gt;&lt;br /&gt;        // Transformingdocument to destination xml.&lt;br /&gt;        aTransformer.transform( srcDocument, destxml );&lt;br /&gt;&lt;br /&gt;        System.out.println( writer.toString() );&lt;br /&gt;        System.out.println( "Successfully transformed" );&lt;br /&gt;     }&lt;br /&gt;     catch (Exception e)&lt;br /&gt;     {&lt;br /&gt;        System.out.println( "exec " + e );&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-2857628350230392862?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/10/code-to-convert-from-xml-string-to.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-3532592915192543329</guid><pubDate>Fri, 05 Oct 2007 08:29:00 +0000</pubDate><atom:updated>2007-10-05T01:34:02.031-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Tips</category><category domain="http://www.blogger.com/atom/ns#">xml</category><title>Parsing Java InputStream To Text and Vice Versa</title><description>&lt;p&gt;&lt;span&gt;Here are couple of useful methods to convert from InputStream to  String&lt;br /&gt;and vice versa.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;&lt;b&gt;&lt;u&gt;Input Stream to String&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br /&gt;public String  parseISToString(java.io.InputStream is){&lt;br /&gt;java.io.DataInputStream din = new  java.io.DataInputStream(is);&lt;br /&gt;StringBuffer sb = new  StringBuffer();&lt;br /&gt;try{&lt;br /&gt;String line = null;&lt;br /&gt;while((line=din.readLine()) !=  null){&lt;br /&gt;sb.append(line+"\n");&lt;br /&gt;}&lt;br /&gt;}catch(Exception  ex){&lt;br /&gt;ex.getMessage();&lt;br /&gt;}finally{&lt;br /&gt;try{&lt;br /&gt;is.close();&lt;br /&gt;}catch(Exception  ex){}&lt;br /&gt;}&lt;br /&gt;return sb.toString();&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span&gt;&lt;b&gt;&lt;u&gt;String to InputStream&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br /&gt;public java.io.InputStream  parseStringToIS(String xml){&lt;br /&gt;if(xml==null) return null;&lt;br /&gt;xml =  xml.trim();&lt;br /&gt;java.io.InputStream in = null;&lt;br /&gt;try{&lt;br /&gt;in = new  java.io.ByteArrayInputStream(xml.getBytes("UTF-8"));&lt;br /&gt;}catch(Exception  ex){&lt;br /&gt;}&lt;br /&gt;return in;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-3532592915192543329?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/10/parsing-java-inputstream-to-text-and.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8048745819635601540.post-9065324942779299762</guid><pubDate>Fri, 21 Sep 2007 14:15:00 +0000</pubDate><atom:updated>2007-09-21T07:50:54.144-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SOAP</category><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">Web Services</category><category domain="http://www.blogger.com/atom/ns#">Axis</category><title>Happy Axis</title><description>&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;h3&gt;Introduction&lt;/h3&gt;                     &lt;p&gt;                         Axis is a web service engine. It is the third generation of apache soap.&lt;br&gt;                         To know about webservices it is mandatory to know about SOAP. &lt;br&gt;&lt;/p&gt;&lt;p&gt;This artical will gives you the brief introduction on SOAP. &lt;br&gt;&lt;/p&gt;&lt;p&gt;Then it will introduce you to Apache Axis 1.4.                          Then we will also tell about the diffrent styles &lt;br&gt;&lt;/p&gt;&lt;p&gt;of webservices in brief. &lt;br&gt;&lt;/p&gt;&lt;p&gt;The article will conclude by giving a sample application, explaining how to deploy webservice &lt;br&gt;&lt;/p&gt;&lt;p&gt;in axis?                          How to call the deployed webservice?                      &lt;/p&gt;                     &lt;h3&gt;Pre-Requesties&lt;/h3&gt;                     &lt;p&gt;	                         &lt;/p&gt;&lt;ul&gt;&lt;li&gt;                                 This artical assumes that you already know how to write a java code, compile and run.                              &lt;/li&gt;&lt;li&gt;You should also have a servlet engine or an application server already configured.                              &lt;/li&gt;&lt;li&gt; You should be familiar with web application deployment scenarios and how to start and &lt;/li&gt;&lt;/ul&gt;stop the server. &lt;ul&gt;&lt;li&gt; We recommend Jakarta Tomcat. [If you are installing Tomcat, get the latest 4.1.x version,&lt;/li&gt;&lt;/ul&gt;and the full distribution, not the LE version for Java 1.4, as that omits the Xerces XML parser]. &lt;br&gt;Other servlet engines are supported, provided they implement version 2.2 or greater of the &lt;br&gt;servlet API. &lt;ul&gt;&lt;li&gt;                                 Make sure you have the latest version of JDK installed in your system and JAVA_HOME is set.                             &lt;/li&gt;&lt;li&gt;                                 Note also that Axis client and server requires Java 1.3 or later.                             &lt;/li&gt;&lt;/ul&gt;                                                                   &lt;p&gt;	                         &lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Things to know before diving into Web Service&lt;/b&gt;                         &lt;/p&gt;&lt;ul&gt;&lt;li&gt;                                 Core Java and concepts of java.                             &lt;/li&gt;&lt;li&gt;                                 How to diagnose trouble from exception traces.                             &lt;/li&gt;&lt;li&gt; What is a web application? what is the folder structure of web application? how to pack &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;libraries to web application? how to make a war file? to deploy web application to the application &lt;br&gt;server. Should also have knowledge on servlets. &lt;ul&gt;&lt;li&gt;                                 Basic knowledge about XML. [XML parsing not mandatary]                             &lt;/li&gt;&lt;li&gt;                                 Should also have knowledge about HTTP, TCP/IP                             &lt;/li&gt;&lt;/ul&gt;                                          &lt;p&gt;	                         &lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Software used in this artical&lt;/b&gt;                         &lt;/p&gt;&lt;ul&gt;&lt;li&gt;                                 Apache Axis 1.4                             &lt;/li&gt;&lt;li&gt;                                 JDK 1.5.x                              &lt;/li&gt;&lt;li&gt;                                 Jakarta Tomcat 5.x                             &lt;/li&gt;&lt;li&gt;                                 Netbeans 5.5.1 for java coding.                             &lt;/li&gt;&lt;/ul&gt;                                          &lt;h3&gt;                         SOAP                     &lt;/h3&gt;                     &lt;p&gt; SOAP is an XML-based communication protocol and encoding format for inter-application &lt;br&gt;&lt;/p&gt;&lt;p&gt;communication. The current spec is version, SOAP 1.2, though version1.1 is more widespread.&lt;/p&gt;&lt;p&gt; SOAP is the backbone of Web Services. &lt;/p&gt;                     &lt;p&gt;                         Below shown is the sample SOAP request message.                     &lt;/p&gt;                     &lt;pre&gt;						&lt;code&gt;&lt;br&gt;&lt;font color="#666666"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&amp;lt;SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&amp;lt;SOAP-ENV:Body&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;		&amp;lt;ns1:echoString xmlns:ns1="http://javawave.net/"&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;		&amp;lt;arg0 xsi:type="xsd:string"&amp;gt;Hi There!&amp;lt;/arg0&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;		&amp;lt;/ns1:echoString&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&amp;lt;/SOAP-ENV:Body&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&amp;lt;/SOAP-ENV:Envelope&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;/font&gt;                        &lt;/code&gt;&lt;br&gt;                    &lt;/pre&gt;                     &lt;h3&gt;                         Web Service                     &lt;/h3&gt;                     &lt;p&gt;                         Web service is a new generation cross-platform, cross-language distributed computing &lt;br&gt;&lt;/p&gt;&lt;p&gt;applications.                     &lt;/p&gt;                     &lt;h3&gt;                         Apache Axis                     &lt;/h3&gt;                     &lt;p&gt; Axis is a SOAP engine. It is a SOAP processer framework. The current version of Axis if written&lt;/p&gt;&lt;p&gt; fully in Java. &lt;/p&gt;                     &lt;p&gt; Axis has full support for the Web Service Description Language(WSDL). It has tools to generate&lt;/p&gt;&lt;p&gt; java code (Client stubs) from WSDL as well as generate WSDL automatically from java code. &lt;/p&gt;                     &lt;p&gt; Axis also has a simple stand alone server. It also has a server which plugs in to other servlet &lt;br&gt;&lt;/p&gt;&lt;p&gt;engins, like Tomcat. &lt;/p&gt;                     &lt;p&gt;                         Axis also has a monitoring tool to monitor TCP/IP packets.                      &lt;/p&gt;                     &lt;p&gt; Please note that this is an open-source effort. And in case you're wondering what Axis stands &lt;br&gt;&lt;/p&gt;&lt;p&gt;for, it's Apache EXtensible Interaction System - a fancy way of implying it's a very configurable&lt;/p&gt;&lt;p&gt; SOAP engine. &lt;/p&gt;                     &lt;p&gt; Axis is compiled in the JAR file axis.jar; it implements the JAX-RPC API declared in the JAR files&lt;/p&gt;&lt;p&gt; jaxrpc.jar and saaj.jar. It needs various helper libraries, for logging, WSDL processing and &lt;br&gt;&lt;/p&gt;&lt;p&gt;introspection. All these files can be packaged into a web application, axis.war, that can be &lt;br&gt;&lt;/p&gt;&lt;p&gt;dropped into a servlet container. &lt;/p&gt;                     &lt;h4&gt;Diffrent Style of Web Services in Axis&lt;/h4&gt;                     &lt;p&gt;                         There are four style of web services axis supports. They are:                         &lt;/p&gt;&lt;ul&gt;&lt;li&gt;RPC&lt;/li&gt;&lt;li&gt;Document&lt;/li&gt;&lt;li&gt;Wrapped, and&lt;/li&gt;&lt;li&gt;Message&lt;/li&gt;&lt;/ul&gt;                                          &lt;p&gt;we will take about these services after we see how to write deployment descriptor's to deploy&lt;/p&gt;&lt;p&gt; a service&lt;/p&gt;                                          &lt;h3&gt;                         Installing Axis                     &lt;/h3&gt;                     &lt;p&gt;                         &lt;/p&gt;&lt;ul&gt;&lt;li&gt;                                 Download the latest version of Axis. Here we are using Axis version 1.4                             &lt;/li&gt;&lt;li&gt;                                 Unzip the package downloaded to a folder say "myAxis".                             &lt;/li&gt;&lt;li&gt; Inside the unpacked folder, we can see a folder by name "axis".(&amp;lt;myAxis&amp;gt;axis-1_4webapps) &lt;/li&gt;&lt;li&gt; Copy the folder to tomcat webapps folder.(this article uses tomcat and we assume that your &lt;/li&gt;&lt;/ul&gt;tomcat is up and running in port 8080, if it is not running in 8080 please configure your tomcat to &lt;br&gt;run on 8080 if you are using some other application servers please see the reference document on &lt;br&gt;deploying web application in the server you are using) &lt;ul&gt;&lt;li&gt; The folder name "axis" can be renamed if you want diffrent context name. The rest of this &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;document assumes that the default webapp name, "axis" has been used; rename these references &lt;br&gt;if appropriate. &lt;ul&gt;&lt;li&gt; Axis needs a xml parser to work. If your application server does not provide one, please download&lt;/li&gt;&lt;/ul&gt;xml-xerces distribution (http://xml.apache.org/dist/xerces-j/) and add the parser libraries to &lt;br&gt;axis/WEB-INF/lib. &lt;ul&gt;&lt;li&gt; Axis also needs jaxrpc.jar and saaj.jar in the application path. jaxrpc.jar and saaj.jar contain &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;javax packages, so they may not get picked up. Copy them from &lt;br&gt;axis/WEB-INF/lib to CATALINA_HOME/common/lib and restart Tomcat. &lt;ul&gt;&lt;li&gt;Now we are ready to go... :)&lt;/li&gt;&lt;/ul&gt;                                          &lt;h3&gt;                         Validating the Installation                     &lt;/h3&gt;                     &lt;p&gt;                         &lt;/p&gt;&lt;ul&gt;&lt;li&gt; Make sure tomcat is running. Navigate to http://127.0.0.1:8080/axis/, if you have changed the &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;context name or the port change it accordingly in your URL. Now you should see the Apache-Axis start &lt;br&gt;page. If you are not able to see the page then probably your web application is not deployed properly. &lt;ul&gt;&lt;li&gt; Click on the validate link on the Apache Axis start page. This will lead you to happyaxis.jsp. &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;This is the test page that checks if the needed libraries and optional libraries are present or not. &lt;ul&gt;&lt;li&gt; If any of the needed libraries are missing, Axis will not work, then first you have to fix it and then&lt;/li&gt;&lt;/ul&gt;proceed. &lt;ul&gt;&lt;li&gt; Optional components are optional; install them as your need arises. If you see nothing but an internal&lt;/li&gt;&lt;/ul&gt;server error and an exception trace, then you probably have multiple XML parsers on the CLASSPATH, &lt;br&gt;and this is causing version confusion. Eliminate the extra parsers, restart the app server and try again. &lt;ul&gt;&lt;li&gt; Once the happyaxis page is happy. Navigate to the Apache-Axis start page &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;(http://127.0.0.1:8080/axis/). Select view list of deployed web services link. This will lead to a page &lt;br&gt;which will list all the deployed web services. On this page, You should be able to click on (wsdl) for &lt;br&gt;each deployed Web service to make sure that your web service is up and running.                                           &lt;h3&gt;                         Deploying new Web Services                     &lt;/h3&gt;                     &lt;h4&gt;New Web services installation process&lt;/h4&gt;                     &lt;p&gt;                         &lt;/p&gt;&lt;ul&gt;&lt;li&gt;                                 Get the classes and libraries of your new service into the Axis WAR directory tree, and                              &lt;/li&gt;&lt;li&gt; Tell the AxisEngine about the new file. The latter is done by submitting an XML deployment descriptor &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;to the service via the Admin web service, which is usually done with the AdminClient program. AdminClient &lt;br&gt;run the Axis SOAP client to talk to the Axis adminstration service, which is a SOAP service in its own right. &lt;br&gt;It's also a special SOAP service.                                           &lt;h4&gt;Implementing the process&lt;/h4&gt;                     &lt;p&gt;                         Prepare a batch file which will set all the axis related jar files to the classpath.                         &lt;br&gt;                         Here is the list of &lt;b&gt;jars needed&lt;/b&gt; to set in the class path                         &lt;/p&gt;&lt;ul&gt;&lt;li&gt;axis-ant.jar&lt;/li&gt;&lt;li&gt;axis.jar&lt;/li&gt;&lt;li&gt;commons-discovery-0.2.jar&lt;/li&gt;&lt;li&gt;commons-logging-1.0.4.jar&lt;/li&gt;&lt;li&gt;jaxrpc.jar&lt;/li&gt;&lt;li&gt;log4j-1.2.8.jar&lt;/li&gt;&lt;li&gt;saaj.jar&lt;/li&gt;&lt;li&gt;wsdl4j-1.5.1.jar&lt;/li&gt;&lt;li&gt;xml-apis.jar(download this jar)&lt;/li&gt;&lt;li&gt;xercesImpl.jar(download this jar)&lt;/li&gt;&lt;/ul&gt;                                          &lt;p&gt;                         First we will write a simple java code like below                         &lt;/p&gt;&lt;pre&gt;                            &lt;code&gt;&lt;br&gt;&lt;font color="#999999"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;/*&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; * HappyAxis.java&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; *&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; * Created on 9 Aug, 2007, 7:16:36 PM&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; *&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; */&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;package myapp;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;/**&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; *&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; * @author Muthukumar Dhanagopal&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; */&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;public class HappyAxis&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;{&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    public HappyAxis()&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;    &lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    public String sayHello(String name)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;        return "Hello " + name;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;    &lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;}&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;/font&gt;                            &lt;/code&gt;&lt;br&gt;                        &lt;/pre&gt;                                          &lt;p&gt; Compile the code and make a jar file. Here we created the jar file by name myApp.jar which contains &lt;br&gt;&lt;/p&gt;&lt;p&gt;the above code. &lt;/p&gt;                                         &lt;p&gt; Once myApp.jar is created, drop the jar inside axisWEB-INFlib folder in inside your application server. &lt;/p&gt;                     &lt;p&gt;Now it is time to write a deployment descriptor file to deploy our service in axis.&lt;/p&gt;                     &lt;p&gt; Web Service Deployment descriptor is nothing but a xml file with .wsdd extention. You can find a &lt;br&gt;&lt;/p&gt;&lt;p&gt;sample deployment descriptor below, which is used to deploy our example service HappyAxis packed &lt;br&gt;&lt;/p&gt;&lt;p&gt;into myApp.jar library. &lt;/p&gt;&lt;pre&gt;                            &lt;code&gt;&lt;br&gt;&lt;font color="#999999"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&amp;lt;deployment xmlns="http://xml.apache.org/axis/wsdd/"&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; &amp;lt;service name="MyService" provider="java:RPC"&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;  &amp;lt;parameter name="className" value="myapp.HappyAxis"/&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;  &amp;lt;parameter name="allowedMethods" value="*"/&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; &amp;lt;/service&amp;gt;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&amp;lt;/deployment&amp;gt;                                &lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;/font&gt;                            &lt;/code&gt;&lt;br&gt;                        &lt;/pre&gt;                                                                   &lt;p&gt; The service element has a name attribute which will contain the service name you want to expose. &lt;br&gt;&lt;/p&gt;&lt;p&gt;provider attribute will contain the provider used for the service. here we are using the java:RPC &lt;br&gt;&lt;/p&gt;&lt;p&gt;provider. Insted of provider attribute we can also use style attribute where we can define the &lt;br&gt;&lt;/p&gt;&lt;p&gt;style of webservice like document or messaging style. Our service name we defined here is "MyService". &lt;/p&gt;                     &lt;p&gt; service element has two child element named parameter. The first parameter element's name attribute&lt;/p&gt;&lt;p&gt; will hold the value className and the value attribute will contain the exact class name including the &lt;br&gt;&lt;/p&gt;&lt;p&gt;package. Here our value is "myapp.HappyAxis". In the next parameter tag you can specify all the &lt;br&gt;&lt;/p&gt;&lt;p&gt;methods you like to expose in that class. If you want to expose all the methods in the class specify * in&lt;/p&gt;&lt;p&gt; the value attribute. If you want to specify only one method or couple of methods, then specify the &lt;br&gt;&lt;/p&gt;&lt;p&gt;method name seperated by space. &lt;/p&gt;                     &lt;p&gt;                         Save the above deployment descriptor as deploy.wsdd.                     &lt;/p&gt;                     &lt;p&gt; Run the bath file which we prepared earlier to set classpath. Execute the following command from the&lt;/p&gt;&lt;p&gt; directory where you have saved the deploy.wsdd. If you are not in this directory you will get a &lt;br&gt;&lt;/p&gt;&lt;p&gt;"java.io.FileNotFoundException: deploy.wsdd (The system cannot find the file specified)" exception &lt;/p&gt;&lt;pre&gt;&lt;font color="#999999"&gt;&lt;code style="background-color: rgb(255, 255, 255);"&gt;java org.apache.axis.client.AdminClient &lt;br&gt;	-lhttp://localhost:8080/axis/services/AdminService deploy.wsdd&lt;/code&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;/font&gt;                        &lt;/pre&gt;                                          &lt;p&gt; If you get some java client error (like ClassNotFoundException), then you haven't set up your &lt;br&gt;&lt;/p&gt;&lt;p&gt;CLASSPATH variable right, mistyped the classname, or did some other standard error. Tracking down &lt;br&gt;&lt;/p&gt;&lt;p&gt;such problems are foundational Java development skills--if you don't know how to do these things, &lt;br&gt;&lt;/p&gt;&lt;p&gt;learn them now! &lt;/p&gt;                     &lt;p&gt;If you don't get any error then that means you have successfully deployed your web service. &lt;br&gt;&lt;/p&gt;&lt;p&gt;Now visit the Apache-Axis start page and navigate to the web service listing page. Here you can&lt;/p&gt;&lt;p&gt; see your service getting displayed. Just click on the WSDL link, Axis will automaticly generate &lt;br&gt;&lt;/p&gt;&lt;p&gt;WSDL for your deployed service.&lt;/p&gt;                     &lt;p&gt;Now we will see the styles of webservices possible in Axis&lt;/p&gt;                     &lt;p&gt;As we have already seen there are four types of webservices supported in Axis. &lt;br&gt;&lt;/p&gt;&lt;p&gt;They are RPC(1), Document(2), Wrapped(3) and Message(4)&lt;/p&gt;                     &lt;p&gt;&lt;b&gt;RPC services&lt;/b&gt;&lt;/p&gt;                     &lt;p&gt; RPC services are the default in Axis. They are what you get when you deploy services with &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;service ... provider="java:RPC"&amp;gt; or &amp;lt;service ... style="RPC"&amp;gt;. &lt;br&gt;&lt;/p&gt;&lt;p&gt;RPC services follow the SOAP RPC and encoding rules. Axis will deserialize XML into Java objects which &lt;br&gt;&lt;/p&gt;&lt;p&gt;can be fed to your service, and will serialize the returned Java object(s) from your service back into XML.&lt;/p&gt;&lt;p&gt; Since RPC services default to the soap section 5 encoding rules, objects will be encoded via "multi-ref" &lt;br&gt;&lt;/p&gt;&lt;p&gt;serialization, which allows object graphs to be encoded. &lt;/p&gt;                     &lt;p&gt;&lt;b&gt;Document / Wrapped service&lt;/b&gt;&lt;/p&gt;                     &lt;p&gt;Document and Wrapped services are similar, both use SOAP encoding for data.(means its plain xml schema).&lt;/p&gt;&lt;p&gt; Axis binds java objects for the xml schema here. so in the end you will end up using java objects. You will &lt;br&gt;&lt;/p&gt;&lt;p&gt;not use the xml directly here.&lt;/p&gt;                     &lt;p&gt;The document or wrapped style is indicated in WSDD as follows:                         &lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;br&gt;&lt;font color="#999999"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;&amp;lt;service ... style="document"&amp;gt; for document style&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;                    &amp;lt;service ... style="wrapped"&amp;gt; for wrapped style&lt;/span&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;                                          &lt;p&gt;&lt;b&gt;Message service&lt;/b&gt;&lt;/p&gt;                     &lt;p&gt; Message service should be used when you want Axis to step back and let your code at the actual XML &lt;br&gt;&lt;/p&gt;&lt;p&gt;instead of turning it into Java objects. There are four valid signatures for your message-style service methods: &lt;/p&gt;&lt;pre&gt;&lt;code&gt;&lt;br&gt;&lt;font color="#999999"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;public Element [] method(Element [] bodies);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;public SOAPBodyElement [] method (SOAPBodyElement [] bodies);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;public Document method(Document body);&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;public void method(SOAPEnvelope req, SOAPEnvelope resp); &lt;/span&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;                                          &lt;h3&gt;                         Consuming the deployed Web Services                     &lt;/h3&gt;                     &lt;h4&gt;Basic simple way to consume a Web Service&lt;/h4&gt;                     &lt;p&gt;First we will see the basic way of calling a web service with out generating stubs from WSDL&lt;/p&gt;                     &lt;p&gt;                         The code below is used to call our deployed web service "MyService"                      &lt;/p&gt;                     &lt;pre&gt;                        &lt;code&gt;&lt;br&gt;&lt;font color="#999999"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;/*&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; * TestClient.java&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; *&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; * Created on 9 Aug, 2007, 9:05:40 PM&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; */&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;package myapp;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;import org.apache.axis.client.Call;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;import org.apache.axis.client.Service;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;import javax.xml.namespace.QName;&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;/**&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; *&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; * @author Muthukumar Dhanagopal&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt; */&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;public class TestClient&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;{&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    public TestClient()&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    public static void main(String[] args)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;        try&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;        {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            String endpoint = "http://localhost:8080/axis/services/MyService";&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            Service service = new Service();&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            Call call = (Call) service.createCall();&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            call.setTargetEndpointAddress(new java.net.URL(endpoint));&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            call.setOperationName(new QName("http://javawave.blogspot.com/", "sayHello"));&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            String ret = (String) call.invoke( new Object[] { "Hello!" } );&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            System.out.println("Sent 'Hello!', got '" + ret + "'");&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;        }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;        catch (Exception e)&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;        {&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;            System.err.println(e.toString());&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;        }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;    }&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;}&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;/font&gt;                        &lt;/code&gt;&lt;br&gt;                    &lt;/pre&gt;                     &lt;p&gt;The program can be run as follows&lt;/p&gt;                     &lt;pre&gt;                        &lt;code&gt;&lt;br&gt;&lt;font color="#999999"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;java myapp.TestClient&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;span style="background-color: rgb(255, 255, 255);"&gt;Sent 'Hello', got 'Hello Hello'&lt;/span&gt;&lt;br style="background-color: rgb(255, 255, 255);"&gt;&lt;/font&gt;                        &lt;/code&gt;&lt;br&gt;                    &lt;/pre&gt;                     &lt;h4&gt;Consume a Web Service by creating stubs from WSDL&lt;/h4&gt;                     &lt;p&gt;Before getting into creating stubs, we will have a quick look at what is WSDL?&lt;/p&gt;                     &lt;p&gt;The &lt;i&gt;Web Service Description Language&lt;/i&gt; is a specification authored by IBM and Microsoft, &lt;br&gt;&lt;/p&gt;&lt;p&gt;and supported by many other organizations. WSDL serves to describe Web Services in &lt;br&gt;&lt;/p&gt;&lt;p&gt;a structured way. A WSDL description of a service tells us, in a machine-understandable&lt;/p&gt;&lt;p&gt; way, the interface to the service, the data types it uses, and where the service is located.&lt;/p&gt;                     &lt;p&gt;Axis supports WSDL in three ways:&lt;/p&gt;                     &lt;ul&gt;&lt;li&gt; After you deploy the web service, you can access the URL with a web browser &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;appending ?wsdl to end of it. Then Axis will automatically generate a wsdl document for you. &lt;ul&gt;&lt;li&gt; Axis provides a WSDL2Java tool which will generate proxy stubs and skeletons for &lt;br&gt;&lt;/li&gt;&lt;/ul&gt;service with WSDL description. &lt;ul&gt;&lt;li&gt;                             Axis also provides Java2WSDL tool which will generate WSDL from a Java code.                         &lt;/li&gt;&lt;/ul&gt;                     &lt;p&gt;With this information, Now we will see how to build stubs from WSDL to call our deployed &lt;br&gt;&lt;/p&gt;&lt;p&gt;web service&lt;/p&gt;                     &lt;p&gt;                         &lt;b&gt;Client-side binding&lt;/b&gt;                     &lt;/p&gt;                     &lt;p&gt;                         Axis provides WSDL-to-Java tool in org.apache.axis.wsdl.WSDL2Java. The basic invocation looks &lt;br&gt;&lt;/p&gt;&lt;p&gt;like this:                         &lt;/p&gt;&lt;pre style="background-color: rgb(255, 255, 255);"&gt;&lt;font color="#999999"&gt;&lt;code&gt;java org.apache.axis.wsdl.WSDL2Java (WSDL file URL)&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;&lt;p&gt;This command will generate the java stubs with those bindings necessary for the client. &lt;br&gt;&lt;/p&gt;&lt;p&gt;Axis follows JAX-RPC specification when generating the client binding from WSDL description.&lt;/p&gt;                     &lt;p&gt;For our client stub generation, First we will save the wsdl to a perticular location. Then &lt;br&gt;&lt;/p&gt;&lt;p&gt;we will invoke the following command as this: &lt;/p&gt;&lt;pre style="background-color: rgb(255, 255, 255);"&gt;&lt;font color="#999999"&gt;&lt;code&gt;java org.apache.axis.wsdl.WSDL2Java MyService.wsdl&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;                     &lt;p&gt;Once this invocation happens, then we can see the stubs getting generated in the same &lt;br&gt;&lt;/p&gt;&lt;p&gt;directory from where we invocked the command. Now we are ready to go. Just compile &lt;br&gt;&lt;/p&gt;&lt;p&gt;the stubs and write a CLI (Command Line Interface) which will make use of the generated &lt;br&gt;&lt;/p&gt;&lt;p&gt;stub and calls the web service.&lt;/p&gt;                     &lt;h3&gt;                         Conclusion                     &lt;/h3&gt;                     &lt;p&gt;So we came across Axis webservices by touching on some of the features of axis. We do&lt;/p&gt;&lt;p&gt; came across a sample webservice wich uses RPC style. We also saw how to generate the &lt;br&gt;&lt;/p&gt;&lt;p&gt;stubs and call the web service. Here I whould say we just had a dip in to the sea of &lt;br&gt;&lt;/p&gt;&lt;p&gt;webservice by just going through a sample application deployment in axis. There are lot &lt;br&gt;&lt;/p&gt;&lt;p&gt;to learn about it. Please dive deep in to the sea called webservice for the treasure of &lt;br&gt;&lt;/p&gt;&lt;p&gt;knowledge about it.&lt;/p&gt;                     &lt;p&gt;Happy Axis.. :)&lt;/p&gt;                 &lt;/td&gt;             &lt;/tr&gt;         &lt;/tbody&gt;&lt;/table&gt;        &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8048745819635601540-9065324942779299762?l=javawave.blogspot.com'/&gt;&lt;/div&gt;</description><link>http://javawave.blogspot.com/2007/09/happy-axis-introduction-axis-is-web.html</link><author>noreply@blogger.com (Muthukumar Dhanagopal)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item></channel></rss>
