com.ibm.retail.si.mgmt
Class MgmtAgentFactory

java.lang.Object
  |
  +--com.ibm.retail.si.mgmt.MgmtAgentFactory

public class MgmtAgentFactory
extends java.lang.Object

Factory class for obtaining the singleton instances of the Master or General Management agents. The agents are initialized and started upon the first call to either of the factory methods.

Version:
1.0
Author:
Chris Arrington

Constructor Summary
MgmtAgentFactory()
           
 
Method Summary
static com.ibm.retail.si.mgmt.MgmtAgent getGeneralAgent()
          Returns the singleton instance of the general agent for the current JVM.
static com.ibm.retail.si.mgmt.MgmtAgent getGeneralAgent(int deviceType)
          Creates a general agent instance with the supplied device type.
static com.ibm.retail.si.mgmt.MgmtAgent getMasterAgent()
          Returns the singleton instance of the master agent for the current JVM.
static boolean isGeneralAgentRunning()
           
static boolean isMasterAgentRunning()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MgmtAgentFactory

public MgmtAgentFactory()
Method Detail

getGeneralAgent

public static com.ibm.retail.si.mgmt.MgmtAgent getGeneralAgent()
                                                        throws MgmtException
Returns the singleton instance of the general agent for the current JVM. The agent instance will be created upon the first call to this method.

Returns:
MgmtAgent Singleton general agent instance
Throws:
MgmtException - Error initializing General Agent instance, possibly due to missing configuration file(s) or errors reading the configuration

getGeneralAgent

public static com.ibm.retail.si.mgmt.MgmtAgent getGeneralAgent(int deviceType)
                                                        throws MgmtException
Creates a general agent instance with the supplied device type. Before calling this method, a check should be made to isGeneralAgentRunning() to see if there is an existing instance.

Device type constants are specified in MgmtConst

Parameters:
deviceType - Valid device type to use for this agent
Returns:
Singleton general agent instance, or null if the agent instance cannot be initialized
Throws:
MgmtException - General Agent instance is already running, or invalid parameter specified

isGeneralAgentRunning

public static boolean isGeneralAgentRunning()
Returns:
boolean True if there is a general agent running in this JVM. False otherwise

isMasterAgentRunning

public static boolean isMasterAgentRunning()
Returns:
boolean True if there is a master agent running in this JVM. False otherwise

getMasterAgent

public static com.ibm.retail.si.mgmt.MgmtAgent getMasterAgent()
                                                       throws MgmtException
Returns the singleton instance of the master agent for the current JVM. The agent instance will be created upon the first call to this method.

Returns:
Singleton master agent instance, or null if the agent instance cannot be initialized
Throws:
MgmtException - Error initializing MasterAgent instance, possibly due to missing configuration file(s) or errors reading the configuration


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004