Show TOC

EJB EnvironmentLocate this document in the navigation structure

Use

The business logic of an application is not a constant part. After its delivery, it is possible that new requirements for additional functionality appear. This can be as part of the following scenarios:

  • You have expected some changes and you have prepared an alternative business logic or you have parametrized the original one in the same application. In this case you want to switch to the alternative or change the parameters.

  • You deliver new functionality in an additional application. In this case you want to switch to this application.

You can achieve this redirection by changing the EJB References or Environment Entries, where with EJB References you change entire parts of the business logic, whereas the Environment Entries are used to change the business logic parameters.

For simplicity, let us have two beans that represent the business logic of an already existing application, the first bean accesses the second one through a particular business interface. If you want to customize this application you can change the behavior of the first bean by redirecting its implementation to another bean (inside the existing application or as a part of a separate application) or you can change some of the parameters (Environment Entries) of the current business logic.

When redirecting session bean B1 from session bean C1 to session bean C2, you have to change the beanName , the jarName , and the appName . The interfaceName cannot be changed. It can be specified only in the source code of the business logic.

EJB References

If you want to use the EJB redirection to switch your business logic and if the EJB reference is specified in annotation, you have to use the mappedName attribute of the @EJB annotation. The actual redirection can be done by editing the mappedName annotation attribute of the bean. The mappedName has an SAP-specific format that uses the EJB lookup scheme.

More information: EJB Lookup Scheme

Note

To change the annotation attribute mappedName you need to use all keys of the EJB lookup scheme: appName , jarName , beanName , and interfaceName . If the additional business logic is in a separate application, you need to change the appName and (or) the jarName and (or) the beanName . In case the additional business logic is in the same application, you need to change only the beanName and (or) the jarName . In both cases all the keys need to be present. The interfaceType is optional.

If the EJB reference is specified in the ejb-j2ee-engine.xml , you have to change its JNDI name using the SAP NetWeaver Administrator. The JNDI name uses the EJB lookup scheme as well.

Environment Entries

You can edit Environment Entries as well. Using the SAP NetWeaver Administrator you can change their value by saving the new configuration without redeploying the application.