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 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().
Pages