|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.web.bindery.event.shared.Event<H> com.google.gwt.event.shared.GwtEvent<H> com.tibco.bpm.web.client.model.pagebus.hub.ManagedEvent<H>
H
- Handler type.
©2011 Cloud Software Group, Inc.public abstract class ManagedEvent<H extends com.google.gwt.event.shared.EventHandler>
The ManagedEvent class extends the normal GWT Event/Handler model and results in a PageBusMessage being transparently published on the ManagedHub. Normal GWT event handlers can be added for the event on both the sending (publishing) and receiving (subscribing) side of the ManagedHub. The event is transparently recreated and fired on the receiving side of the ManagedHub.
Class specific data is converted to and from a PageBusMessage using the toPageBusMessage and fromPageBusMessage methods. When the instance is created using the gwt-create generated class the default implementation of the abstract methods: toPageBusMessage, fromPageBusMessage, and dispatchLocal is used. The extending class can optionally provide the implementation for these abstract methods if there is special handling required.
TemplateManagedEvent
Nested Class Summary | |
---|---|
static class |
ManagedEvent.DispatchScope
Controls how a ManagedEvent is dispatched: LOCAL - Dispatch is done locally only. MANAGED_HUB - Dispatch is done on the Managed Hub only. BOTH - Dispatch is done both locally and on the Managed Hub. This value is set on the dispatchScope property. |
Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent |
---|
com.google.gwt.event.shared.GwtEvent.Type<H> |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_VERSION
|
static java.lang.String |
EXT_SUFFIX
|
Constructor Summary | |
---|---|
protected |
ManagedEvent()
|
Method Summary | |
---|---|
protected void |
dispatch(H handler)
|
protected abstract void |
dispatchLocal(H handler)
Called by the ManagedEvent dispatch method to locally dispatch the event to the class specific handler. |
ManagedEvent<?> |
fromJsonString(java.lang.String json)
|
protected abstract ManagedEvent<?> |
fromPageBusMessage(PageBusMessage pageBusMessage)
Converts the given PageBusMessage to a ManagedEvent. |
protected ManagedEvent<?> |
fromPageBusMessageDefault(PageBusMessage pageBusMessage)
The default implementation of the fromPageBusMessageDefault method which is called by the gwt-create generated fromPageBusMessageDefault method. |
ManagedEvent.DispatchScope |
getDispatchScope()
|
java.lang.String |
getEventSourceId()
Gets the eventSourceId value. |
org.jsonmaker.gwt.client.Jsonizer |
getJsonizer()
Returns the Jsonizer for this ManagedEvent type. |
java.lang.String |
getManagedEventVersion()
The managedEventVersion can be used to distinguish between different data versions of the ManagedEvent class. |
protected java.lang.String |
getReceivedSchemaId()
|
protected java.lang.String |
getSchemaId()
The schemaId is used to set the schemaId property of the PageBusMessage that is created if this event is published on the ManagedEventBus. |
protected Subscription |
getSubscription()
Gets the subscription value. |
java.lang.String |
getTopic()
Returns the topic that will be used to publish and subscribe on the PageBus ManagedHub for this ManagedEvent. |
boolean |
isCacheEnabled()
Gets the cacheEnabled value. |
protected boolean |
isDispatched()
|
boolean |
isFireWhenReceivedFromManagedHub()
|
boolean |
isReceivedFromManagedHub()
Gets the receivedFromManagedHub value. |
boolean |
isRegistered()
Gets the registered value. |
void |
setCacheEnabled(boolean cacheEnabled)
Sets the cacheEnabled value. |
protected void |
setDispatched(boolean dispatched)
|
void |
setDispatchScope(ManagedEvent.DispatchScope dispatchScope)
|
java.lang.String |
setEventSourceId(java.lang.String eventSourceId)
Sets the eventSourceId value and returns the resulting topic. |
void |
setFireWhenReceivedFromManagedHub(boolean fireWhenReceivedFromManagedHub)
|
void |
setManagedEventVersion(java.lang.String managedEventVersion)
|
protected void |
setReceivedSchemaId(java.lang.String receivedSchemaId)
|
protected void |
setRegistered(boolean registered)
Sets the registered value. |
protected void |
setSubscription(Subscription subscription)
Sets the subscription value. |
java.lang.String |
toJsonString()
|
protected abstract PageBusMessage |
toPageBusMessage()
Converts this ManagedEvent to a PageBusMessage. |
protected PageBusMessage |
toPageBusMessageDefault()
The default implementation of the toPageBusMessage method which is called by the gwt-create generated toPageBusMessage method. |
Methods inherited from class com.google.gwt.event.shared.GwtEvent |
---|
assertLive, getAssociatedType, getSource, isLive, kill, revive |
Methods inherited from class com.google.web.bindery.event.shared.Event |
---|
setSource, toDebugString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String EXT_SUFFIX
public static final java.lang.String DEFAULT_VERSION
Constructor Detail |
---|
protected ManagedEvent()
Method Detail |
---|
public final java.lang.String getTopic()
protected final void dispatch(H handler)
dispatch
in class com.google.gwt.event.shared.GwtEvent<H extends com.google.gwt.event.shared.EventHandler>
protected abstract void dispatchLocal(H handler)
handler
- protected abstract PageBusMessage toPageBusMessage()
fromPageBusMessage(PageBusMessage)
method.
Note: The topic value of the PageBusMessage is always set to the topic
value of the ManagedEvent before the event is dispatch so there is no
need to set the topic value on the PageBusMessage.
Note: If the schemaId value of the PageBusMessage has not been explicitly
set (schemaId == null or PageBusMessage.DEFAULT_SCHEMA_ID) then its value
will be set to the fully qualified class name.
fromPageBusMessage(PageBusMessage)
protected final PageBusMessage toPageBusMessageDefault()
fromPageBusMessage(PageBusMessage)
protected abstract ManagedEvent<?> fromPageBusMessage(PageBusMessage pageBusMessage)
pageBusMessage
- The PageBusMessage instance.
toPageBusMessage()
protected final ManagedEvent<?> fromPageBusMessageDefault(PageBusMessage pageBusMessage)
pageBusMessage
- The PageBusMessage instance.
toPageBusMessage()
protected java.lang.String getSchemaId()
public boolean isReceivedFromManagedHub()
public java.lang.String setEventSourceId(java.lang.String eventSourceId)
eventSourceId
- The id value to set.
ManagedEventChangeException
public java.lang.String getEventSourceId()
setEventSourceId(String)
public void setCacheEnabled(boolean cacheEnabled)
cacheEnabled
- The cacheEnabled value to set.
ManagedEventChangeException
public boolean isCacheEnabled()
protected void setRegistered(boolean registered)
registered
- The registered value to set.public boolean isRegistered()
protected void setSubscription(Subscription subscription)
subscription
- The subscription value to set.protected Subscription getSubscription()
public org.jsonmaker.gwt.client.Jsonizer getJsonizer()
public java.lang.String toJsonString()
public ManagedEvent<?> fromJsonString(java.lang.String json)
public ManagedEvent.DispatchScope getDispatchScope()
public void setDispatchScope(ManagedEvent.DispatchScope dispatchScope)
protected java.lang.String getReceivedSchemaId()
protected void setReceivedSchemaId(java.lang.String receivedSchemaId)
public java.lang.String getManagedEventVersion()
public void setManagedEventVersion(java.lang.String managedEventVersion)
protected boolean isDispatched()
protected void setDispatched(boolean dispatched)
public boolean isFireWhenReceivedFromManagedHub()
public void setFireWhenReceivedFromManagedHub(boolean fireWhenReceivedFromManagedHub)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |