IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins
Interface ObjectGridPlugin

All Superinterfaces:
Destroyable, Initializable

public interface ObjectGridPlugin
extends Initializable, Destroyable

ObjectGrid plug-ins implement this interface to be invoked when the plug-in should be initialized and destroyed.

ObjectGrid plug-ins are instantiated, state is injected into the plug-in, it is then initialized and finally destroyed. The destroy method will only be invoked for plug-ins that have successfully been initialized. A plug-in cannot be initialized or destroyed more than once.

General lifecycle:

  1. UserObjectGridPlugin plugin = new UserObjectGridPlugin();
  2. All setter methods are called to set the plugin's state.
  3. plugin.initialize();
  4. plugin.destroy();
  5. plugin = null;
Any exceptions thrown from the initialize method are fatal and result in the parent ObjectGrid to fail to initialize. The result of the exception depends on the current state of the ObjectGrid.

Plug-ins can optionally register a ObjectGridLifecycleListener to be notified of other ObjectGrid-related events during the initialize method, or can directly implement the ObjectGridLifecycleListener interface which will automatically register the plug-in as a listener.

Since:
7.1.1
See Also:
ObjectGridLifecycleListener

Method Summary
 ObjectGrid getObjectGrid()
          Retrieve the ObjectGrid instance associated with this plug-in.
 void setObjectGrid(ObjectGrid grid)
          The ObjectGrid instance is at an undefined state, depending on the type of plug-in and how it was registered with the map.
 
Methods inherited from interface com.ibm.websphere.objectgrid.plugins.Initializable
initialize, isInitialized
 
Methods inherited from interface com.ibm.websphere.objectgrid.plugins.Destroyable
destroy, isDestroyed
 

Method Detail

setObjectGrid

void setObjectGrid(ObjectGrid grid)
The ObjectGrid instance is at an undefined state, depending on the type of plug-in and how it was registered with the map. Use the ObjectGrid.getState() method to determine what state the ObjectGrid is in.

Parameters:
grid - the ObjectGrid associated with this plug-in instance.

getObjectGrid

ObjectGrid getObjectGrid()
Retrieve the ObjectGrid instance associated with this plug-in.

During normal operation, this method may be called to confirm the correct operation of the ObjectGridPlugin. It must return the ObjectGrid instance previously set using the setObjectGrid(ObjectGrid) method.

Returns:
the ObjectGrid instance.

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.