Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tibco.bpm.web.client.model.managedevents
Class TemplateManagedEvent

    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<TemplateManagedEventHandler>
                  com.tibco.bpm.web.client.model.managedevents.TemplateManagedEvent

    public abstract class TemplateManagedEvent

extends ManagedEvent<TemplateManagedEventHandler>

Provides an example of a ManagedEvent class.

Instances must be created using GWT.create(TemplateManagedEvent.class) unless the class is made concrete (See note below). The generated type is created using the ManagedEventGenerator class and has a type name of this class name with ManagedEvent.EXT_SUFFIX appended to the end: TemplateManagedEvent_Ext_ManagedEvent

The @DispatchScope(ManagedEvent.DispatchScope) annotation can be used when the type is generated to set the initial value of the dispatchScope property. If this is not specified the default value is ManagedEvent.DispatchScope.LOCAL. Note that the initial value can be changed using the ManagedEvent setDispatchScope(DispatchScope dispatchScope) method. The ManagedEventGenerator will create the default implementation for the three abstract methods:

- dispatchLocal - Called by the ManagedEvent dispatch method to locally dispatch the event to the class specific handler.
- toPageBusMessage - Serializes the event data into a JSONValue to be sent via a PageBusMessage. The generated method uses gwt-jsonmaker to serialize.
- fromPageBusMessage - Deserializes the ManagedEvent instance from the JSONValue of the given PageBusMessage. The generated method uses gwt-jsonmaker to deserialize.

These may optionally be given a concrete implementation even when GWT.create is used. The ManagedEventGenerator will only create the default implementation if the class does not define a concrete method. This may be used to handle special dispatch actions or data serialization if required.

If this class is made concrete by implementing all of the three abstract methods then the instances can be created using new TemplateManagedEvent().

The three template files provided in this example are:

- HasTemplateManagedEventHandler (Interface for HasEvents)
- TemplateManagedEvent (Class extending ManagedEvent)
- TemplateManagedEventHandler (Interface for EventHandler)

These files can be copied and used as a starting point in creating new custom ManagedEvent classes. For each file replace all TemplateManagedEvent text and file names with the new custom event name. For example replace all TemplateManagedEvent text and file names with NewCustomEvent:

- HasNewCustomEventHandler
- NewCustomEvent
- NewCustomEventHandler

A new custom ManagedEvent class can be modified to provide the required data replacing the template sampleData and accessor methods.

The new custom ManagedEvent class can now be registered, handers added and events fired using the `ManagedEventBus` class.

©2012 TIBCO Software Inc.

Since:
  2.0.0

Nested Class Summary

Nested classes/interfaces inherited from class com.tibco.bpm.web.client.model.pagebus.hub.ManagedEvent
`ManagedEvent.DispatchScope`

Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent
`com.google.gwt.event.shared.GwtEvent.Type<H>`

Field Summary
`static com.google.gwt.event.shared.GwtEvent.Type<TemplateManagedEventHandler>` | `TYPE`

Fields inherited from class com.tibco.bpm.web.client.model.pagebus.hub.ManagedEvent
`DEFAULT_VERSION, EXT_SUFFIX`

Constructor Summary
`TemplateManagedEvent()`

Method Summary
`static TemplateManagedEvent` | `create()`
`static TemplateManagedEvent` | `create(java.lang.String sampleData, java.lang.String transientData)`
`com.google.gwt.event.shared.GwtEvent.Type<TemplateManagedEventHandler>` | `getAssociatedType()`
`java.lang.String` | `getSampleData()`
`java.lang.String` | `getTransientData()`
`void` | `setSampleData(java.lang.String sampleData)`
`void` | `setTransientData(java.lang.String transientData)`

Methods inherited from class com.tibco.bpm.web.client.model.pagebus.hub.ManagedEvent
`dispatch, dispatchLocal, fromJsonString, fromPageBusMessage, fromPageBusMessageDefault, getDispatchScope, getEventSourceId, getJsonizer, getManagedEventVersion, getReceivedSchemaId, getSchemaId, getSubscription, getTopic, isCacheEnabled, isDispatched, isFireWhenReceivedFromManagedHub, isReceivedFromManagedHub, isRegistered, setCacheEnabled, setDispatched, setDispatchScope, setEventSourceId, setFireWhenReceivedFromManagedHub, setManagedEventVersion, setReceivedSchemaId, setRegistered, setSubscription, toJsonString, toPageBusMessage, toPageBusMessageDefault`

Methods inherited from class com.google.gwt.event.shared.GwtEvent
`assertLive, 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

### TYPE

    public static com.google.gwt.event.shared.GwtEvent.Type<TemplateManagedEventHandler> TYPE

Constructor Detail

### TemplateManagedEvent

    public TemplateManagedEvent()

Method Detail

### create

    public static TemplateManagedEvent create()

### create

    public static TemplateManagedEvent create(java.lang.String sampleData,
                                              java.lang.String transientData)

### getAssociatedType

    public com.google.gwt.event.shared.GwtEvent.Type<TemplateManagedEventHandler> getAssociatedType()

  Overrides:
    `getAssociatedType` in class `com.google.gwt.event.shared.GwtEvent<TemplateManagedEventHandler>`

### getSampleData

    @NotNull
    public java.lang.String getSampleData()

### setSampleData

    public void setSampleData(java.lang.String sampleData)

### getTransientData

    public java.lang.String getTransientData()

### setTransientData

    public void setTransientData(java.lang.String transientData)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2015 TIBCO Software Inc. All Rights Reserved.