org.jboss.soa.esb.notification
Class NotificationList

java.lang.Object
  extended by org.jboss.soa.esb.helpers.ConfigTree
      extended by org.jboss.soa.esb.notification.NotificationList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class NotificationList
extends ConfigTree

Holds lists of NotificationTarget objects so that the NotificationHandler EJB behaviour can be controlled at runtime by client applications

Description: Objects of this class will hold a list of objects that extend the NotificationTarget base class. It's main purpose is to allow Rosetta users to configure lists of recipients of specific events, and request the NotificationHandler EJB to take care of triggering the events to each object specified as a child "target" element

Author: Heuristica - Buenos Aires - Argentina

Version:
1.0
See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger _logger
           
static java.lang.String CHILD_TGT
           
static java.lang.String ELEMENT
          Mnemonic name for the XML element name for the serialized form of objects of this class
static java.lang.String TYPE
           
 
Constructor Summary
NotificationList(ConfigTree p_oP)
          Instantiate an object according to the contents of <arg 1>
 
Method Summary
 boolean isErr()
          Is this an Error (failure) NotificationList ?
 boolean isOK()
          Is this an OK (success) NotificationList ?
static void notifyAll(ConfigTree[] list, Message message)
           
 void sendNotification(Message message)
          Invoke the sendNotification() method for all targets in the list.
 
Methods inherited from class org.jboss.soa.esb.helpers.ConfigTree
addTextChild, attributeCount, attributesAsList, childCount, childPropertyList, clone, cloneObj, copyFrom, fromElement, fromInputStream, fromXml, fromXml, getAllChildren, getAttribute, getAttribute, getAttributeNames, getBooleanAttribute, getChildren, getFirstChild, getFirstTextChild, getFloatAttribute, getLongAttribute, getName, getParent, getRequiredAttribute, getTextChildren, getWholeText, isPureText, removeAllChildren, removeChildrenByName, setAttribute, setName, toString, toString, toXml, toXml
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ELEMENT

public static final java.lang.String ELEMENT
Mnemonic name for the XML element name for the serialized form of objects of this class

See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

CHILD_TGT

public static final java.lang.String CHILD_TGT
See Also:
Constant Field Values

_logger

protected static org.apache.log4j.Logger _logger
Constructor Detail

NotificationList

public NotificationList(ConfigTree p_oP)
Instantiate an object according to the contents of <arg 1>

Parameters:
p_oP - ConfigTree - Parameter object containing the information needed to instantiate this object, including child elements named "target" that represent each individual NotificationTarget object
Method Detail

sendNotification

public void sendNotification(Message message)
                      throws NotificationException
Invoke the sendNotification() method for all targets in the list. The method iterates along it's NotificationTarget child nodes and invokes the sendNotification() method with the same object to all of them

Parameters:
message - Object - The event to notify to all targets
Throws:
NotificationException - - use Exception.getMessage() at runtime

isOK

public boolean isOK()
Is this an OK (success) NotificationList ?

Returns:
boolean - Yes, Attribute "type" of constructor parameters starts with "ok", OR there was no "type" attribute in the constructor
  • A NotificationList can be both OK and Error if no "type" attribute was specified at constructor time in the ConfigTree argument
  • See Also:
    ConfigTree.getAttribute(String)

    isErr

    public boolean isErr()
    Is this an Error (failure) NotificationList ?

    Returns:
    boolean - Yes, Attribute "type" of constructor parameters starts with "err", OR there was no "type" attribute in the constructor
  • A NotificationList can be both OK and Error if no "type" attribute was specified at constructor time in the ConfigTree argument
  • See Also:
    ConfigTree.getAttribute(String)

    notifyAll

    public static void notifyAll(ConfigTree[] list,
                                 Message message)