org.perfectjpattern.core.structural.proxy
Class SynchronizedProxy<C>
java.lang.Object
org.perfectjpattern.core.structural.AbstractSurrogate<C,C>
org.perfectjpattern.core.structural.proxy.AbstractProxy<C>
org.perfectjpattern.core.structural.proxy.SynchronizedProxy<C>
- Type Parameters:
C
- Decorated Component type
- All Implemented Interfaces:
- InvocationHandler, ISurrogate<C>, IProxy<C>
public class SynchronizedProxy<C>
- extends AbstractProxy<C>
Concrete componentized implementation of IDecorator<C>
that provides synchronized protection to any class type.
- Version:
- $Revision: 1.0 $ $Date: Nov 25, 2007 4:11:47 PM $
- Author:
- Giovanni Azua
-
-
Constructor Summary |
SynchronizedProxy(Class<C> anInterface,
C aComponent)
Creates a SynchronizedDecorator<E> from a Component
interface type and instance. |
SynchronizedProxy
public SynchronizedProxy(Class<C> anInterface,
C aComponent)
throws IllegalArgumentException
- Creates a
SynchronizedDecorator<E>
from a Component
interface type and instance.
- Parameters:
anInterface
- The Component interface type.aComponent
- The Component instance to Decorate.
- Throws:
IllegalArgumentException
- 'anInterface' must not be null.
IllegalArgumentException
- 'anInterface' must be an interface type.
IllegalArgumentException
- 'aComponent' must not be null.
invokeUnderlying
protected Object invokeUnderlying(Method anMethod,
Object[] anArguments)
throws Throwable
- Returns the result of the Method invocation. This method has two
main purposes:
- Provides facility to invoke a method on the actual Underlying
- Concrete surrogate implementations that override this method have
a single point to control access to the actual Underlying method
invokation.
- Overrides:
invokeUnderlying
in class AbstractSurrogate<C,C>
- Parameters:
anMethod
- Method to invokeanArguments
- Array of input arguments for the Method to invoke
- Returns:
- result of the Method invocation
- Throws:
Throwable
Copyright © 2007-2009. All Rights Reserved.