com.eliasbalasis.tibcopagebus4gwt.client
Class PageBusEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.eliasbalasis.tibcopagebus4gwt.client.PageBusEvent
All Implemented Interfaces:
java.io.Serializable

public final class PageBusEvent
extends java.util.EventObject

Instances of this class cannot be created but a new instance is created and passed as parameter to the related event handler (PageBusListener.onPageBusSubscriptionCallback(PageBusEvent))
Use getSubject() to extract the message's unique identity
Use getMessage(org.juglar.gwt.jsonizer.client.Jsonizer) method to extract the message data as a java object
Use getSubscriberData(org.juglar.gwt.jsonizer.client.Jsonizer) method to extract the data associated upon subscription. (PageBusAdapter.PageBusSubscribe(java.lang.String, java.lang.Object, org.juglar.gwt.jsonizer.client.Jsonizer, java.lang.Object, org.juglar.gwt.jsonizer.client.Jsonizer))

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Method Summary
 java.lang.Object getMessage(org.juglar.gwt.jsonizer.client.Jsonizer jsonizer)
          Extracts the java object representation of the message data using a custom marshaller.
 IPageBusAdapter getSender()
          A reference to the PageBusAdapter instance which fired the event
 java.lang.String getSubject()
           
 java.lang.Object getSubscriberData(org.juglar.gwt.jsonizer.client.Jsonizer jsonizer)
          Extracts the java object representation of the subscriber data using a custom marshaller.
The marshaller implementation must match the type of the data associated with the message otherwise a related exception will be thrown
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getSubject

public java.lang.String getSubject()
Returns:
A unique identity representing the type of the message assigned. Can be any arbitrary value but package notation format is used in the majority of cases. This is also the practice recommended by TIBCO PageBus, the manufacturer of the underlying JavaScript framework.
Example
com.mycompany.mypackage.myevent or com.mycompany.mypackage.mysubpackage.myevents.event1

getSender

public IPageBusAdapter getSender()
A reference to the PageBusAdapter instance which fired the event

Returns:
The message sender

getMessage

public java.lang.Object getMessage(org.juglar.gwt.jsonizer.client.Jsonizer jsonizer)
                            throws PageBusAdapterException
Extracts the java object representation of the message data using a custom marshaller.
The marshaller implementation must match the type of the data associated with the message otherwise a related exception will be thrown

Parameters:
jsonizer - A reference to the marshaller implementation. See PageBusAdapter for more details
Returns:
The java object representation of the message data. It must be converted to the associated Java type
Throws:
PageBusAdapterException - If conversion to Java object fails the thrown exception is expected to contain the originating exception (org.juglar.gwt.jsonizer.client.JsonizerException) representing the error in more detail

getSubscriberData

public java.lang.Object getSubscriberData(org.juglar.gwt.jsonizer.client.Jsonizer jsonizer)
                                   throws PageBusAdapterException
Extracts the java object representation of the subscriber data using a custom marshaller.
The marshaller implementation must match the type of the data associated with the message otherwise a related exception will be thrown

Parameters:
jsonizer - A reference to the marshaller implementation. See PageBusAdapter for more details
Returns:
The java object representation of the message data. It must be converted to the associated Java type
Throws:
PageBusAdapterException - If conversion to Java object fails the thrown exception is expected to contain the originating exception (org.juglar.gwt.jsonizer.client.JsonizerException) representing the error in more detail