Ajocado API 1.0.0.Alpha2

org.jboss.arquillian.ajocado.framework
Class AjocadoConfigurationContext

java.lang.Object
  extended by org.jboss.arquillian.ajocado.framework.AjocadoConfigurationContext
All Implemented Interfaces:
InvocationHandler

public final class AjocadoConfigurationContext
extends Object
implements InvocationHandler

Context for keeping thread local context of AjocadoConfiguration.

Provides getProxy() method for accessing that context over model of your tests.

All methods on returned proxy will be invoked on AjocadoConfiguration instance associated with current thread.

Proxy specifically handles the situations when no context is set - in this situation, IllegalStateException is thrown.

Version:
$Revision$
Author:
Lukas Fryc

Method Summary
static AjocadoConfiguration getProxy()
          Returns the instance of proxy to thread local context of AjocadoConfiguration
 Object invoke(Object proxy, Method method, Object[] args)
          End point for handling invocations on proxy
static boolean isInitialized()
          Returns true if configuration context is associated with current thread.
static void set(AjocadoConfiguration configuration)
          Sets the AjocadoConfiguration context for current thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

set

public static void set(AjocadoConfiguration configuration)
Sets the AjocadoConfiguration context for current thread

Parameters:
configuration - the AjocadoConfiguration instance

isInitialized

public static boolean isInitialized()
Returns true if configuration context is associated with current thread.

Returns:
true if configuration context is associated with current thread, false otherwise.

getProxy

public static AjocadoConfiguration getProxy()
Returns the instance of proxy to thread local context of AjocadoConfiguration

Returns:
the instance of proxy to thread local context of AjocadoConfiguration

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
End point for handling invocations on proxy

Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

Ajocado API 1.0.0.Alpha2

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.