[7 Mar 2012 | No Comment | 7,194 views]

From the client’s perspective, a Singleton bean always supports concurrent access. In general, a Singleton client does not have to concern itself with whether other clients might be accessing the Singleton at the same time.

From the bean developer’s perspective, Read more…

[7 Mar 2012 | No Comment | 2,031 views]

  • A singleton session bean instance’s life starts when the container invokes the newInstance method on the session bean class to create the singleton bean instance.
  • Next, the container performs any dependency injection as specified by the metadata annotations on the

Read more…

[7 Mar 2012 | No Comment | 2,104 views]
  • The EJB container is responsible for determining when to initialize a singleton session bean instance.
  • However, the Singleton Session bean can be requested to be initialized by the container upon application startup. This is called eager initialization and can be

Read more…

[7 Mar 2012 | No Comment | 2,831 views]

Business Interface

Create the bean interface and mark it either as @Remote, @Local or @WebService.

Remote Interface

Local Interface

Web service interface

Bean implementation class

Create a class which implements the business interface. Mark this class as singleton session bean Read more…

[7 Mar 2012 | No Comment | 7,260 views]

The @Singletion annotation is used to mark the class as Singleton Session Bean. This annotation’s specification is as follows.

@Target(value=TYPE) @Retention(value=RUNTIME) public @interface Singleton { String description() default “”; String name() default “”; String mappedName() default “”; }

where, Read more…

[7 Mar 2012 | No Comment | 3,968 views]
  • Available from EJB 3.1, Singleton Session Beans are business objects having a global shared state within a JVM.
  • The @Singleton annotation is used to mark the class as Singleton Session Bean.
  • They are instantiated once per application and exist

Read more…

[7 Mar 2012 | 2 Comments | 3,312 views]
  • The application container can pool instances of stateless session beans to increase performance.
  • When the client requests an operation on the bean, the container can assign an available instance from the pool reducing instance creation overhead.
  • After completion the bean

Read more…

[7 Mar 2012 | One Comment | 8,613 views]

  • A stateless session bean instance’s life starts when the container invokes the newInstance method on the session bean class to create a new session bean instance.
  • Next, the container performs any dependency injection as specified by metadata annotations on the

Read more…

[7 Mar 2012 | One Comment | 10,261 views]

The lifecycle callbacks are methods defined in the bean class but not in business interface which the container calls when specific lifecycle event or transition occurs. The following two annotations are used to define lifecycle callbacks on stateless session beans. Read more…

[7 Mar 2012 | One Comment | 1,986 views]

Business Interface

Create the bean interface and mark it either as @Remote, @Local or @WebService.

Remote Interface

Local Interface

Web service interface

Bean implementation class

Create a class which implements the business interface. Mark this class as stateless session bean Read more…