|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.plankton.srv.SimpleServiceFinder
Given an EventGateway or Container heirarchy, this class provides a series of utilities to find a service (or a collection of services) by looking for an an instance of a class in a given heirarchy. A "service" is simply defined as an object class signature.
The basic search strategy is to start low and sweep upwards (UPSTREAM). What we do is look through everything in the Gateway/Container object (without diving deeper) and then we go upwards and repeat the process until we find a match or hit a root. This class is capable of searching Maps, Lists, ServiceProviders, and Containers
This class also supports downward searches (DOWNSTREAM). In this case we evaluate children completely based on interface (SimpleServiceProviders first, then Lists, then Maps, and finally Containers). We go downwards and repeat the process until we find a match or run out of children.
The key point of this is that the search strategy is totally separated from the container mechanism: the heirarchy simply provides the vehicle; we can customize the behavior with our particular implementation
TODO: are the classes in this package actually used by anyone? if not, can we just nuke them?
Field Summary | |
static int |
DOWNSTREAM
|
protected static org.apache.log4j.Logger |
logger
|
static int |
UPSTREAM
|
Constructor Summary | |
SimpleServiceFinder()
|
Method Summary | |
static Object |
findInstance(Class c,
Container cont)
Find an instance of a Class in a Container heirarchy. |
static Object |
findInstance(Class c,
Container cont,
int searchDirection)
Find an instance of a Class in an Container heirarchy |
static Object |
findInstance(Class c,
PData pdata)
Find an instance of a Class in an PData heirarchy. |
static Object |
findInstance(Class c,
PData pdata,
int searchDirection)
Find an instance of a Class in an PData heirarchy |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final org.apache.log4j.Logger logger
public static final int UPSTREAM
public static final int DOWNSTREAM
Constructor Detail |
public SimpleServiceFinder()
Method Detail |
public static Object findInstance(Class c, PData pdata)
c
- the class we're looking forpdata
- the entry point to the PData heirarchy
public static Object findInstance(Class c, PData pdata, int searchDirection)
c
- the class we're looking forpdata
- the entry point to the PData heirarchysearchDirection
- the search direction
public static Object findInstance(Class c, Container cont)
c
- the class we're looking forcont
- the entry point to the Container heirarchy
public static Object findInstance(Class c, Container cont, int searchDirection)
c
- the class we're looking forcont
- the entry point to the Container heirarchysearchDirection
- the search direction
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |