Show TOC Start of Content Area

Background documentation AS Java System Components  Locate the document in its SAP Library structure

The AS Java system components build the second level of the system which provides various runtime functions and programming APIs. Built on top of the runtime and being able to communicate and use each other, these components form the complete system infrastructure to run both Java EE and SAP proprietary applications.

Components

The following types of components exist:

      Facades – they simplify the relationships between SAP NetWeaver layers and client applications. Facades are the only official way for clients to access the AS Java API. They help to define what is an ‘external (publicly available) API’ and what is an ‘internal API’. Everything that is part of a facade is public and the client code must be built against it. Everything that is not part of a facade is not official and the client code should not rely on it. Clients in this context can be components from other layers of the product and customer applications. If a client needs a reference to the public API of a certain component (service, interface, or a library), it must reference the facade which contains the API of the component.

      Interfaces – they define how different components of the system work together. At runtime, they provide the system with their name and classes (no objects). They are used by services components that provide their implementation.

      Libraries – they provide name, classes and objects to the system. These objects are created by the system when it loads the library, or when an object is first requested. Libraries are not active components – they have no definite life cycle, do not allocate resources themselves and do not keep any kind of configuration information in the system. Other library components or services components usually access them using static methods.

      Services – they provide the system with their name, classes, and runtime objects. The runtime objects are registered in the system once the components classes have been loaded. Service components can access and utilize functions of the runtime through the Framework API. Services are active components with a definite life cycle. They can allocate resources at their startup time and are responsible for releasing them at shutdown time.

There are core services which provide the core functionality and should always be running, otherwise the system will stop. The rest of the services provide additional functionalities and are not required for the operation of the system.

Component References

Two types of references describe the dependencies between different system components – weak and strong.

Weak Reference

Component A sets a weak reference to component B if it needs to use classes of B. Throughout the life cycle of a component, a weak reference means:

      If component B exists, a reference from the class loader of A is set to the class loader of B.

      Component B must be resolved for component A to be resolved.

      All events that refer to a change of state of component B are sent to component A.

      If the system has to unload component B, it must first unload component A.

Caution

Even though it is possible to set a weak reference from a library to an interface or a service, it is not common practice. Therefore, if you encounter such a situation, double-check the design of your library before you set the link.

Strong Reference

Component A sets a strong reference to component B if it needs to use classes and runtime objects that B provides. Throughout the life cycle of a component, a strong reference means:

      If component B exists, a reference from the class loader of A is set to the class loader of B.

      Component B must be resolved for component A to be resolved.

      All events that refer to a change of state of component B are sent to component A.

      Component B must be started for component A to be started.

      If the system has to stop component B, it must first stop component A.

      If the system has to unload component B, it must first unload component A.

      If component A has a strong reference to component B, then B cannot have a strong reference to A.

Note

In the case of a service component with a strong reference to an interface, the referencing service will be started only if there is another service that implements the referenced interface and this service is started.

 

 

End of Content Area