wt.locks
Class LockServiceEvent

java.lang.Object
  extended bywt.events.KeyedEvent
      extended bywt.locks.LockServiceEvent
All Implemented Interfaces:
Serializable

public class LockServiceEvent
extends KeyedEvent
implements Serializable

Provides an abstraction of an extended keyed event used in conjunction with the standard implementation of the server-side functionality as defined by the LockService interface. This event could also be used by a custom implementation of the LockService.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static String POST_LOCK
          A constant that defines an event marking the occurrance of a persistent lock that has completed.
static String POST_UNLOCK
          A constant that defines an event marking the occurrance of a persistent unlock that has completed.
static String PRE_LOCK
          A constant that defines an event marking the occurrance of a persistent lock that is about to commense.
static String PRE_UNLOCK
          A constant that defines an event marking the occurrance of a persistent unlock that is about to commense.
private static String RESOURCE
           
private  LockService service
           
 
Fields inherited from class wt.events.KeyedEvent
 
Constructor Summary
LockServiceEvent(LockService service, String eventType, Object eventTarget)
          Constructs an locking service's event from the specified service and its event type and target.
LockServiceEvent(String eventType, Object eventTarget)
          

Supported API: false
LockServiceEvent(String eventType, WTCollection targetObjects)
          

Supported API: false
 
Method Summary
static String generateEventKey(String eventType)
          Generates an event key from an event type.
 LockService getService()
          Gets the value of the attribute: service; The locking service that dispatched the event.
 Lockable getTarget()
          Gets the lockable object target of the event.
 WTCollection getTargets()
          Returns WTCollection of event targets.
protected  void setService(LockService a_Service)
          Sets the value of the attribute: service; The locking service that dispatched the event.
 KeyedEvent toMultiObjectEvent()
          Given a single object event convert it to a multi object event with a WTCollection target.
 KeyedEvent[] toSingleObjectEvents()
          Given an event with a target object of type WTCollection convert it to an array of single object KeyedEvents.
 
Methods inherited from class wt.events.KeyedEvent
generateEventKey, generateEventKey, getConceptualClassname, getEventKey, getEventTarget, 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

PRE_LOCK

public static final String PRE_LOCK
A constant that defines an event marking the occurrance of a persistent lock that is about to commense. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

POST_LOCK

public static final String POST_LOCK
A constant that defines an event marking the occurrance of a persistent lock that has completed. Listener's of this event can perform post-processing related to the locking of an object, and can stipulate that postconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

PRE_UNLOCK

public static final String PRE_UNLOCK
A constant that defines an event marking the occurrance of a persistent unlock that is about to commense. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

POST_UNLOCK

public static final String POST_UNLOCK
A constant that defines an event marking the occurrance of a persistent unlock that has completed. Listener's of this event can perform post-processing related to the unlocking of an object, and can stipulate that postconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

service

private LockService service
Constructor Detail

LockServiceEvent

public LockServiceEvent(LockService service,
                        String eventType,
                        Object eventTarget)
                 throws LockException,
                        WTPropertyVetoException
Constructs an locking service's event from the specified service and its event type and target.

Supported API: false

Parameters:
service -
eventType -
eventTarget -
Throws:
LockException
WTPropertyVetoException

LockServiceEvent

public LockServiceEvent(String eventType,
                        WTCollection targetObjects)


Supported API: false

Parameters:
eventType -
targetObjects -

LockServiceEvent

public LockServiceEvent(String eventType,
                        Object eventTarget)


Supported API: false

Parameters:
eventType -
eventTarget -
Method Detail

getService

public LockService getService()
Gets the value of the attribute: service; The locking service that dispatched the event.

Supported API: false

Returns:
LockService

setService

protected void setService(LockService a_Service)
                   throws WTPropertyVetoException
Sets the value of the attribute: service; The locking service that dispatched the event.

Supported API: false

Parameters:
a_Service -
Throws:
WTPropertyVetoException

generateEventKey

public static String generateEventKey(String eventType)
Generates an event key from an event type.

Supported API: false

Parameters:
eventType -
Returns:
String

getTarget

public Lockable getTarget()
Gets the lockable object target of the event.

Supported API: true

Returns:
Lockable
See Also:
wt.locks.PRE_LOCK, wt.locks.POST_LOCK, wt.locks.PRE_UNLOCK, wt.locks.POST_UNLOCK

toMultiObjectEvent

public KeyedEvent toMultiObjectEvent()
Given a single object event convert it to a multi object event with a WTCollection target.

Supported API: false

Overrides:
toMultiObjectEvent in class KeyedEvent
Returns:
KeyedEvent

toSingleObjectEvents

public KeyedEvent[] toSingleObjectEvents()
                                  throws WTException
Given an event with a target object of type WTCollection convert it to an array of single object KeyedEvents.

Supported API: false

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

getTargets

public WTCollection getTargets()
Returns WTCollection of event targets.

Supported API: false

Returns:
WTCollection