com.ibm.broker.config.proxy

Interface AdministeredObjectListener



  • public interface AdministeredObjectListener

    Classes that implement this interface are stating that they can receive change notifications from the broker. Notifications are sent whenever objects for which the listener is registered is modified, deleted, or whenever a previously submitted request is processed.

    The AdministeredObjectListener interface is a powerful way of ensuring that IBM Integration API (CMP) applications work with up-to-date information and that any requests that these applications make to modify broker objects are processed successfully. The real benefits of using this interface come from the asynchronous and multi-user design of the broker:

    • Requests sent to the broker are processed asynchronously and, depending on the load and availability of the broker, they may not be processed immediately. It is undesirable for applications that use the IBM Integration API (CMP) to have to wait for each request to be completed before returning control to the application, as it prevents them from benefitting from the flexibility of this asynchronous design. The AdministeredObjectListener interface allows applications to be notified when their requests have actually been processed.
    • The state of the broker might periodically change as a result of other users making modifications and brokers starting, stopping and publishing other status events. Applications may wish to take action when these state changes occur, either to report the changes or to take appropriate action. The AdministeredObjectListener mechanism is an implementation of the OBSERVER design pattern that allows application code to be called when such events occur.

    In order to receive notifications, applications must first register an instance of a class that implements this interface with each administered object for which they wish to receive notifications. Here is an example of how to do this:

         BrokerProxy b = BrokerProxy.getInstance(
             new IntegrationNodeConnectionParameters("localhost", 4414)); 
         AdministeredObjectListener l = new MyAdministeredObjectListener();
         b.registerListener(l);
     

    ...where MyAdministeredObjectListener is a class that implements the AdministeredObjectListener interface, written by the application developer.

    AdministeredObjectListener notifications occur on a dedicated Java thread.

    interface com.ibm.broker.config.proxy.AdministeredObjectListener

    Responsibilities States that the implementing class is able to receive notifications from brokers via the IBM Integration API (CMP).
    Internal Collaborators com.ibm.broker.config.proxy.CompletionCodeType
    com.ibm.broker.config.proxy.AdministeredObject
    
     Change Activity:
     ---------- ----------- -------------  -------------------------------
     Reason:    Date:       Originator:    Comments:
     ---------- ----------- -------------  -------------------------------
     25103.1    2004-03-29  HDMPL          v6 Release
     44739.7    2007-07-30  HDMPL          v6.1 release:
                                               Methods now take genericized types where relevant
     51619.8    2008-12-15  HDMPL          v7 Release:
                                               The changedAttributes parameter on processModify()
                                                  can now include deleted properties.
    
     
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void processActionResponse(AdministeredObject affectedObject, CompletionCodeType ccType, java.util.List<LogEntry> bipMessages, java.util.Properties referenceProperties)
      States that the broker has processed a request that previously originated from the current connection to it.
      void processDelete(AdministeredObject deletedObject)
      States that the supplied AdministeredObject has been deleted on the broker.
      void processModify(AdministeredObject affectedObject, java.util.List<java.lang.String> changedAttributes, java.util.List<java.lang.String> newChildren, java.util.List<java.lang.String> removedChildren)
      States that the supplied AdministeredObject has been modified by the current or another application.
    • Method Detail

      • processModify

        void processModify(AdministeredObject affectedObject,
                           java.util.List<java.lang.String> changedAttributes,
                           java.util.List<java.lang.String> newChildren,
                           java.util.List<java.lang.String> removedChildren)
        States that the supplied AdministeredObject has been modified by the current or another application.
        Parameters:
        affectedObject - The object which has changed. The attributes of the object will already have been updated to contain the new information.
        changedAttributes - An unmodifiable list of Strings containing the attribute key names that have changed. See the AttributeConstants documentation for a list of valid key names. As of WebSphere Message Broker V7, this list can also include deleted properties; calling getProperty() on such a property will return null.
        newChildren - An unmodifiable list of Strings containing the object's subcomponents that were added by the latest change. To avoid the needless creation of expensive AdministeredObject instances, each entry is a String that describes one AdministeredObject. The String can be converted into an AdministeredObject instance using the affectedObject.getManagedSubcomponentFromStringRepresentation(String) method.
        removedChildren - An unmodifiable list of Strings containing the object's subcomponents that were removed by the latest change. To avoid the needless creation of expensive AdministeredObject instances, each entry is a String that describes one AdministeredObject. The String can be converted into an AdministeredObject instance using the affectedObject.getManagedSubcomponentFromStringRepresentation(String) method.
      • processDelete

        void processDelete(AdministeredObject deletedObject)
        States that the supplied AdministeredObject has been deleted on the broker.
        Parameters:
        deletedObject - The AdministeredObject that has been deleted.
      • processActionResponse

        void processActionResponse(AdministeredObject affectedObject,
                                   CompletionCodeType ccType,
                                   java.util.List<LogEntry> bipMessages,
                                   java.util.Properties referenceProperties)
        States that the broker has processed a request that previously originated from the current connection to it. The parameters of this method call indicate the result of the command that was sent, and the original command for reference.
        Parameters:
        affectedObject - The object on which a command was attempted.
        ccType - The overall completion code of the action
        bipMessages - The unmodifiable list of LogEntry instances that contains any localized BIP Messages associated with the action.
        referenceProperties - Properties of the request that caused this notification. See the AttributeConstants documentation for information regarding the set of properties that may be supplied here.