wt.events
Class KeyedEvent

java.lang.Object
  extended bywt.events.KeyedEvent
Direct Known Subclasses:
AccessControlEvent, ActionItemEvent, AdministrativeDomainManagerEvent, AuditServiceEvent, BaselineServiceEvent, BuildSandboxEvent, ChangeService2Event, CollaborationServiceEvent, ContainerMoveEvent, ContainerTeamServiceEvent, ContentServiceEvent, CounterPartEvent, DataSharingServiceEvent, DeleteManagerEvent, DeliveryServiceEvent, EffGroupAssistantEvent, EnterpriseServiceEvent, EPMDocumentManagerEvent, EPMEventServiceEvent, EPMFamilyTableBaselineEvent, EPMWorkspaceManagerEvent, ESIResultEvent, ESIServiceEvent, ExportServiceEvent, FolderServiceEvent, ForumServiceEvent, FvServiceEvent, GraphicsServerLoaderServiceEvent, IBADefinitionServiceEvent, IdentityServiceEvent, ImportServiceEvent, LifeCycleServiceEvent, LockServiceEvent, NotebookServiceEvent, ObjectGraphServiceEvent, OccurrenceEvent, OrganizationServicesEvent, OwnershipServiceEvent, PersistenceManagerEvent, ProjectServiceEvent, ProjMgmtServiceEvent, PublishServiceEvent, ReceiverServiceEvent, RepresentationServiceEvent, RestoreServiceEvent, RoutingEvent, SandboxServiceMultiEvent, SenderServiceEvent, SessionIterationEvent, StandardManagerServiceEvent, TeamServiceEvent, TransferServiceEvent, TypeManagementServiceEvent, UfidServiceEvent, VersionControlServiceEvent, WfCustomEvent, WfDefinerServiceEvent, WfEngineServiceEvent, WorkInProgressServiceEvent, WTContainerServiceEvent

public class KeyedEvent
extends Object

A basic event class which can be used with the KeyedEventDispatcher. Although event dispatching works with class java.lang.Object and does not need wt.events.KeyedEvent, class wt.events.KeyedEvent provides basic functionality commonly used to process events.

Supported API: true

Extendable: true


Field Summary
private  String className
           
private static String CLASSNAME
           
private  String eventKey
           
private  Object eventTarget
           
private  String eventType
           
private static String RESOURCE
           
 
Constructor Summary
KeyedEvent(String eventType)
          Construct a Keyed Event

Supported API: false
KeyedEvent(String eventType, Object eventTarget)
          Construct a Keyed Event.
 
Method Summary
static String generateEventKey(Class eventClass, String eventType)
          Generate a prototype key based on the class of the concrete event class and a user defined type.
protected static String generateEventKey(String eventClass, String eventType)
          Generate a prototype key based on the class of the concrete event class and a user defined type.
 String getConceptualClassname()
          Return the conceptual class name of the concrete event class.
 String getEventKey()
          Return the event key.
 Object getEventTarget()
          Gets the value of the attribute: eventTarget; The primary target of this event.
 String getEventType()
          Gets the value of the attribute: eventType; The type of the event.
 KeyedEvent toMultiObjectEvent()
          Converts a single-object event to a multi-object event.
 KeyedEvent[] toSingleObjectEvents()
          Converts a multi-object event to an array of single-object events.
 String toString()
          Return a String representation of this event

Supported API: false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

eventType

private String eventType

eventTarget

private Object eventTarget

className

private String className

eventKey

private String eventKey
Constructor Detail

KeyedEvent

public KeyedEvent(String eventType,
                  Object eventTarget)
Construct a Keyed Event.

Supported API: false

Parameters:
eventType - The type of the event, may be null
eventTarget - The Primary target of the event, may be null

KeyedEvent

public KeyedEvent(String eventType)
Construct a Keyed Event

Supported API: false

Parameters:
eventType - The type of the event, may be null
Method Detail

getEventType

public String getEventType()
Gets the value of the attribute: eventType; The type of the event. For example, "PRE_DELETE".

Supported API: false

Returns:
String

getEventTarget

public Object getEventTarget()
Gets the value of the attribute: eventTarget; The primary target of this event. May be null.

Supported API: false

Returns:
Object

getConceptualClassname

public String getConceptualClassname()
Return the conceptual class name of the concrete event class. The default method returns instance.getClass().getName(). If the conceptual class name does not match instance.getClass().getName() then this method must to return the proper value.

Supported API: false

Returns:
String - the logical event class name.

getEventKey

public String getEventKey()
Return the event key. The default method returns

"/"

Supported API: false

Returns:
String

toSingleObjectEvents

public KeyedEvent[] toSingleObjectEvents()
                                  throws WTException
Converts a multi-object event to an array of single-object events. This occurs when an event is dispatched as multi-object (via KeyedEventDispatcher.dispatchVetoableMultiObjectEvent(java.lang.Object, java.lang.String) and KeyedEventDispatcher.dispatchMultiObjectEvent(java.lang.Object, java.lang.String)), but single-object listeners (listeners implementing KeyedEventListener.notifyVetoableEvent(java.lang.Object) and KeyedEventListener.notifyEvent(java.lang.Object)) are registered. It is necessary to convert the multi-object event to an array of single-object events to properly notify the single-object listeners.

Note: This API is called internally and only when needed by the event dispatch mechanism.

Supported API: false

Returns:
KeyedEvent[]
Throws:
WTException

toMultiObjectEvent

public KeyedEvent toMultiObjectEvent()
Converts a single-object event to a multi-object event. This occurs when an event is dispatched as singlei-object (via KeyedEventDispatcher#dispatchVetoabletEvent and KeyedEventDispatcher.dispatchEvent(java.lang.Object, java.lang.String)), but multi-object listeners (listeners implementing KeyedEventListener.notifyVetoableMultiObjectEvent(java.lang.Object) and KeyedEventListener.notifyMultiObjectEvent(java.lang.Object)) are registered. It is necessary to convert the single-object event to a multi-object event to properly notify the multi-object listeners.

Note: This API is called internally and only when needed by the event dispatch mechanism.

Supported API: false

Returns:
KeyedEvent

toString

public String toString()
Return a String representation of this event

Supported API: false

Returns:
String

generateEventKey

public static String generateEventKey(Class eventClass,
                                      String eventType)
Generate a prototype key based on the class of the concrete event class and a user defined type.

Supported API: false

Parameters:
eventClass - the class of the event to which the listeners subscribes.
eventType - the type of the event, may be null.
Returns:
String

generateEventKey

protected static String generateEventKey(String eventClass,
                                         String eventType)
Generate a prototype key based on the class of the concrete event class and a user defined type.

Supported API: false

Parameters:
eventClass - The Name of the class of the event to which the listener subscribes
eventType - the type of the event, may be null
Returns:
String