org.ow2.util.event.api
Interface IEventToken


public interface IEventToken

Define methods need to manage events processing.

Author:
missonng

Method Summary
 void allocate()
          Allocate a new thread to process this event.
 boolean join(EventPriority priority, long timeout)
          Wait for the event to be process.
 boolean join(EventPriority priority, long timeout, boolean kill)
          Wait for the event to be process.
 boolean join(long timeout)
          Wait for the event to be process.
 boolean join(long timeout, boolean kill)
          Wait for the event to be process.
 void terminate()
          Terminate the event processing.
 

Method Detail

terminate

void terminate()
Terminate the event processing.


allocate

void allocate()
Allocate a new thread to process this event.


join

boolean join(long timeout)
             throws java.lang.InterruptedException
Wait for the event to be process.

Parameters:
timeout - How long to wait for the event to be process.
Returns:
True if the event has terminate its process before the timeout, false otherwise.
Throws:
java.lang.InterruptedException - If the thread has been interrupted.

join

boolean join(long timeout,
             boolean kill)
             throws java.lang.InterruptedException
Wait for the event to be process.

Parameters:
timeout - How long to wait for the event to be process.
kill - If true, kill the event processing if it not terminated before timeout.
Returns:
True if the event has terminate its process before the timeout, false otherwise.
Throws:
java.lang.InterruptedException - If the thread has been interrupted.

join

boolean join(EventPriority priority,
             long timeout)
             throws java.lang.InterruptedException
Wait for the event to be process.

Parameters:
priority - Only wait for the specified priority to be process.
timeout - How long to wait for the event to be process.
Returns:
True if the event has terminate its process before the timeout, false otherwise.
Throws:
java.lang.InterruptedException - If the thread has been interrupted.

join

boolean join(EventPriority priority,
             long timeout,
             boolean kill)
             throws java.lang.InterruptedException
Wait for the event to be process.

Parameters:
priority - Only wait for the specified priority to be process.
timeout - How long to wait for the event to be process.
kill - If true, kill the event processing if it not terminated before timeout.
Returns:
True if the event has terminate its process before the timeout, false otherwise.
Throws:
java.lang.InterruptedException - If the thread has been interrupted.


Copyright © 2007-2009 OW2 Consortium. All Rights Reserved.