|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.dpml.lang.Strategy
public abstract class Strategy
Abstract component deployment strategy.
Constructor Summary | |
---|---|
protected |
Strategy(java.lang.ClassLoader classloader)
Creation of a new deployment strategy. |
Method Summary | ||
---|---|---|
int |
compareTo(Strategy strategy)
Compares a supplied strategy with this strategy. |
|
abstract void |
encode(Buffer buffer,
java.lang.String key)
Write the strategy to the supplied buffer in XML format. |
|
java.lang.ClassLoader |
getClassLoader()
Return the classloader establised by the strategy implementation. |
|
abstract
|
getContentForClass(java.lang.Class<T> c)
Return a value assignable to the supplied type or null if the type cannot be resolved from this strategy. |
|
abstract
|
getInstance(java.lang.Class<T> type)
Instantiate a service returning an instance assigned to the supplied type. |
|
abstract java.lang.String |
getName()
Return the short name of this strategy. |
|
abstract int |
getPriority()
Return the priority assigned to this strategy. |
|
abstract void |
initialize(ServiceRegistry registry)
Composite strategies are strategy implementations that contain subidary strategies. |
|
abstract boolean |
isaCandidate(java.lang.Class<?> type)
Return true if this strategy is a candidate with result to the supply of an instance assignable to the supplied type. |
|
static Strategy |
load(java.lang.Class<?> subject,
ServiceRegistry registry,
java.lang.String name)
Creation of a new management strategy. |
|
static Strategy |
load(java.lang.ClassLoader classloader,
ServiceRegistry registry,
java.net.URI uri,
java.lang.String name)
Load a strategy defined by the supplied uri, name, classloader and service registry, and return a value assignable to the supplied type. |
|
static Strategy |
load(java.net.URI uri)
Load a strategy defined by the supplied uri. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Strategy(java.lang.ClassLoader classloader)
classloader
- the classloaderMethod Detail |
---|
public static Strategy load(java.lang.Class<?> subject, ServiceRegistry registry, java.lang.String name) throws java.lang.Exception
subject
- the implementation class to be managedregistry
- the service registryname
- the path under which the strategy will be established
java.lang.Exception
- if a general loading error occurspublic static Strategy load(java.net.URI uri) throws java.lang.Exception, java.lang.NullPointerException
uri
- the source uri to a part definition
java.lang.Exception
- if a general loading error occurs
java.lang.NullPointerException
- if the uri argument is nullpublic static Strategy load(java.lang.ClassLoader classloader, ServiceRegistry registry, java.net.URI uri, java.lang.String name) throws java.lang.Exception, java.lang.NullPointerException
classloader
- the anchor classloaderregistry
- the service registryuri
- the source uri to a part definitionname
- the path under which the strategy will be established
java.lang.Exception
- if a general loading error occurs
java.lang.NullPointerException
- if the uri argument is nullpublic java.lang.ClassLoader getClassLoader()
public abstract int getPriority()
public abstract boolean isaCandidate(java.lang.Class<?> type)
type
- the requested type
public abstract <T> T getInstance(java.lang.Class<T> type)
type
- the return type
public abstract void encode(Buffer buffer, java.lang.String key) throws java.io.IOException
buffer
- the output bufferkey
- the optional identifying key
java.io.IOException
- if an IO error occurspublic abstract void initialize(ServiceRegistry registry)
registry
- the service registrypublic abstract java.lang.String getName()
public int compareTo(Strategy strategy)
compareTo
in interface java.lang.Comparable<Strategy>
strategy
- the strategy to evaluate relative to this strategy
public abstract <T> T getContentForClass(java.lang.Class<T> c) throws java.io.IOException
c
- the target class
java.io.IOException
- if an IO error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |