org.perfectjpattern.core.structural.proxy
Class AbstractProxy<C>

java.lang.Object
  extended by org.perfectjpattern.core.structural.AbstractSurrogate<C,C>
      extended by org.perfectjpattern.core.structural.proxy.AbstractProxy<C>
Type Parameters:
C - Decorated Component type
All Implemented Interfaces:
InvocationHandler, ISurrogate<C>, IProxy<C>
Direct Known Subclasses:
ImageProxy, SynchronizedProxy

public abstract class AbstractProxy<C>
extends AbstractSurrogate<C,C>
implements IProxy<C>

Componentized implementation of IProxy interface. Provides special access to the underlying Subject.

Version:
$Revision: 1.0 $ $Date: Nov 25, 2007 3:15:23 PM $
Author:
Giovanni Azua
 

Constructor Summary
AbstractProxy(Class<C> anInterface, C aComponent)
          Creates a Proxy<E> from a Component interface type and instance.
 
Method Summary
 C getRealSubject()
          Returns the actual wrapped Subject instance
 C getSubject()
          Returns the Proxy wrapper instance
 
Methods inherited from class org.perfectjpattern.core.structural.AbstractSurrogate
equals, getComponent, getComponentClass, getUnderlying, hashCode, invoke, invokeUnderlying
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.perfectjpattern.core.api.structural.ISurrogate
getComponent
 
Methods inherited from interface java.lang.reflect.InvocationHandler
invoke
 

Constructor Detail

AbstractProxy

public AbstractProxy(Class<C> anInterface,
                     C aComponent)
              throws IllegalArgumentException
Creates a Proxy<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.
Method Detail

getSubject

public final C getSubject()
Returns the Proxy wrapper instance

Specified by:
getSubject in interface IProxy<C>
Returns:
Proxy wrapper instance

getRealSubject

public final C getRealSubject()
Returns the actual wrapped Subject instance

Specified by:
getRealSubject in interface IProxy<C>
Returns:
actual wrapped Subject instance


Copyright © 2007-2009. All Rights Reserved.