|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.cc.common.extension.ExtensionBus
public class ExtensionBus
Nested Class Summary | |
---|---|
static interface |
ExtensionBus.Context
Extension bus context used by the extension to retrieve all data using the data keys previously registered by the for extension. |
static class |
ExtensionBus.DataKey<D>
Marker class for all data keys. |
static interface |
ExtensionBus.Registry
Extension specific registry used by the extension bus to indicate which data keys are required by an extension. |
Constructor Summary | |
---|---|
ExtensionBus()
|
Method Summary | ||
---|---|---|
void |
loadAndRegisterExtension(Class<? extends Extension> extensionClass)
Loads an extension an register it on the bus. |
|
void |
loadAndRegisterExtension(String extensionClassName)
Loads an extension and register it on the bus. |
|
|
publish(ExtensionBus.DataKey<D> dataKey,
D data)
Publishes a data with its data-key. |
|
void |
register(Extension extension)
Registers an extension to the current bus. |
|
void |
register(SimpleExtension extension,
ExtensionBus.DataKey<?>... dataKeys)
Registers a simple extension to the current bus. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtensionBus()
Method Detail |
---|
public void register(Extension extension)
Extension.register(ExtensionBus.Registry)
in order to register all data keys needed by the extension.
The same extension object can be registered several times
using this method.
extension
- the extension to register.public void register(SimpleExtension extension, ExtensionBus.DataKey<?>... dataKeys)
extension
- the simple extension to register.public <D> void publish(ExtensionBus.DataKey<D> dataKey, D data)
dataKey
- the key of the datadata
- the datapublic void loadAndRegisterExtension(String extensionClassName)
Extension
.
extensionClassName
- the class name of the extension.loadAndRegisterExtension(Class)
,
register(Extension)
public void loadAndRegisterExtension(Class<? extends Extension> extensionClass)
Extension
.
extensionClass
- the class of the extension.loadAndRegisterExtension(String)
,
register(Extension)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |