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


Configure the plug-in manager

We can define the plug-in manager configuration in the wimconfig.xml file.

The plug-in manager configuration consists of the following two sections to register topic subscribers with the plug-in manager and then associate them with topic emitters.

TopicSubscriberList

The TopicSubscriberList defines a list of topic subscribers.

TopicRegistrationList

The TopicRegistrationList defines a list of topic emitters and the topic subscribers that the topic emitters call at various points.

Use the sample configuration shown here to register a notification subscriber called JMSEventNotificationSubscriber and two modification subscribers called ABCSoftgroupsSubscriber and XYZSoftgroupsSubscriber with the virtual member manager create() API topic emitter. These two modification subscribers are also registered with the virtual member manager get() API topic emitter in this example.

<config:topicSubscriberList>
<config:topicSubscriber topicSubscriberName="JMSEventNotificationSubscriber" topicSubscriberType="NotificationSubscriber">
<config:className>com.mycompany.JMSEventNotificationSubscriber
</config:className>
</config:topicSubscriber>

<config:topicSubscriber topicSubscriberName="ABCSoftgroupsSubscriber" topicSubscriberType="ModificationSubscriber">
<config:className>com.mycompany.ABCSoftgroupsSubscriber
</config:className>
</config:topicSubscriber>
<config:topicSubscriber topicSubscriberName="XYZSoftgroupsSubscriber" topicSubscriberType="ModificationSubscriber">
<config:className>com.mycompany.XYZSoftgroupsSubscriber
</config:className>
</config:topicSubscriber>
</config:topicSubscriberList>

<config:topicRegistrationList>
<config:topicEmitter topicEmitterName="com.ibm.ws.wim.ProfileManager.create">
<config:preExit>
<config:notificationSubscriberList>  
<config:notificationSubscriber>    
<config:notificationSubscriberReference>JMSEventNotificationSubscriber
</config:notificationSubscriberReference>    
<config:realmList>All
</config:realmList>  
</config:notificationSubscriber>
</config:notificationSubscriberList>
<config:modificationSubscriberList>  
<config:modificationSubscriber>    
<config:modificationSubscriberReference>ABCSoftgroupsSubscriber
</config:modificationSubscriberReference>    
<config:realmList>All
</config:realmList>  
</config:modificationSubscriber>  
<config:modificationSubscriber>    
<config:modificationSubscriberReference>XYZSoftgroupsSubscriber
</config:modificationSubscriberReference>    
<config:realmList>All
</config:realmList>  
</config:modificationSubscriber>
</config:modificationSubscriberList>
</config:preExit>
<config:postExit>
</config:postExit>
</config:topicEmitter>

<config:topicEmitter topicEmitterName="com.ibm.ws.wim.ProfileManager.get">
<config:preExit>
</config:preExit>
<config:postExit>
<config:modificationSubscriberList>  
<config:modificationSubscriber>    
<config:modificationSubscriberReference>ABCSoftgroupsSubscriber
</config:modificationSubscriberReference>    
<config:realmList>All
</config:realmList>  
</config:modificationSubscriber>  
<config:modificationSubscriber>    
<config:modificationSubscriberReference>XYZSoftgroupsSubscriber
</config:modificationSubscriberReference>    
<config:realmList>All
</config:realmList>  
</config:modificationSubscriber>
</config:modificationSubscriberList>
</config:postExit>
</config:topicEmitter>
</config:topicRegistrationList> 

In this example, when the create() API starts execution, the preExit method for the JMSEventNotificationSubscriber plug-in is called. The plug-in cannot change the data object because it is a notification subscriber. Then, the preExit methods for the ABCSoftgroupsSubscriber plug-in and the XYZSoftgroupsSubscriber plug-in are also called. These plug-ins are modification subscribers, hence they can change the data object. The postExit method is not called at the end of the execution of the create() API, because the subscribers are not registered with the postExit method.

Also, after the get() API call completes execution, the postExit methods for the ABCSoftgroupsSubscriber plug-in and the XYZSoftgroupsSubscriber plug-in are called. The plug-ins can change the returned data object because they are modification subscribers. The preExit method is not called at the beginning of the execution of the get() API, because the subscribers are not registered with the preExit method.

After you define the subscribers, ensure that they are part of the CLASSPATH variable or place them into WAS_HOME/lib before starting IBM WAS.

Parent topic: Plug-in manager for virtual member manager
State preservation and avoiding infinite recursion
Plug-in manager error handling



+

Search Tips   |   Advanced Search