|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.taverna.t2.spi.SPIRegistry<SPI>
SPI - The interface type that the SPI classes implementpublic class SPIRegistry<SPI>
Simple SPI lookup (using META-INF/services/interfaceName) to discover
run-time class implementations. Subclass or instantiate with given interface
to use the SPI lookup.
This is based upon the InstanceRegistry and SpiRegistry in
Raven.
| Nested Class Summary | |
|---|---|
class |
SPIRegistry.RegistryListenerAdapter
|
static class |
SPIRegistry.SPIRegistryEvent
|
| Field Summary | |
|---|---|
static SPIRegistry.SPIRegistryEvent |
UPDATED
Sent to Observer<SPIRegistry.SPIRegistryEvent>s when this SPI
registry has been updated. |
| Constructor Summary | |
|---|---|
SPIRegistry(java.lang.Class<SPI> spi)
Construct the SPI for the given interface. |
|
| Method Summary | |
|---|---|
void |
addObserver(Observer<SPIRegistry.SPIRegistryEvent> observer)
Register an Observer |
java.util.List<SPI> |
getInstances()
Get all discovered instances. |
java.util.List<Observer<SPIRegistry.SPIRegistryEvent>> |
getObservers()
A list of all the currently registered Observers |
java.lang.Class<SPI> |
getSpi()
Get the SPI instances found by this registry will be implementing. |
void |
refresh()
Reset the instanceRegistry causing it to be re-populated on the next call to getInstances. |
void |
removeObserver(Observer<SPIRegistry.SPIRegistryEvent> observer)
Remove a class who is currently observing |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SPIRegistry.SPIRegistryEvent UPDATED
Observer<SPIRegistry.SPIRegistryEvent>s when this SPI
registry has been updated.
| Constructor Detail |
|---|
public SPIRegistry(java.lang.Class<SPI> spi)
spi - Interface to discover| Method Detail |
|---|
public void addObserver(Observer<SPIRegistry.SPIRegistryEvent> observer)
ObservableObserver
addObserver in interface Observable<SPIRegistry.SPIRegistryEvent>observer - the class who wants notified of changespublic java.util.List<SPI> getInstances()
List of instances of the classes discovered by the
registrypublic java.util.List<Observer<SPIRegistry.SPIRegistryEvent>> getObservers()
ObservableObservers
getObservers in interface Observable<SPIRegistry.SPIRegistryEvent>public java.lang.Class<SPI> getSpi()
Class of the SPI interfacepublic void refresh()
public void removeObserver(Observer<SPIRegistry.SPIRegistryEvent> observer)
Observable
removeObserver in interface Observable<SPIRegistry.SPIRegistryEvent>observer - the class who no longer wants notified
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||