Program guide > Programming with system APIs and plug-ins



Introduction to plug-ins

A WebSphere eXtreme Scale plug-in is a component that provides a certain type of function to the pluggable components that include ObjectGrid and BackingMap. WebSphere eXtreme Scale provides several plug points to allow applications and cache providers to integrate with various data stores, alternative client APIs and to improve overall performance of the cache. The product ships with several default, prebuilt plug-ins, but you can also build custom plug-ins with the application.

All plug-ins are concrete classes that implement one or more eXtreme Scale plug-in interfaces. These classes are then instantiated and invoked by the ObjectGrid at appropriate times. The ObjectGrid and BackingMaps each allow custom plug-ins to be registered.


ObjectGrid plug-ins

The following plug-ins are available for an ObjectGrid instance. If the plug-in is server side only, the plug-ins are removed on the client ObjectGrid and BackingMap instances. The ObjectGrid and BackingMap instances are only on the server.


Common ObjectGrid plug-in requirements

The ObjectGrid instantiates and initializes plug-in instances using JavaBeans™ conventions. All of the previous plug-in implementations have the following requirements:


BackMap plug-ins

The following plug-ins are available for a BackingMap:


Plug-in life cycles

Most plug-ins have both initialize and destroy methods or equivalent methods, in addition to the methods for which they were designed to operate. These specialized methods of each plug-in are available to be invoked at designated functional points. Both initialize and destroy methods define the life cycle of plug-ins, which are controlled by their "owner" objects. An owner object is the object that actually uses the given plug-in. An owner can be a grid client, server, or a backing map.

When owner objects are initializing, they will invoke the initialize method of their owned plug-ins. During the destroy cycle of owner objects, the destroy method of plug-ins will be consequently invoked also. For details on the specifics of initialize and destroy methods, along with other methods capable with each plug-in, refer to the topics relevant to each plug-in.

As an example, consider a distributed environment. Both the client-side ObjectGrids and the server-side ObjectGrids can have their own plug-ins. The life cycle of a client-side ObjectGrid and, therefore, its plug-in instances are independent from all server-side ObjectGrid and plug-in instances.

In such a distributed topology, say you have an ObjectGrid named "myGrid" defined in the objectGrid.xml file and configured with a customized ObjectGridEventListener named myObjectGridEventListener. The objectGridDeployment.xml file defines the deployment policy for the myGrid ObjectGrid. Both the objectGrid.xml and objectGridDeployment.xml files are used to start container servers. During the startup of the container server, the server side myGrid ObjectGrid instance is initialized and the initialize method of the myObjectGridEventListener instance that is owned by the myObjectGrid instance is invoked. After the container server is started, the application can connect to the server-side myGrid ObjectGrid instance and obtain a client-side instance.

When obtaining the client-side myGrid ObjectGrid instance, the client-side myGrid instance goes through its own initialization cycle and invokes the initialize method of its own client-side myObjectGridEventListener instance. This client side myObjectGridEventListener instance is independent from the server-side myObjectGridEventListener instance. Its life cycle is controlled by its owner, which is the client-side myGrid ObjectGrid instance.

If the application disconnects or destroys the client-side myGrid ObjectGrid instance, the destroy method of the owned client-side myObjectGridEventListener instance are invoked automatically. However, this has no impact on server-side myObjectGridEventListener instance. The destroy method of the server-side myObjectGridEventListener instance is only be invoked during the destroy cycle of the server-side myGrid ObjectGrid instance when stopping a container server. That is, when stopping a container server, the contained ObjectGrid instances are destroyed and the destroy method of all their owned plug-ins is invoked.

Although the previous example applies specifically to the case of a client and a server instance of an ObjectGrid, the owner of a plug-in can also be a BackingMap and be careful to determine the configurations for plug-ins that you may write based on these life cycle considerations.


Parent topic:

Program with system APIs and plug-ins


Related concepts

Plug-ins for evicting cache objects

Plug-ins for transforming cached objects

Plug-ins for versioning and comparing cache objects

Plug-ins for custom indexing of cache objects

Plug-ins for communicating with persistent stores

Plug-ins for managing transaction life cycle events

Related reference

Plug-ins for providing event listeners