|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.picocontainer.adapters.AbstractAdapter
org.picocontainer.adapters.InstanceAdapter
public final class InstanceAdapter
Component adapter which wraps a component instance.
This component adapter supports both a Behavior and a
LifecycleStrategy to control the lifecycle of the component.
The lifecycle manager methods simply delegate to the lifecycle strategy methods
on the component instance.
| Constructor Summary | |
|---|---|
InstanceAdapter(Object componentKey,
Object componentInstance,
LifecycleStrategy lifecycleStrategy,
ComponentMonitor componentMonitor)
|
|
| Method Summary | |
|---|---|
boolean |
componentHasLifecycle()
Test if a component honors a lifecycle. |
void |
dispose(Object component)
Invoke the "dispose" method on the component instance if this is disposable. |
void |
dispose(PicoContainer container)
Invoke the "dispose" method on the component. |
Object |
getComponentInstance(PicoContainer container)
Retrieve the component instance. |
boolean |
hasLifecycle(Class type)
Test if a component instance has a lifecycle. |
void |
start(Object component)
Invoke the "start" method on the component instance if this is startable. |
void |
start(PicoContainer container)
Invoke the "start" method on the component. |
void |
stop(Object component)
Invoke the "stop" method on the component instance if this is stoppable. |
void |
stop(PicoContainer container)
Invoke the "stop" method on the component. |
String |
toString()
|
void |
verify(PicoContainer container)
Verify that all dependencies for this adapter can be satisifed. |
| Methods inherited from class org.picocontainer.adapters.AbstractAdapter |
|---|
accept, changeMonitor, checkTypeCompatibility, currentMonitor, findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.picocontainer.ComponentAdapter |
|---|
accept, findAdapterOfType, getComponentImplementation, getComponentKey, getDelegate |
| Constructor Detail |
|---|
public InstanceAdapter(Object componentKey,
Object componentInstance,
LifecycleStrategy lifecycleStrategy,
ComponentMonitor componentMonitor)
throws PicoCompositionException
PicoCompositionException| Method Detail |
|---|
public Object getComponentInstance(PicoContainer container)
ComponentAdapterCached will always return the
same instance.
getComponentInstance in interface ComponentAdaptercontainer - the PicoContainer, that is used to resolve any possible dependencies of the instance.
public void verify(PicoContainer container)
ComponentAdapter
verify in interface ComponentAdaptercontainer - the PicoContainer, that is used to resolve any possible dependencies of the instance.public void start(PicoContainer container)
Behavior
start in interface Behaviorcontainer - the container to "start" the componentpublic void stop(PicoContainer container)
Behavior
stop in interface Behaviorcontainer - the container to "stop" the componentpublic void dispose(PicoContainer container)
Behavior
dispose in interface Behaviorcontainer - the container to "dispose" the componentpublic boolean componentHasLifecycle()
Behavior
componentHasLifecycle in interface Behaviortrue if the component has a lifecyclepublic void start(Object component)
LifecycleStrategy
start in interface LifecycleStrategycomponent - the instance of the component to startpublic void stop(Object component)
LifecycleStrategy
stop in interface LifecycleStrategycomponent - the instance of the component to stoppublic void dispose(Object component)
LifecycleStrategy
dispose in interface LifecycleStrategycomponent - the instance of the component to disposepublic boolean hasLifecycle(Class type)
LifecycleStrategy
hasLifecycle in interface LifecycleStrategytype - the component's type
true if the component has a lifecyclepublic String toString()
toString in class AbstractAdapterObject.toString()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||