public abstract class Plugin extends Object
Plugin.Type.PRE_RETRIEVE are triggered just before the initiation of the retrieval phase of the bridging cyclePlugin.Type.POST_RETRIEVE are triggered just after the completion of the retrieval phase of the bridging cyclePlugin.Type.PRE_UPDATE are triggered just before the initiation of the update phase of the bridging cyclePlugin.Type.POST_UPDATEare triggered just after the completion of the update phase of the bridging cyclePlugin.Type.PERIODIC or Plugin.Type.ONE_OFF.
As the operation of plugins of such types is not supported by the built-in mechanisms of ResourceRegistry, implementations of this type should be careful
not to corrupt the underlying datastores or process inconsistent data. Specifically
Plugin.Type.PERIODIC should operate only on RRContext.DatastoreType.LOCALPlugin.Type.PERIODIC should hold a lock on RRContext.DatastoreType.LOCAL during the entire time of their operationPlugin.Type.ONE_OFF, however such plugins are not expected to perform database operations as their primary purpose is
to handle environment setup tasks.| Modifier and Type | Class and Description |
|---|---|
static class |
Plugin.ProcessedItemType |
static class |
Plugin.Type |
| Modifier and Type | Field and Description |
|---|---|
protected Map<Plugin.ProcessedItemType,Set<? extends IDaoElement>> |
itemDaos |
protected Map<Plugin.ProcessedItemType,Set<? extends IRRElement>> |
items |
protected long |
period |
protected TimeUnit |
periodUnit |
protected Set<Plugin.ProcessedItemType> |
processedItems |
protected Plugin.Type |
type |
| Constructor and Description |
|---|
Plugin() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessedItemDaos(Plugin.ProcessedItemType type,
Set<? extends IDaoElement> items) |
void |
addProcessedItems(Plugin.ProcessedItemType type,
Set<? extends IRRElement> items) |
protected abstract void |
execute(Set<Class<?>> targets) |
void |
executePlugin(Set<Class<?>> targets) |
long |
getPeriod() |
TimeUnit |
getPeriodUnit() |
Set<Plugin.ProcessedItemType> |
getProcessedItems()
Returns the set of items this plugin processes during its operation.
|
Plugin.Type |
getType()
Returns the type of the plugin.
|
void |
readConfiguration(String prefix,
Properties properties) |
abstract void |
setup() |
protected Plugin.Type type
protected long period
protected TimeUnit periodUnit
protected Set<Plugin.ProcessedItemType> processedItems
protected Map<Plugin.ProcessedItemType,Set<? extends IRRElement>> items
protected Map<Plugin.ProcessedItemType,Set<? extends IDaoElement>> itemDaos
public void readConfiguration(String prefix, Properties properties) throws ResourceRegistryException
ResourceRegistryExceptionpublic Plugin.Type getType()
Plugin.Type.PRE_RETRIEVE are triggered just before the initiation of the retrieval phase of the bridging cyclePlugin.Type.POST_RETRIEVE are triggered just after the completion of the retrieval phase of the bridging cyclePlugin.Type.PRE_UPDATE are triggered just before the initiation of the update phase of the bridging cyclePlugin.Type.POST_UPDATEare triggered just after the completion of the update phase of the bridging cyclePlugin.Type.PERIODIC.public Set<Plugin.ProcessedItemType> getProcessedItems()
ResourceRegistry can provide collections of prefetched itemspublic void addProcessedItems(Plugin.ProcessedItemType type, Set<? extends IRRElement> items)
public void addProcessedItemDaos(Plugin.ProcessedItemType type, Set<? extends IDaoElement> items)
public long getPeriod()
public TimeUnit getPeriodUnit()
public abstract void setup()
throws ResourceRegistryException
ResourceRegistryExceptionprotected abstract void execute(Set<Class<?>> targets) throws ResourceRegistryException
ResourceRegistryExceptionpublic void executePlugin(Set<Class<?>> targets) throws ResourceRegistryException
ResourceRegistryExceptionCopyright © 2014. All Rights Reserved.