IBM Content Integrator, Version 8.6

Implementing event subscription

To enable client applications to subscribe to and receive repository events, you must implement two Java interfaces and make the subscribing application available to repository event services.

About this task

The ISubscriber implementation class contains business logic specific to your application and receives event information in an instance of the class com.venetica.vbr.res.RepoEvent. The ISubscriberLocator class locates an instance of ISubscriber to handle the event.

To reach the subscriber, an event takes the path: Repository > RES Connector > RES Director > RES Receiver > ISubscriberLocator > ISubscriber.

You can base the ISubscriber and ISubscriberLocator implementations on non-EJB technologies such as Remote Method Invocation (RMI), web services, JDBC, and HTTP. However, the RES application is an EJB and subscriber implementations must therefore be able to run inside the EJB container of the application server.

To subscribe to events, call one or both of these methods:

To unsubscribe from events, call one or more of these methods:
  • com.venetica.vbr.client.res.RepoEventServices.unsubscribe(int)
  • com.venetica.vbr.client.res.RepoEventServices.unsubscribeFromItemClass(ISubscriberLocator, String)
  • com.venetica.vbr.client.res.RepoEventServices.unsubscribeFromRepoItem(ISubscriberLocator, RepoItemHandle)

IBM® Content Manager only: These methods delete the subscription in the RES Database but you must manually delete the subscriptions from the Content Manager repository.

Procedure

To enable your client applications to subscribe to repository events:

  1. Implement the ISubscriberLocator and ISubscriber interfaces on each subscribing application:
    public interface com.venetica.vbr.res.ISubscriberLocator
    • public ISubscriber locateSubscriber() is called by the RES Receiver to locate the ISubscriber instance that will receive an event.
    • public String getID() returns the ID of the locator, which is associated with a subscription and must therefore be unique. The ID helps to identify the associated subscriptions in the RES Database when an event occurs.
    public interface com.venetica.vbr.res.ISubscriber
    • public void onRepoEvent(RepoEvent) is called by the RES Receiver to pass the RepoEvent to the subscriber. Place the business logic for handling an event here.
  2. EJB subscribers only: To make the subscriber application available to RES:
    1. In an EJB jar file contained in an enterprise application archive (EAR) file:
      • package the classes that implement the two interfaces
      • package any supporting classes and files specific to your application
      • add the file ICI_HOME/lib/vbr.jar to the lib directory of the EAR file, which provides the subscriber access to core RES classes
    2. Deploy the EAR file to an application server, which does not have to be the server to which you deployed the RES application, but must be the same type of application server.
    3. WebSphere® Application Server only: To enable the ISubscriberLocator to locate the ISubscriber, generate client stubs for the ISubscriber implementation and make them available to the RES application as a shared library reference. See the topic Create stubs command in the WebSphere Application Server information center.
  3. Non-EJB subscribers only: To make the subscriber application available to RES:
    1. Make all implementation classes and supporting files needed to locate the subscriber and to call methods on it available to the RES application, as the application server requires. For example, you might place the file references in the application server classpath.

Example

The folder ICI_HOME/docs/examples/java/res contains an example non-EJB subscriber implementation that sends an email containing event information.


Feedback

Last updated: June 2011


© Copyright IBM Corporation 2011. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)