Graphene Selenium: API 2.0.0.Alpha1

org.jboss.arquillian.ajocado.framework
Class GrapheneConfigurationContext

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

public final class GrapheneConfigurationContext
extends Object
implements InvocationHandler

Context for keeping thread local context of GrapheneConfiguration.

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

All methods on returned proxy will be invoked on GrapheneConfiguration 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 GrapheneConfiguration getProxy()
          Returns the instance of proxy to thread local context of GrapheneConfiguration
 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(GrapheneConfiguration configuration)
          Sets the GrapheneConfiguration 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(GrapheneConfiguration configuration)
Sets the GrapheneConfiguration context for current thread

Parameters:
configuration - the GrapheneConfiguration 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 GrapheneConfiguration getProxy()
Returns the instance of proxy to thread local context of GrapheneConfiguration

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

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

Graphene Selenium: API 2.0.0.Alpha1

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.