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.
- TransactionCallback: A TransactionCallback plug-in
provides
transaction life cycle events. If the TransactionCallback plug-in
is the built-in JPATxCallback (com.ibm.websphere.objectgrid.jpa.JPATxCallback)
class implementation, then the plug-in is server side only. However,
the subclasses of the JPATxCallback class are not
server side only.
- ObjectGridEventListener: An ObjectGridEventListener
plug-in
provides ObjectGrid life cycle events for the ObjectGrid, shards,
and transactions.
- ObjectGridLifecycleListener: An
ObjectGridLifecycleListener
plug-in provides ObjectGrid life cycle events for the ObjectGrid instance.
The ObjectGridLifecycleListener plug-in can be used as an optional
mixin interface for all other ObjectGrid plug-ins.
- ObjectGridPlugin: An ObjectGridPlugin is an optional mix-in
interface that provides extended life cycle management events for
all other ObjectGrid plug-ins.
- SubjectSource, ObjectGridAuthorization,
SubjectValidation: eXtreme Scale provides several
security endpoints to allow custom authentication mechanisms to be
integrated with eXtreme Scale.
(Server side only)
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.
The built in time-to-live evictor uses a time-based algorithm to decide
when an entry in BackingMap must be evicted. Some applications might
need to use a different algorithm for deciding when a cache entry
needs to be evicted. The Evictor plug-in makes a custom designed Evictor
available to the BackingMap to use. The Evictor plug-in is in addition
to the built in time-to-live evictor. You can use the provided custom
Evictor plug-in that implements well-known algorithms such as "least
recently used" or "least frequently used". Applications can either
plug-in one of the provided Evictor plug-ins or it can provide its
own Evictor plug-in. For more information, see Plug-ins for evicting cache objects.
ObjectTransformer:
An ObjectTransformer plug-in allows you to serialize, deserialize,
and copy objects in the cache. The ObjectTransformer interface
has been replaced by the DataSerializer plug-ins,
which you can use to efficiently store arbitrary data in WebSphere eXtreme Scale so that existing product
APIs can efficiently interact with your data. For more information,
see ObjectTransformer plug-in.
OptimisticCallback:
An OptimisticCallback plug-in allows you to customize versioning and
comparison operations of cache objects when you are using the optimistic
lock strategy. The OptimisticCallback plug-in has been replaced by
the ValueDataSerializer.Versionable interface,
which you can implement when you use the DataSerializer plug-in with
the COPY_TO_BYTES copy mode or when you use the @Version annotation
with the EntityManager API. For more information,
see Plug-ins for versioning and comparing cache objects.
- MapEventListener: A MapEventListener plug-in provides callback
notifications and significant cache state changes that occur for a
BackingMap. An application might want to know about BackingMap events
such as a map entry eviction or a preload of a BackingMap completion.
A BackingMap calls methods on the MapEventListener plug-in to notify
an application of BackingMap events. An application can receive notification
of various BackingMap events by using the setMapEventListener method
to provide one or more custom designed MapEventListener plug-ins to
the BackingMap. The application can modify the listed MapEventListener
objects by using the addMapEventListener method
or the removeMapEventListener method. For more
information, see MapEventListener plug-in.
- BackingMapLifecycleListener: A BackingMapLifecycleListener
plug-in provides BackingMap life cycle events for the BackingMap instance.
The BackingMapLifecycleListener plug-in can be used as an optional
mix-in interface for all other BackingMap plug-ins.
- BackingMapPlugin: A BackingMapPlugin is an optional mix-in
interface that provides extended life cycle management events for
all other BackingMap plug-ins.
- 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.
- 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. (Server side only)
For example, a Java™ database
connectivity (JDBC) Loader can be used to move data in and out of
a BackingMap and one or more relational tables of a relational database.
A relational database does not need to be used as the persistent store
for a BackingMap. The Loader can also be used to moved data between
a BackingMap and a file, between a BackingMap and a Hibernate map,
between a BackingMap and a Java 2
Platform, Enterprise Edition (JEE) entity bean, between a BackingMap
and another application server, and so on. The application must provide
a custom-designed Loader plug-in to move data between the BackingMap
and the persistent store for every technology that is used. If a Loader
is not provided, the BackingMap becomes a simple in-memory cache.
For more information, see Plug-ins for communicating with databases.
- MapSerializerPlugin: A MapSerializerPlugin allows you to
serialize and inflate Java objects
and non-Java data in the cache. It is used with the DataSerializer
mix-in interfaces, allowing robust and flexible options for high-performance
applications.