org.hudsonci.maven.eventspy.common
Class CallbackManager

java.lang.Object
  extended by org.hudsonci.maven.eventspy.common.CallbackManager

public class CallbackManager
extends Object

Manages the Callback instance.

Since:
2.1.0
Author:
Jason Dillon

Constructor Summary
CallbackManager()
           
 
Method Summary
static Callback get(long timeout, TimeUnit unit)
          Get the Callback instance.
static void set(Callback target)
          Sets the Callback instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackManager

public CallbackManager()
Method Detail

get

public static Callback get(long timeout,
                           TimeUnit unit)
Get the Callback instance. If no instance is installed will wait until its available.

Returns:
The callback instance; never null
Throws:
RuntimeException - Callback not installed in time, or interrupted while waiting for callback installation.

set

public static void set(Callback target)
Sets the Callback instance. Notifies getter if it is waiting. Instance can only be set once.



Copyright © 2004-2011 Hudson. All Rights Reserved.