|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.dpml.lang.Strategy
net.dpml.runtime.ComponentStrategy
public class ComponentStrategy
Component strategy.
Method Summary | ||
---|---|---|
void |
addComponentListener(ComponentListener listener)
Add a listener to the component. |
|
void |
encode(Buffer buffer,
String key)
Write the strategy to the supplied buffer in XML format. |
|
ActivationPolicy |
getActivationPolicy()
Return the assigned activation policy. |
|
CollectionPolicy |
getCollectionPolicy()
Return the assigned collection policy. |
|
|
getContentForClass(Class<T> c)
Return a value assignable to the supplied type or null if the type cannot be resolved from this strategy. |
|
|
getInstance(Class<T> clazz)
Instantiate a service returning an instance assigned to the supplied type. |
|
LifestylePolicy |
getLifestylePolicy()
Return the assigned lifestyle policy. |
|
String |
getName()
Return the short name of this strategy. |
|
int |
getPriority()
Return the priority assigned to this strategy. |
|
Provider |
getProvider()
Return a decommissioning provider. |
|
void |
initialize(ServiceRegistry registry)
Composite strategies are strategy implementations that contain subidary strategies. |
|
boolean |
isaCandidate(Class<?> type)
Return true if this strategy is a candidate with result to the supply of an instance assignable to the supplied type. |
|
|
lookup(Class<T> service)
|
|
void |
release(Provider provider)
Release a provider. |
|
void |
removeComponentListener(ComponentListener listener)
Remove a listener from the component. |
|
void |
terminate()
Terminate the component. |
|
String |
toString()
Returns the string representing of the component. |
Methods inherited from class net.dpml.lang.Strategy |
---|
compareTo, getClassLoader, load, load, load |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public String getName()
Strategy
getName
in interface Component
getName
in class Strategy
public int getPriority()
Strategy
getPriority
in class Strategy
public void addComponentListener(ComponentListener listener)
addComponentListener
in interface Component
listener
- the component listenerpublic void removeComponentListener(ComponentListener listener)
removeComponentListener
in interface Component
listener
- the component listenerpublic Provider getProvider()
Component
getProvider
in interface Component
public void release(Provider provider)
Component
release
in interface Component
provider
- the provider to releasepublic void initialize(ServiceRegistry registry)
Strategy
initialize
in class Strategy
registry
- the service registrypublic boolean isaCandidate(Class<?> type)
Strategy
isaCandidate
in class Strategy
type
- the requested type
public <T> T lookup(Class<T> service)
lookup
in interface ServiceRegistry
public void terminate()
Component
terminate
in interface Component
public CollectionPolicy getCollectionPolicy()
public LifestylePolicy getLifestylePolicy()
public ActivationPolicy getActivationPolicy()
public <T> T getInstance(Class<T> clazz)
Strategy
getInstance
in class Strategy
clazz
- the return type
public <T> T getContentForClass(Class<T> c) throws IOException
Strategy
getContentForClass
in class Strategy
c
- the target class
IOException
- if an IO error occurspublic void encode(Buffer buffer, String key) throws IOException
Strategy
encode
in class Strategy
buffer
- the output bufferkey
- the optional identifying key
IOException
- if an IO error occurspublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |