org.picocontainer.defaults
Class ImmutablePicoContainerProxyFactory

java.lang.Object
  extended by org.picocontainer.defaults.ImmutablePicoContainerProxyFactory
All Implemented Interfaces:
java.io.Serializable, java.lang.reflect.InvocationHandler

public class ImmutablePicoContainerProxyFactory
extends java.lang.Object
implements java.lang.reflect.InvocationHandler, java.io.Serializable

A factory for immutable PicoContainer proxies.

Since:
1.2
Author:
Jörg Schaible
See Also:
Serialized Form

Field Summary
protected static java.lang.reflect.Method disposeMethod
           
protected static java.lang.reflect.Method equalsMethod
           
private static java.lang.Class[] interfaces
           
private  PicoContainer pico
           
protected static java.lang.reflect.Method startMethod
           
protected static java.lang.reflect.Method stopMethod
           
 
Constructor Summary
protected ImmutablePicoContainerProxyFactory(PicoContainer pico)
          Construct a ImmutablePicoContainerProxyFactory.
 
Method Summary
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
static PicoContainer newProxyInstance(PicoContainer pico)
          Create a new immutable PicoContainer proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interfaces

private static final java.lang.Class[] interfaces

startMethod

protected static java.lang.reflect.Method startMethod

stopMethod

protected static java.lang.reflect.Method stopMethod

disposeMethod

protected static java.lang.reflect.Method disposeMethod

equalsMethod

protected static java.lang.reflect.Method equalsMethod

pico

private final PicoContainer pico
Constructor Detail

ImmutablePicoContainerProxyFactory

protected ImmutablePicoContainerProxyFactory(PicoContainer pico)
Construct a ImmutablePicoContainerProxyFactory.

Parameters:
pico - the container to hide
Throws:
java.lang.NullPointerException - if pico is null
Since:
1.2
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

newProxyInstance

public static PicoContainer newProxyInstance(PicoContainer pico)
Create a new immutable PicoContainer proxy. The proxy will completly hide the implementation of the given PicoContainer and will also prevent the invocation of any methods of the lifecycle methods from Startable or Disposable.

Parameters:
pico -
Returns:
the new proxy
Throws:
java.lang.NullPointerException - if pico is null
Since:
1.2