|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.retail.AEF.server.AEFBase
AEFBase
is the main object used to create an AEF enabled real terminal or virtual terminal environment.
It is a singleton object that creates the appropriate SessionServer
and AEFSessionFactory
objects based on the configuration settings. Applications typically use AEFBase
to access
the AEF SessionServer
object through the
getSessionServer
method. The SessionServer
provides a number of accessor to obtain instances of AEFSession
objects. The session instances encapsulate
the data and function of
an active real or virtual POS terminal.
Sample usage:
try { SessionServer server = AEFBase.getInstance().getSessionServer(); if (server != null) { // connected to server, now get any available AEF terminal session AEFSession session = server.getAvailableSession(); if (session != null) { // got a session... perform actions or listen to events } else { // couldn't get a session -- all sessions in use System.err.println("Unable to obtain AEFSession. "); } } else { // couldn't connect -- URL is incorrect or server is down System.err.println("Unable to connect to AEF SessionServer. "); } } catch (AEFException ae) { System.err.println("An AEF exception occurred: " + ae.getMessage()); } catch (RemoteException re) { System.err.println("A remote exception occurred: " + re.getMessage()); }
Nested Class Summary | |
---|---|
class |
AEFBase.AEFMulticastThread
AEFMulticastThread is a thread which can handle listening to the multicast socket
for beaconing factories, as well as beacon on behalf of a factory. |
class |
AEFBase.ServerEntry
This class is used to hold information about a SessionServer. |
Field Summary | |
---|---|
protected com.ibm.retail.si.util.AEFBundle |
configBundle
|
protected boolean |
createAgent
|
protected boolean |
createDeviceServer
|
protected boolean |
createFactory
|
protected boolean |
createMemoryDebug
|
protected boolean |
createRMI
|
protected boolean |
createServer
|
protected com.ibm.retail.AEF.util.DebugMemory |
debugMemory
|
protected java.lang.String |
defaultHost
|
protected com.ibm.retail.AEF.io.DeviceServer |
deviceServer
|
protected java.lang.Object |
deviceServerLock
|
protected int |
deviceServerPort
|
protected com.ibm.retail.AEF.factory.AEFSessionFactory |
factory
|
protected boolean |
factoryBeacon
|
protected int |
factoryBeaconInterval
|
protected java.lang.String |
factoryName
|
protected boolean |
factoryRemote
|
protected java.lang.String |
generalrmiPort
|
protected java.net.InetAddress |
group
|
protected com.ibm.retail.AEF.server.HealthServer |
healthServer
|
protected static java.lang.Object |
initlock
|
protected static java.lang.String |
initThread
|
protected static com.ibm.retail.AEF.server.AEFBase |
instance
Singleton instance of AEFBase |
protected boolean |
listenForFactories
|
protected java.lang.String |
localhost
|
protected com.ibm.retail.AEF.util.LoggerControl |
loggerControl
|
protected boolean |
loggerRemote
|
protected static boolean |
mgmtEnabled
|
protected java.lang.String |
multicastAddress
|
protected int |
multicastPort
|
protected boolean |
multicastSocketOK
|
protected java.lang.String |
os4690rmiPort
|
protected java.lang.String |
realTerminalNumber
|
protected java.lang.String |
rmiCheckInterval
|
protected java.lang.String |
rmiLeaseValue
|
protected int |
rmiPort
|
protected java.lang.String |
rmiPortStr
|
protected java.lang.String |
rmiTimeout
|
protected java.util.HashSet |
serverEntryList
|
protected java.lang.String |
serverID
|
protected java.util.HashMap |
serverIDToEntryMap
|
protected java.lang.String |
serverName
|
protected boolean |
serverRemote
|
protected com.ibm.retail.si.util.AEFBundle |
sessionBundle
|
protected com.ibm.retail.AEF.server.SessionServer |
sessionServer
|
protected java.net.MulticastSocket |
socket
|
protected boolean |
tssFlag
|
protected java.lang.Object |
userObj
|
protected java.lang.String |
waitForServerURI
|
protected java.lang.Object |
waitForServerURILock
|
Constructor Summary | |
---|---|
protected |
AEFBase()
Construct AEFBase object |
Method Summary | |
---|---|
(package private) static java.lang.String |
copyright()
|
protected void |
createDebugMemoryMBean(com.ibm.retail.si.mgmt.MgmtAgent agent)
Create the DebugMemoryMBean object and register it with the MBeanServer |
com.ibm.retail.AEF.io.DeviceServer |
createDeviceServer(int port)
Create the DeviceServer for remote device support. |
protected void |
createFactory()
Create the AEFSessionFactory object and register with RMI. |
protected void |
createInventoryMBean(com.ibm.retail.si.mgmt.MgmtAgent agent)
Create the SoftwareInventoryMBean object and register it with the MBeanServer |
protected void |
createJMXGeneralAgent()
Create the JMX GeneralAgent but only if it's not already running |
protected void |
createLoggerControl()
Create the LoggerControl object and register with RMI. |
protected void |
createMBeans(com.ibm.retail.si.mgmt.MgmtAgent agent)
Create the MBeans |
protected void |
createMemoryDebug()
Create the MemoryDebug object and register with RMI. |
protected void |
createRegistry()
Create the RMI registry. |
protected void |
createSessionServer()
Create the SessionServer object and register with RMI. |
com.ibm.retail.AEF.factory.AEFSessionFactory |
getAEFSessionFactory()
Get local AEFSessionFactory. |
protected void |
getConfig(java.util.HashMap overrides)
Get configuration from properties file and write to log as INFO. |
java.lang.String |
getDefaultHostname()
Determine the host name used for this instance of AEFBase. |
java.net.InetSocketAddress |
getHealthServerAddress()
Get the socket address of the health server. |
static com.ibm.retail.AEF.server.AEFBase |
getInstance()
Get the AEFBase singleton instance. |
static com.ibm.retail.AEF.server.AEFBase |
getInstance(java.util.HashMap overrides)
Get the AEFBase singleton instance with the overridden properties. |
com.ibm.retail.AEF.util.LoggerControl |
getLoggerControl()
Get LoggerControl object for this JVM |
protected boolean |
getPlatformSpecificBoolean(java.lang.String prop,
boolean initValue)
Utility method to retrieve a boolean value from the configBundle and handle any platform-specifc values. |
java.lang.String |
getRealTerminalNumber()
Get the real terminal number (for non-virtual terminals). |
protected com.ibm.retail.AEF.server.SessionServer |
getRemoteServer()
Get a remote SessionServer using RMI lookup. |
protected com.ibm.retail.AEF.server.SessionServer |
getRemoteServer(java.lang.String serverID)
Get a specific remote SessionServer using RMI lookup. |
com.ibm.retail.AEF.server.SessionServer |
getRemoteServerFromURI(java.lang.String remoteServerURL)
Get a remote SessionServer given its URI. |
com.ibm.retail.AEF.server.SessionServer |
getSessionServer()
Get a SessionServer. |
com.ibm.retail.AEF.server.SessionServer |
getSessionServer(java.lang.String serverID)
Get the SessionServer with the specified id. |
static com.ibm.retail.AEF.server.AEFBase |
initialize()
Initialize the AEFBase. |
static com.ibm.retail.AEF.server.AEFBase |
initialize(java.util.HashMap overrides)
Initialize the AEFBase with the overriden properties |
protected void |
initImpl(java.util.HashMap overrides)
Perform initialization of the AEFBase singleton. |
static boolean |
isManagementEnabled()
Return indicator of whether System Management is enabled (which implies that a JMX General Agent has been created). |
boolean |
isVirtualEnvironment()
Indicates if this a virtual (CSS) environment. |
protected void |
queryEnvironment()
Use POS services to determine if this is a POS real terminal (4690). |
protected void |
queryHostname()
Log the IP settings. |
protected void |
sendServerRequest(java.lang.String serverID)
Send the request for session servers |
void |
setPropertyOverrides(java.lang.String filename,
java.util.HashMap overrides)
Set configuration property overrides. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static com.ibm.retail.AEF.server.AEFBase instance
protected com.ibm.retail.si.util.AEFBundle configBundle
protected com.ibm.retail.si.util.AEFBundle sessionBundle
protected boolean createServer
protected boolean createDeviceServer
protected boolean createFactory
protected boolean createMemoryDebug
protected boolean createRMI
protected boolean createAgent
protected static boolean mgmtEnabled
protected java.lang.String rmiTimeout
protected java.lang.String rmiLeaseValue
protected java.lang.String rmiCheckInterval
protected java.lang.String serverID
protected java.lang.String realTerminalNumber
protected int rmiPort
protected com.ibm.retail.AEF.server.SessionServer sessionServer
protected com.ibm.retail.AEF.factory.AEFSessionFactory factory
protected com.ibm.retail.AEF.util.LoggerControl loggerControl
protected com.ibm.retail.AEF.util.DebugMemory debugMemory
protected java.lang.Object userObj
protected boolean tssFlag
protected boolean serverRemote
protected boolean factoryRemote
protected boolean loggerRemote
protected java.lang.String localhost
protected com.ibm.retail.AEF.io.DeviceServer deviceServer
protected com.ibm.retail.AEF.server.HealthServer healthServer
protected int deviceServerPort
protected java.lang.Object deviceServerLock
protected boolean factoryBeacon
protected boolean listenForFactories
protected java.lang.String factoryName
protected java.lang.String serverName
protected static java.lang.String initThread
protected static java.lang.Object initlock
protected java.lang.String defaultHost
protected java.lang.String rmiPortStr
protected java.lang.String os4690rmiPort
protected java.lang.String generalrmiPort
protected int factoryBeaconInterval
protected int multicastPort
protected java.lang.String multicastAddress
protected java.util.HashMap serverIDToEntryMap
protected java.util.HashSet serverEntryList
protected java.lang.String waitForServerURI
protected java.lang.Object waitForServerURILock
protected java.net.MulticastSocket socket
protected java.net.InetAddress group
protected boolean multicastSocketOK
Constructor Detail |
protected AEFBase()
Method Detail |
static java.lang.String copyright()
public static com.ibm.retail.AEF.server.AEFBase getInstance() throws AEFException
AEFException
- Among the possible AEFException error codes are:
public static com.ibm.retail.AEF.server.AEFBase getInstance(java.util.HashMap overrides) throws AEFException
AEFException
- Among the possible AEFException error codes are:
public static com.ibm.retail.AEF.server.AEFBase initialize() throws AEFException
AEFException
- Among the possible AEFException error codes are:
public static com.ibm.retail.AEF.server.AEFBase initialize(java.util.HashMap overrides) throws AEFException
AEFException
- Among the possible AEFException error codes are:
public void setPropertyOverrides(java.lang.String filename, java.util.HashMap overrides)
Applications can use this method to pass property values to override configuration property values contained in the AEF property files. This provides a runtime method of changing config.properties and session.properties.
public com.ibm.retail.AEF.factory.AEFSessionFactory getAEFSessionFactory()
Applications should access session through the
SessionServer
interface.
public com.ibm.retail.AEF.io.DeviceServer createDeviceServer(int port) throws AEFException
port
- device server port (use -1 to take DeviceServer default)
AEFException
- Among the possible AEFException error codes are:
public com.ibm.retail.AEF.server.SessionServer getSessionServer() throws AEFException
AEFException
- Among the possible AEFException error codes are:
public com.ibm.retail.AEF.server.SessionServer getSessionServer(java.lang.String serverID) throws AEFException
serverID
- The id of the server to return.
AEFException
- AEFException error codes are:
protected com.ibm.retail.AEF.server.SessionServer getRemoteServer(java.lang.String serverID) throws AEFException
serverID
- The id of the requested server.
AEFException
- AEFException error codes are:
protected com.ibm.retail.AEF.server.SessionServer getRemoteServer() throws AEFException
AEFException
- AEFException error codes are:
public com.ibm.retail.AEF.server.SessionServer getRemoteServerFromURI(java.lang.String remoteServerURL)
remoteServerURL
-
public boolean isVirtualEnvironment()
public java.lang.String getRealTerminalNumber()
public com.ibm.retail.AEF.util.LoggerControl getLoggerControl()
protected void initImpl(java.util.HashMap overrides) throws AEFException
com.ibm.retail.AEF.util.AEFException
AEFException
protected void getConfig(java.util.HashMap overrides)
overrides
- contains in proerty value overrides from applicationprotected boolean getPlatformSpecificBoolean(java.lang.String prop, boolean initValue)
protected void createRegistry() throws AEFException
AEFException
protected void createJMXGeneralAgent() throws AEFException
AEFException
protected void createMBeans(com.ibm.retail.si.mgmt.MgmtAgent agent)
protected void createInventoryMBean(com.ibm.retail.si.mgmt.MgmtAgent agent)
protected void createDebugMemoryMBean(com.ibm.retail.si.mgmt.MgmtAgent agent)
protected void createSessionServer() throws AEFException
AEFException
- Among the possible AEFException error codes are:
protected void createLoggerControl() throws AEFException
AEFException
- Among the possible AEFException error codes are:
protected void createFactory() throws AEFException
AEFSessionFactory
object and register with RMI.
AEFException
- Among the possible AEFException error codes are:
protected void createMemoryDebug() throws AEFException
com.ibm.retail.AEF.util.AEFException
AEFException
protected void queryEnvironment()
protected void queryHostname()
public java.lang.String getDefaultHostname()
public java.net.InetSocketAddress getHealthServerAddress()
protected void sendServerRequest(java.lang.String serverID)
serverID
- The id of the requested server, or null.public static boolean isManagementEnabled()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |