com.glaivestone.javax.util
Class ConfirmationEventObject

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.glaivestone.javax.util.ConfirmationEventObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SessionEvent, WindowEvent

public class ConfirmationEventObject
extends java.util.EventObject

A ConfirmationEventObject is used for confirmation event notifications representing a proposal which can be vetoed by a listener.

The specification of a confirmation event must define both the proposal represented by the event notification and the voting policy which determines whether the proposal is accepted if there are any vetos.. A typical voting policy for an action proposal is that any veto cancels the proposal. Other examples of voting policies include majority vote confirms the proposal, threshold count of number of listeners who must accept or reject the proposal, etc.

A confirmation event is vetoed by sending the veto message. The source object which fires a confirmation event is responsible for handling VetoException and providing an implementation of the voting policy.

Origins

Confirmation events and the use of veto exceptions to implement voting policies on vetoable events is based on concepts from the Visual Smalltalk event system.

Author:
Deb Lewis
See Also:
Serialized Form

Constructor Summary
ConfirmationEventObject(java.lang.Object source)
          Constructs a new veto-able ConfirmationEventObject.
ConfirmationEventObject(java.lang.Object source, boolean isVetoable)
          Constructs a new ConfirmationEventObject.
 
Method Summary
 void veto()
          Veto the proposed action.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfirmationEventObject

public ConfirmationEventObject(java.lang.Object source)
Constructs a new veto-able ConfirmationEventObject.

Parameters:
source - The object on which the event initially occurred.

ConfirmationEventObject

public ConfirmationEventObject(java.lang.Object source,
                               boolean isVetoable)
Constructs a new ConfirmationEventObject.

Parameters:
source - The object on which the event initially occurred.
Method Detail

veto

public void veto()
          throws VetoException
Veto the proposed action.

This service is used by a listener to veto a confirmation event.

Throws:
VetoException - Veto the proposed action

GFL 1.1 API