org.javasimon.callback.async
Class ExecutorProxyFactory<T>

java.lang.Object
  extended by org.javasimon.proxy.DelegatingProxyFactory<T>
      extended by org.javasimon.callback.async.ExecutorProxyFactory<T>
Type Parameters:
T -
All Implemented Interfaces:
InvocationHandler, Delegating<T>
Direct Known Subclasses:
AsyncCallbackProxyFactory

public class ExecutorProxyFactory<T>
extends DelegatingProxyFactory<T>

Proxy factory which can be used make any class asynchronous.

Author:
gerald

Field Summary
private  Executor executor
          Executor used for invoking methods on delegate object
 
Constructor Summary
ExecutorProxyFactory(T delegate)
          Constructor
ExecutorProxyFactory(T delegate, Executor executor)
          Constructor
 
Method Summary
 Executor getExecutor()
          Get used executor
protected  Object invoke(DelegatingMethodInvocation<T> delegatingMethodInvocation)
          Method to override in child classes
 void setExecutor(Executor executor)
          Set used executor
 
Methods inherited from class org.javasimon.proxy.DelegatingProxyFactory
getDelegate, invoke, newProxy, newProxy, newProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

executor

private Executor executor
Executor used for invoking methods on delegate object

Constructor Detail

ExecutorProxyFactory

public ExecutorProxyFactory(T delegate)
Constructor

Parameters:
delegate - Delegate object

ExecutorProxyFactory

public ExecutorProxyFactory(T delegate,
                            Executor executor)
Constructor

Parameters:
delegate - Delegate object
executor - Executor used, see Executors
Method Detail

getExecutor

public Executor getExecutor()
Get used executor

Returns:
Executor

setExecutor

public void setExecutor(Executor executor)
Set used executor

Parameters:
executor - Executor

invoke

protected Object invoke(DelegatingMethodInvocation<T> delegatingMethodInvocation)
                 throws Throwable
Description copied from class: DelegatingProxyFactory
Method to override in child classes

Overrides:
invoke in class DelegatingProxyFactory<T>
Parameters:
delegatingMethodInvocation - Method invocation (arguments, method name, etc.)
Returns:
Method invocation results
Throws:
Throwable - Method invocation raised exception


Copyright © 2013. All Rights Reserved.