@Stateful Annotation

5 March 2012 By Nithya Vasudevan 2,104 views No Comment
0 Flares Twitter 0 Facebook 0 Google+ 0 0 Flares ×

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

@Target(value=TYPE) @Retention(value=RUNTIME) public @interface Stateful { String description() default ""; String name() default "<Bean class name>"; String mappedName() default ""; }


  • name – name of the bean. If empty, then bean’s class name is used.
  • mappedName - A product specific name(e.g. global JNDI name) that this session bean should be mapped to. Application servers are not required to support any particular form or type of mapped name, nor the ability to use mapped names. Use of a mapped name is not portable.
  • description - A string describing the stateful session bean.

Tags: , , ,