wt.sandbox
Class SandboxServiceMultiEvent

java.lang.Object
  extended bywt.events.KeyedEvent
      extended bywt.sandbox.SandboxServiceMultiEvent
All Implemented Interfaces:
Cloneable, Serializable
Direct Known Subclasses:
SandboxServiceCheckinEvent, SandboxServiceCheckoutEvent, SandboxServiceInitialCheckinEvent, SandboxServiceUndoCheckoutEvent

public abstract class SandboxServiceMultiEvent
extends KeyedEvent
implements Cloneable, Serializable

Abstract service event base class for service events in wt.sandbox which are purely multi-object in nature. Such events intentionally do not provide any ability to be converted to single-object events. This common base class ensures a common implementation of such behavior.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
private  boolean singleObjectEvent
          Whether this event is a single-object event.
private  Object singleObjectEventTarget
          The target object for a single-object event.
private static boolean throwInSingleObjectEventGetEventTarget
          Whether we'll throw an UnsupportedOperationException in getEventTarget() for any single object event.
private static boolean throwInToSingleObjectEvents
          Whether we'll throw an UnsupportedOperationException in toSingleObjectEvents().
 
Fields inherited from class wt.events.KeyedEvent
 
Constructor Summary
SandboxServiceMultiEvent(String eventType, Object target)
          Pass through constructor.
 
Method Summary
private  SandboxServiceMultiEvent cloneNoExceptions()
          Internal utility to clone that wraps any CloneNotSupportedException thrown in WTRuntimeExceptions.
 Object getEventTarget()
          Get event target.
 KeyedEvent toMultiObjectEvent()
          Return this event object, i.e.
 KeyedEvent[] toSingleObjectEvents()
          This operation is not supported for this class and its subclasses.
 
Methods inherited from class wt.events.KeyedEvent
generateEventKey, generateEventKey, getConceptualClassname, getEventKey, getEventType, toString
 
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

throwInToSingleObjectEvents

private static boolean throwInToSingleObjectEvents
Whether we'll throw an UnsupportedOperationException in toSingleObjectEvents().


throwInSingleObjectEventGetEventTarget

private static boolean throwInSingleObjectEventGetEventTarget
Whether we'll throw an UnsupportedOperationException in getEventTarget() for any single object event.


singleObjectEvent

private boolean singleObjectEvent
Whether this event is a single-object event.


singleObjectEventTarget

private Object singleObjectEventTarget
The target object for a single-object event. This field is separate to maintain original multi-object event target in single object case for purposes of troubleshooting, etc.

Constructor Detail

SandboxServiceMultiEvent

public SandboxServiceMultiEvent(String eventType,
                                Object target)
Pass through constructor.

Supported API: false

Parameters:
eventType - The type of the event
target - target object of event
Method Detail

toSingleObjectEvents

public final KeyedEvent[] toSingleObjectEvents()
                                        throws WTException
This operation is not supported for this class and its subclasses.

Given this, this operation's behavior is not defined. For instance, it may throw an UnsupportedOperationException. On the other hand, it may just produce warning messages to System.err and throw an UnsupportedOperationsException on attempts to call getEventTarget().

Supported API: false

Overrides:
toSingleObjectEvents in class KeyedEvent
Returns:
KeyedEvent[]
Throws:
WTException

toMultiObjectEvent

public final KeyedEvent toMultiObjectEvent()
Return this event object, i.e. instances of this class and its subclasses are always multi-object events.

Supported API: false

Overrides:
toMultiObjectEvent in class KeyedEvent
Returns:
KeyedEvent

getEventTarget

public final Object getEventTarget()
Get event target. Overriden to throw exception when the event is a single object event when so configured.

Overrides:
getEventTarget in class KeyedEvent
Returns:
Object

cloneNoExceptions

private SandboxServiceMultiEvent cloneNoExceptions()
Internal utility to clone that wraps any CloneNotSupportedException thrown in WTRuntimeExceptions.