WAS v8.5 > Reference > Developer detailed usage information

EJB metadata annotations

Annotations enable you to write metadata for EJB inside your source code. We can use them instead of extensible markup language (XML) deployment descriptor files. Annotations can also be used with descriptor files.

If we installed the Feature Pack for EJB 3.0, the default was to scan annotations during the installation of an EJB 3.0 module. For WebSphere Application Server, v7.0 and later, the default is not to scan pre-Java EE 5 modules during the application installation or at server startup

To preserve backward compatibility with both the Feature Pack for EJB 3.0 and the Feature Pack for Web Services, we have a choice whether to scan legacy web modules for additional metadata. A server level switch is defined for each feature pack scan behavior. If the default is not appropriate, the switch must be set on each server and administrative server that requires a change in the default. The switches are server custom properties com.ibm.websphere.webservices.UseWSFEP61ScanPolicy={true|false} and com.ibm.websphere.ejb.UseEJB61FEPScanPolicy={true|false}. To define these properties in the dmgr console click Application servers > server name > Process definition > Java Virtual Machine > Custom properties.

WAS v8.5 also provides default values for most of the EJB annotations it uses. In many cases, omitting an annotation implies to use the default value.

Usually, annotations are found in the javax.ejb and javax.persistence packages.

Annotation types. Annotation types

Annotation type
AccessTimeout
ExcludeDefaultInterceptors
AfterBegin
AfterCompletion
ApplicationException
AroundInvoke
Asynchronous
BeforeCompletion
ConcurrencyManagement
DependsOn
EJB
EJBs
ExcludeDefaultInterceptors
ExcludeDefaultInterceptors
Init
Interceptors
Local
Lock
LocalBean
LocalHome
MessageDriven
PersistenceUnit
PostActivate
PostConstruct
PreDestroy
PrePassivate
Remote
RemoteHome
Remove
Resource
Schedule
Schedules
Singleton
Startup
StatefulTimeout
Stateless
Timeout
TransactionAttribute
TransactionManagement
TransactionManagement


Subtopics


Related concepts:

Enterprise beans
Application exceptions


Related


Develop enterprise beans


Reference:

Enterprise bean development best practices


+

Search Tips   |   Advanced Search