|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.defaults.DecoratingComponentAdapter
org.picocontainer.defaults.ImplementationHidingComponentAdapter
org.nanocontainer.proxytoys.HotSwappingComponentAdapter
instead.
This component adapter makes it possible to hide the implementation
of a real subject (behind a proxy).
If the key of the component is of type Class
and that class represents an interface, the proxy
will only implement the interface represented by that Class. Otherwise (if the key is
something else), the proxy will implement all the interfaces of the underlying subject.
In any case, the proxy will also implement
Swappable
, making it possible to swap out the underlying
subject at runtime.
Note that this class doesn't cache instances. If you want caching,
use a CachingComponentAdapter
around this one.
Constructor Summary | |
ImplementationHidingComponentAdapter(ComponentAdapter delegate)
Deprecated. Creates a strict ImplementationHidingComponentAdapter that will throw an exception when trying to instantiate a class that doesn't implement any interfaces. |
|
ImplementationHidingComponentAdapter(ComponentAdapter delegate,
boolean strict)
Deprecated. Alternative constructor allowing to set interface-only strictness. |
Method Summary | |
Object |
getComponentInstance()
Deprecated. Retrieve the component instance. |
Methods inherited from class org.picocontainer.defaults.DecoratingComponentAdapter |
getComponentImplementation, getComponentKey, getContainer, getDelegate, setContainer, verify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ImplementationHidingComponentAdapter(ComponentAdapter delegate, boolean strict)
delegate
- the delegate adapterstrict
- true if the adapter should only accept classes that are hideable behind interfaces.
If false, a non-implementation hidden instance will be created instead of throwing an exception.public ImplementationHidingComponentAdapter(ComponentAdapter delegate)
delegate
- the delegate adapterMethod Detail |
public Object getComponentInstance() throws PicoInitializationException, PicoIntrospectionException, AssignabilityRegistrationException, NotConcreteRegistrationException
ComponentAdapter
CachingComponentAdapter
will always return the
same instance.
getComponentInstance
in interface ComponentAdapter
getComponentInstance
in class DecoratingComponentAdapter
PicoInitializationException
PicoIntrospectionException
AssignabilityRegistrationException
NotConcreteRegistrationException
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |