org.curjent.impl.agent
Class Insider

java.lang.Object
  extended by org.curjent.impl.agent.Insider

public final class Insider
extends Object

Static utility methods used by the public API and its generated classes. Most are implemented here in order to keep access to the controller restricted.


Constructor Summary
Insider()
           
 
Method Summary
static boolean debug(Throwable exception)
          Prints the stack trace for an exception.
static RuntimeException evaluate(Throwable exception)
          Casts or converts a Throwable to a RuntimeException and returns it.
static AgentConfig getConfig(Object agent, Object oldKey, Object newKey)
          Implementation for Agent.getConfig(Object, Object, Object) and related methods.
static Executor getDefaultExecutor()
          Implementation for Agent.getDefaultExecutor().
static AgentCall<Object> getLastCall(Object agent)
          Implementation for Agent.getLastCall(Object).
static AgentStats getStats(Object agent)
          Implementation for Agent.getStats(Object).
static AgentCall<Object> getThisCall()
          Implementation for Agent.getThisCall().
static Object newInstance(AgentLoader loader, Class<?>[] interfaces, AgentTasks tasks, Class<?> taskType)
          Implementation for Agent.newInstance(AgentLoader, Class[], AgentTasks, Class) and related methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Insider

public Insider()
Method Detail

newInstance

public static Object newInstance(AgentLoader loader,
                                 Class<?>[] interfaces,
                                 AgentTasks tasks,
                                 Class<?> taskType)
Implementation for Agent.newInstance(AgentLoader, Class[], AgentTasks, Class) and related methods.


getConfig

public static AgentConfig getConfig(Object agent,
                                    Object oldKey,
                                    Object newKey)
Implementation for Agent.getConfig(Object, Object, Object) and related methods.


getStats

public static AgentStats getStats(Object agent)
Implementation for Agent.getStats(Object).


getDefaultExecutor

public static Executor getDefaultExecutor()
Implementation for Agent.getDefaultExecutor(). It accesses the private default executor instance.


getLastCall

public static AgentCall<Object> getLastCall(Object agent)
Implementation for Agent.getLastCall(Object).


getThisCall

public static AgentCall<Object> getThisCall()
Implementation for Agent.getThisCall().


evaluate

public static RuntimeException evaluate(Throwable exception)
Casts or converts a Throwable to a RuntimeException and returns it. If the given exception is an instanceof Error, it is cast to Error and thrown.

This utility is used by the generated proxies to evaluate exceptions thrown by the agent or task while sending or executing a call. The proxy will catch and rethrow declared checked exceptions. It evaluates other exceptions and throws the result.


debug

public static boolean debug(Throwable exception)
Prints the stack trace for an exception. Returns true so that this call can be used in an assert statement and therefore disabled when assertions are disabled.



Copyright 2009-2011 Tom Landon
Apache License 2.0