public class GatewayState extends Object
getInstance().| Modifier and Type | Method and Description |
|---|---|
static GatewayState |
getInstance()
Gets the singleton instance of the GatewayState class.
|
long |
getSettingsUpdateInterval()
Gets the interval that the settings are update when the
SettingsManager is started. |
SmtpAgent |
getSmtpAgent()
Gets the
agent whose state is being managed. |
SmtpAgentFactory |
getSmtpAgentFactory()
Gets the
factory object that is being used to obtain agent settings and configuration. |
boolean |
isAgentSettingManagerRunning()
Determines if the settings manager is running.
|
void |
lockForProcessing()
Locks a services for processing operations.
|
void |
lockForUpdating()
Locks a service update operations.
|
void |
setSettingsUpdateInterval(long intervalInSeconds)
Sets the interval that the settings are updated when the
SettingsManager is started. |
void |
setSmptAgentFactory(SmtpAgentFactory smtpAgentFactory)
Sets the
factory object used to obtain agent settings and configuration. |
void |
setSmtpAgent(SmtpAgent agent)
Sets the
agent whose state is managed. |
void |
startAgentSettingsManager()
Starts the agent settings manager.
|
void |
stopAgentSettingsManager()
Stops the agent settings manager.
|
void |
unlockFromProcessing()
Unlocks a service from processing operations.
|
void |
unlockFromUpdating()
Unlocks a service from update operations.
|
public static GatewayState getInstance()
public void lockForProcessing()
ReadWriteLock.readLock(). Operations using this lock should not attempt to change the state
of the services they are consuming. Multiple threads can concurrently obtain the processing lock and execute, however
this method will block is another thread holds the update lock.public void unlockFromProcessing()
public void lockForUpdating()
ReadWriteLock.writeLock(). This lock is intended for updating
the state of a service ensuring that the update does not have adverse affects on a processing operations. Only a single thread can have access to the
update thread at any given time. This method will block if another thread hold the update lock or the processing lock.public void unlockFromUpdating()
public void setSettingsUpdateInterval(long intervalInSeconds)
SettingsManager is started. If this interval is changed, the settings manager
must be restarted before the new interval takes effect.intervalInSeconds - The interval in seconds that the settings are updated.public long getSettingsUpdateInterval()
SettingsManager is started.public void setSmtpAgent(SmtpAgent agent)
agent whose state is managed.agent - The agent whose state is managed.public SmtpAgent getSmtpAgent()
agent whose state is being managed.agent whose state is being managed.public void setSmptAgentFactory(SmtpAgentFactory smtpAgentFactory)
factory object used to obtain agent settings and configuration.config - The factory object used to obtain agent settings and configuration.public SmtpAgentFactory getSmtpAgentFactory()
factory object that is being used to obtain agent settings and configuration.factory object that is being used to obtain agent settings and configuration.public void startAgentSettingsManager()
public void stopAgentSettingsManager()
public boolean isAgentSettingManagerRunning()
Copyright © 2010–2021 NHIN Direct. All rights reserved.