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:
  • TransactionCallback: A TransactionCallback plug-in provides transaction life cycle events.
  • ObjectGridEventListener: An ObjectGridEventListener plug-in provides ObjectGrid life cycle events for the ObjectGrid, shards, and transactions.
  • SubjectSource, ObjectGridAuthorization, SubjectValidation: eXtreme Scale provides several security endpoints to allow custom authentication mechanisms to be integrated with eXtreme Scale.

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:
  • The plug-in class must be a top-level public class.
  • The plug-in class must provide a public, no-argument constructor.
  • The plug-in class must be available in the class path for both servers and clients (as appropriate).
  • Attributes must be set using the JavaBeans style property methods.
  • Plug-ins, unless specifically noted, are registered before ObjectGrid initializes and cannot be changed after the ObjectGrid is initialized.

BackingMap plug-ins

The following plug-ins are available for a BackingMap:
  • Evictor: An evictor plug-in is a default mechanism is provided for evicting cache entries and a plug-in for creating custom evictors.
  • Loader: A Loader plug-in on an ObjectGrid map acts as a memory cache for data that is typically kept in a persistent store on either the same system or some other system.
  • ObjectTransformer: An ObjectTransformer plug-in allows you to serialize, deserialize, and copy objects in the cache.
  • OptimisticCallback: An OptimisticCallback plug-in allows you to customize versioning and comparison operations of cache objects when you are using the optimistic lock strategy.
  • MapEventListener: A MapEventListener plug-in provides callback notifications and significant cache state changes that occur for a BackingMap.
  • Indexing: Use the indexing feature, which is represented by the MapIndexplug-in plug-in, to build an index or several indexes on a BackingMap map to support non-key data access.

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 objectGrid.xml and objectGridDeployment.xml are used to start container servers. During the startup of the container server, the server side myGrid ObjectGrid instance will be initialized and the initialize method of the myObjectGridEventListener instance owned by the myObjectGrid instance will be invoked. After the container server is started, your 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 will go through its own initialization cycle and invoke 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 your application disconnects or destroys the client-side myGrid ObjectGrid instance, the destroy method of the owned client-side myObjectGridEventListener instance will be invoked automatically. However, this has no impact on server-side myObjectGridEventListener instance. The destroy method of the server-side myObjectGridEventListener instance will 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 will be destroyed and the destroy method of all their owned plug-ins will be 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 you must be careful to determine your configurations for plug-ins that you may write based on these life cycle considerations.

New! Subscribe to Information Center updates

rss feed You can now subscribe to updates for the WebSphere eXtreme Scale Information Center. This feed includes a description of the changes that occur in the monthly refreshes. Use the RSS feed to subscribe to changes using your favorite feed reader.