org.picocontainer.behaviors
Class HiddenImplementation
java.lang.Object
org.picocontainer.behaviors.AbstractBehavior
org.picocontainer.behaviors.HiddenImplementation
- All Implemented Interfaces:
- Serializable, Behavior, ComponentAdapter, ComponentMonitorStrategy, LifecycleStrategy
- Direct Known Subclasses:
- Intercepted
public class HiddenImplementation
- extends AbstractBehavior
This component adapter makes it possible to hide the implementation
of a real subject (behind a proxy) provided the key is an interface.
This class exists here, because a) it has no deps on external jars, b) dynamic proxy is quite easy.
The user is prompted to look at picocontainer-gems for alternate and bigger implementations.
- Author:
- Aslak Hellesøy, Paul Hammant
- See Also:
for a more feature-rich version of this class.,
Serialized Form
| Methods inherited from class org.picocontainer.behaviors.AbstractBehavior |
accept, changeMonitor, componentHasLifecycle, currentMonitor, dispose, dispose, findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate, hasLifecycle, start, start, stop, stop, verify |
HiddenImplementation
public HiddenImplementation(ComponentAdapter delegate)
- Creates an ImplementationHidingComponentAdapter with a delegate
- Parameters:
delegate - the component adapter to which this adapter delegates
getComponentInstance
public Object getComponentInstance(PicoContainer container)
throws PicoCompositionException
- Description copied from interface:
ComponentAdapter
- Retrieve the component instance. This method will usually create a new instance each time it is called, but that
is not required. For example,
Cached will always return the
same instance.
- Specified by:
getComponentInstance in interface ComponentAdapter- Overrides:
getComponentInstance in class AbstractBehavior
- Parameters:
container - the PicoContainer, that is used to resolve any possible dependencies of the instance.
- Returns:
- the component instance.
- Throws:
PicoCompositionException - if the component could not be instantiated.
invokeMethod
protected Object invokeMethod(Method method,
Object[] args,
PicoContainer container)
throws Throwable
- Throws:
Throwable
toString
public String toString()
- Overrides:
toString in class AbstractBehavior
getName
protected String getName()
Copyright © 2003-2007 Codehaus. All Rights Reserved.