Introduction to Singleton Pattern in Java with Examples

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.

Introduction to Multithreading in Java

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.

[Lab] JAXB 2 Marshaling and Unmarshaling with Java to XSD Binding

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. 

[Lab] JAXB 2 Marshaling and Unmarshaling with XSD to Java Binding

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.

Downloading, Installing and Configuring JBoss for First Time


1. Download the latest version of the JBoss Application Server from jboss site, unzip it and run the file standalone.bat located in the bin directory to start it. Then visit http://localhost:8080 to confirm if the server has started properly.

Servlet Class Hierarchy and Life Cycle

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

Introduction to HTTP - HTTP Methods and HTTP Status Codes

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. 

[Lab] Soap Web Service with Collection Types and Generating Client Support Code using wsimport

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.

The JAX-WS Tools – wsimport and wsgen

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.

SOAP Binding - Style, Encoding and Wrapping

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.


Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within!!!