Submitted by heartin on Tue, 01/22/2013 - 00:12
The singleton pattern is a design pattern that restricts the instantiation of a class to one object. At a given point of time there should be only one instance of the given class. We won’t cover every possible ways to do singleton, but only some solutions which I feel is important. We will start with a small introduction to design patterns and then see what a singleton pattern is and how it can be implemented effectively in Java.
Submitted by heartin on Sat, 01/19/2013 - 20:25
In this article, we start by discussing the difference between multithreading and multitasking (or difference between threads and processes), then discussing the thread states, different ways of creating threads and a simple thread example to make things clear. We will also learn what are deamon threads.
Submitted by heartin on Thu, 12/20/2012 - 07:25
JAXB 2.x support bidirectional binding between xml schema and java objects - binding from XML schema to java classes and binding of Java classes to XML Schema components.
Here we will do java to xsd binding and then do marshaling and unmarshaling.
Submitted by heartin on Wed, 12/19/2012 - 21:09
In XML schema to Java class binding, the input is an XSD document and everything else is generated or written based on this XSD. We will first create a sample xml and then write (or generate) an xsd for it, then using the xsd, we will create the java stub code corresponding to the xsd and finally do marshaling and unmarshaling using the generated code. Marshaling an XML document means to create an XML document from Java classes. Unmarshaling an XML document creates a Java object tree from an XML document.
Submitted by sneha on Tue, 12/18/2012 - 07:50
Submitted by heartin on Mon, 12/17/2012 - 02:11
A servlet is a java class that conform to the servlet specification and need to be deployed to a servlet container to work as a servelt. A servlet’s life cycle consist of Servlet class loading, Servlet instantiation, and then methods init(), service() and destroy().
Submitted by heartin on Sun, 12/16/2012 - 18:44
HTTP is a synchronous request-response application network protocol. Client sends a request specifying one of the seven HTTP methods, the location of the resource to be invoked, a set of optional headers and an optional message body. The server sends back a response containing the version of HTTP we are using, a response code, a description of the response code, a set of optional headers, and an optional message body. HTTP is the primary protocol for most web applications on the Internet, regardless of whether they are written in Java, PHP or ASP.
Submitted by heartin on Sun, 12/16/2012 - 00:03
We will create a simple soap web service with richer data types ( List and a user defined class) using wsimport we will generate the client side stubs. In this lab, we will create an employee service that will return employee details based on employee numbers.
Submitted by heartin on Sat, 12/15/2012 - 23:47
The jax-ws tools wsgen and wsimport generate artifacts for easy for web service development, deployment, and invocation.
Previously with JAX-RPC, frameworks like axis 1 had tools like wsdl1java and java2wsdl, but we should consider only jax-ws tools now.
Submitted by heartin on Sat, 12/15/2012 - 21:40
The @SOAPBinding annotation can be used in a Service Endpoint Interface (SEI) to configure the soap binding style, encoding and parameter style; and we does this using style, use and parameterStyle attributes respectively.