|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.fascinator.common.transaction.GenericTransactionManager
public abstract class GenericTransactionManager
A transaction manager will parse incoming JSON messages and inform the TransactionManagerQueueConsumer which Transformers, Subscribers, Indexing and Messaging sould occur in response.
Implementations of this Plugin are expected to execute inside the TransactionManagerQueueConsumer and should confirm to the expected message formats, as per documentation.
| Constructor Summary | |
|---|---|
GenericTransactionManager(String id,
String name)
Constructor, standard for plugins |
|
| Method Summary | |
|---|---|
String |
getId()
Gets an identifier for Harvester plugin |
JsonSimpleConfig |
getJsonConfig()
Get config file |
String |
getName()
Get a name for Harvester plugin |
PluginDescription |
getPluginDetails()
Gets a PluginDescription object relating to this plugin. |
abstract void |
init()
Abstract method for Harvester plugin |
void |
init(File jsonFile)
Initialises the plugin using the specified JSON configuration |
void |
init(String jsonString)
Initialises the plugin using the specified JSON String |
abstract JsonSimple |
parseMessage(JsonSimple message)
This method is expected to be overwritten by implementations. |
Object |
parseMessage(Object message)
This wrapper implements the API and enforces the practical requirement that the I/O Objects are appropriate JSON classes. |
void |
shutdown()
Shuts down the plugin |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GenericTransactionManager(String id,
String name)
id - Plugin Idname - Plugin Name| Method Detail |
|---|
public String getId()
getId in interface Pluginpublic String getName()
getName in interface Pluginpublic PluginDescription getPluginDetails()
getPluginDetails in interface Plugin
public void init(File jsonFile)
throws PluginException
init in interface PluginjsonFile - JSON configuration file
PluginException - if there was an error during initialisation
public void init(String jsonString)
throws PluginException
init in interface PluginjsonFile - JSON configuration file
PluginException - if there was an error during initialisation
public abstract void init()
throws TransactionException
HarvesterException - if there was an error during initialisation
TransactionException
public void shutdown()
throws PluginException
shutdown in interface PluginPluginException - if there was an error during shutdown
public JsonSimpleConfig getJsonConfig()
throws TransactionException
HarvesterException - if there was an error during retrieval
TransactionException
public final Object parseMessage(Object message)
throws TransactionException
This wrapper implements the API and enforces the practical requirement that the I/O Objects are appropriate JSON classes.
Implementations should overwrite the correctly typed method.
parseMessage in interface TransactionManagermessage - The message to parse, in JSON
TransactionException - If an error occurred or the the message is
in a bad format or otherwise unsuitable.
public abstract JsonSimple parseMessage(JsonSimple message)
throws TransactionException
This method is expected to be overwritten by implementations. This is where the real processing should occur.
message - The JsonSimple message to process
TransactionException - If an error occurred
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||