|
||||||||||
| 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(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,
String key)
Write the strategy to the supplied buffer in XML format. |
|
ClassLoader |
getClassLoader()
Return the classloader establised by the strategy implementation. |
|
abstract
|
getContentForClass(Class<T> c)
Return a value assignable to the supplied type or null if the type cannot be resolved from this strategy. |
|
abstract
|
getInstance(Class<T> type)
Instantiate a service returning an instance assigned to the supplied type. |
|
abstract 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(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(Class<?> subject,
ServiceRegistry registry,
String name)
Creation of a new management strategy. |
|
static Strategy |
load(ClassLoader classloader,
ServiceRegistry registry,
URI uri,
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(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(ClassLoader classloader)
classloader - the classloader| Method Detail |
|---|
public static Strategy load(Class<?> subject,
ServiceRegistry registry,
String name)
throws Exception
subject - the implementation class to be managedregistry - the service registryname - the path under which the strategy will be established
Exception - if a general loading error occurs
public static Strategy load(URI uri)
throws Exception,
NullPointerException
uri - the source uri to a part definition
Exception - if a general loading error occurs
NullPointerException - if the uri argument is null
public static Strategy load(ClassLoader classloader,
ServiceRegistry registry,
URI uri,
String name)
throws Exception,
NullPointerException
classloader - the anchor classloaderregistry - the service registryuri - the source uri to a part definitionname - the path under which the strategy will be established
Exception - if a general loading error occurs
NullPointerException - if the uri argument is nullpublic ClassLoader getClassLoader()
public abstract int getPriority()
public abstract boolean isaCandidate(Class<?> type)
type - the requested type
public abstract <T> T getInstance(Class<T> type)
type - the return type
public abstract void encode(Buffer buffer,
String key)
throws IOException
buffer - the output bufferkey - the optional identifying key
IOException - if an IO error occurspublic abstract void initialize(ServiceRegistry registry)
registry - the service registrypublic abstract String getName()
public int compareTo(Strategy strategy)
compareTo in interface Comparable<Strategy>strategy - the strategy to evaluate relative to this strategy
public abstract <T> T getContentForClass(Class<T> c)
throws IOException
c - the target class
IOException - if an IO error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||