|Home > Documentation > Reference > Geronimo Architecture > GBeans > GBean Annotations|
Definition of annotations streamlines the definition of GBeanInfo. With the help of GBean annotations, you will be freed from adding attributes, operations, and references in GBeanInfo.
Annotations for GBeans are defined as follows, and are defined in the package
Optional annotation defining the name and j2eeType of a GBean. If this annotation is not specified, then the default name is assumed to be the class (simple) name and the default j2eeType is GBean.
Optional annotation defining the priority of a GBean.
Annotation defining a GBean special attribute to be injected.
Annotation defining the GBean attribute to be injected.
Annotation defining the GBean reference to be injected.
Annotation for setter methods turning the corresponding GBean attributes into persistent attributes.
Annotation for setter methods turning the corresponding GBean attribute into a GBean reference.
Note that at most one constructor must be annotated with @ParamSpecial, @ParamAttribute or @ParamReference.
For developing a GBean with annotations, you at least have to go through the following steps:
Here we rewrite the sample simpleServerGBean provided in Developing and Deploying a Geronimo GBean, which references another GBean named EchoMessageGBean.
The dployment plan for SimpleServerGBean has to be modified.
Note: If you define the j2eeType attribute of the EchoMessageInterface GBean, you have to specify this attribute in the <reference> section of deployment plan so that Geronimo can recognize the GBean.
Two examples extracted from Geronimo source are presented here for your reference.