Express (Distributed operating systems), v8.0 > Secure applications and their environment > Authenticate users > Select a registry or repository > Manage realms in a federated repository > Virtual member manager > Develop with virtual member manager > Extend virtual member manager functionality in the application
Plug-in manager for virtual member manager
The plug-in manager provides a framework that enables you to write extensions to virtual member manager, to consume a variety of services that can be added in the future.
Some examples are policy management, event notification, and manipulation of group membership.
The plug-in manager listens in on various virtual member manager API calls and routes the requests to various subscribers based on their topic subscriptions. The topic subscriptions are listed in the wimconfig.xml file.
The plug-in manager is based on the publish-subscribe model that is illustrated here.
Figure 1. Plug-in manager framework based on the publish-subscribe model
The plug-in manager has two main components:
- Topic emitters
- Topic subscribers
Topic emitters
Topic emitters consist of various points inside virtual member manager, which are of interest to topic subscribers. All topic emitters must follow the Service Data Object (SDO) framework.
The following methods are topic emitters:
- public DataObject create(DataObject root);
- public DataObject get(DataObject root);
- public DataObject delete(DataObject root);
- public DataObject update(DataObject root);
- public DataObject search(DataObject root);
- public DataObject login(DataObject root);
Topic subscribers
Topic subscribers are plug-ins topic emitters call in the order defined in the virtual member manager configuration file.
Some examples of topic subscriber functions are credential capture, event notification, and soft groups.
There are two types of topic subscribers:
Notification subscribers
These types of topic subscribers are responsible for receiving notifications or performing read-only operations. Notification subscribers are called without any particular sequence.
Modification subscribers
These types of topic subscribers can modify the input and output data objects, and make decisions or take actions during run time. Modification subscribers are called in the order that they are defined in the virtual member manager configuration file. Each topic emitter has two logical points that call topic subscribers:
preExit
This logical point occurs once at the beginning of a topic emitter. It calls the notification subscribers first, and then the modification subscribers.
postExit
This logical point occurs once at the end of a topic emitter. It calls the modification subscribers first and then the notification subscribers.
Sample code
A sample plug-in is provided to familiarize you with the features of the plug-in manager framework. Instructions to code, compile, and deploy the plug-in are in vmmsampleplugin.jar, which you can download from the developerWorks wiki page, Sample virtual member manager plug-in for WAS v6.1 and above.
- Configure the plug-in manager
We can define the plug-in manager configuration in the wimconfig.xml file.- State preservation and avoiding infinite recursion
A unique identifier (UID) is associated with every call into the plug-in manager.- Plug-in manager error handling
The plug-in manager does not throw any subscriber exceptions that it receives from subscribers. Instead, it encapsulates these exceptions into the exception context of the data object for further analysis by subsequent subscribers.
Parent topic: Extend virtual member manager functionality in the application