systemic.sif.sbpframework.agent
Class SBPSubscriberAgent

java.lang.Object
  extended by openadk.library.Agent
      extended by systemic.sif.sifcommon.agent.SIFBaseAgent
          extended by systemic.sif.sbpframework.agent.SBPSubscriberAgent

public class SBPSubscriberAgent
extends systemic.sif.sifcommon.agent.SIFBaseAgent

This is an actual implementation of a subscribing agent for the SBP. In most cases one can use this agent out of the box. The main restriction it has is that it cannot deal with custom objects. If that should be required one must write a new agent like this and implement the initCustomObjects() method of the SIFBaseAgent class.

To start this agent the following command line statement is used:

<JAVA_HOME>/bin/java <JVM_SETTINGS> -cp <classpath> systemic.sif.sbpframework.agent.SBPSubscriberAgent <agentID> [ <agent.properties>]

<agentID>: Required. Must be an ID of an agent used in the <agen>.properties file.
<agent.properties>: Optional. The name of the agent properties file. If not provided it is assumed to be called SIFAgent.properties. The directory of this file must be on the classpath.

Author:
Joerg Huber

Field Summary
 
Fields inherited from class openadk.library.Agent
LOG_IDENTIFIER
 
Constructor Summary
SBPSubscriberAgent(java.lang.String agentID, java.lang.String propertyFileName)
           
 
Method Summary
 java.lang.String getApplicationID()
           
 void initCustomObjects()
          Default implementation does nothing.
static void main(java.lang.String[] args)
           
 void startAgent()
          Overrides the default start up method.
 void stopAgent()
          Override the base agent's shutdown method.
 
Methods inherited from class systemic.sif.sifcommon.agent.SIFBaseAgent
getAgentConfig, getAgentID, getAgentMappings, getAgentProperties, getFrameworkProperties, getHomeDir, getInitialisedPublishers, getInitialisedSubscribers, getMappings, getZones, setAgentID, setAgentMappings, setFrameworkProperties, startAgent, startAgent, startAgent
 
Methods inherited from class openadk.library.Agent
addMessagingListener, getConfigurationSource, getDefaultHttpProperties, getDefaultHttpsProperties, getDefaultTransportProperties, getDefaultZoneProperties, getErrorHandler, getId, getLog, getLog, getMessagingListeners, getName, getProperties, getPublisher, getQueryResults, getReportPublisher, getServerLog, getServerLog, getSubscriber, getThreadPoolManager, getTopicFactory, getTransportManager, getZoneFactory, initialize, isInitialized, isShutdown, makeGUID, purgeQueue, removeMessagingListener, setConfigurationSource, setErrorHandler, setId, setName, setPublisher, setPublisher, setQueryResults, setQueryResults, setReportPublisher, setSubscriber, setSubscriber, shutdown, shutdown, sleep, wakeup
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SBPSubscriberAgent

public SBPSubscriberAgent(java.lang.String agentID,
                          java.lang.String propertyFileName)
                   throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getApplicationID

public java.lang.String getApplicationID()

initCustomObjects

public void initCustomObjects()
Default implementation does nothing. If custom objects are required then it is advised to write a new agent that extends this agent and then override this method to the need of the agent.

Specified by:
initCustomObjects in class systemic.sif.sifcommon.agent.SIFBaseAgent

stopAgent

public void stopAgent()
Override the base agent's shutdown method. This is mainly required to free up resources used by the SBP Agent such as Hibernate etc. Ensure that the super().shutdown is called first.

Overrides:
stopAgent in class systemic.sif.sifcommon.agent.SIFBaseAgent

startAgent

public void startAgent()
                throws java.lang.Exception
Overrides the default start up method. Before this happens we want to ensure that the environment for the SBP Agent is ready. At this stage this means we want to load the Object Metadata Cache before we even attempt to do anything else. Most SBP Operations and behaviours rely on this cache. If it is not available then the startup of this agent should not continue (i.e should fail).

Overrides:
startAgent in class systemic.sif.sifcommon.agent.SIFBaseAgent
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)