public class ServerManager extends java.lang.Object implements ServerAdmin
Modifier and Type | Method and Description |
---|---|
void |
addOrUpdateDeploymentUnit(DeploymentUnitDefinition def)
Switch deployment unit into a new version
|
void |
addOrUpdateDeploymentUnit(java.lang.String id,
byte[] config)
Writes the configuration file ultra-unit.xml to the specified deployment unit from a byte stream
|
void |
defineNonPersistedAlertConfig(AlertConfigurationDefinition alertConfig)
Defines a new alert configuration into the alert configuration registry without persistence
|
void |
definePersistedAlertConfig(AlertConfigurationDefinition alertConfig)
Defines a new alert configuration into the alert configuration registry with persistence
|
void |
endMaintenance()
Resume normal operations from maintenance
|
java.util.List |
getActingServerNames()
Gives and unmodifiable list containing the names of the server this server is acting as
|
ArtifactInterceptionHandler |
getArtifactInterceptionHandler() |
java.lang.Object |
getBean(java.lang.String id,
java.lang.Class type)
Gets a spring bean of the given type from the root static context of the ESB
|
org.adroitlogic.ultraesb.clustering.ClusterManager |
getClusterManager()
Get the cluster manager
|
java.lang.String |
getConfigFile(java.lang.String filePath) |
java.lang.String |
getConfigurationDirPath() |
org.adroitlogic.ultraesb.jmx.view.DashboardView |
getDashboardView()
Get information to display on the dashboard
|
java.io.File |
getDeploymentsDir() |
org.adroitlogic.ultraesb.jmx.view.DeploymentUnitView |
getDeploymentUnitView(java.lang.String id)
Gives the deployment unit snapshot view to the front-end
|
java.lang.String |
getInstallationName()
Gives the name of the installation which uniquely identifies a set of related nodes in a deployment
|
static ServerManager |
getInstance()
Get the ServerManager instance of the JVM
|
org.adroitlogic.ultraesb.core.interceptor.message.MessageInterceptionHandler |
getMessageInterceptionHandler()
Gets the interception handler
|
java.util.List |
getPlaceHolderConfigurers()
Get the bean definitions list for the Spring Place Holder Configurers defined in the root configuration
|
java.util.List |
getProxyServiceIds()
Retrieves the deployed proxy service id list (of all deployment units) in the UltraESB server
|
java.lang.String |
getRemoteJmxServiceURL() |
java.lang.String |
getServerName()
Gives the name of the server which has to be unique in a clustered deployment
|
java.lang.String |
getStatus()
Get a textual representation of the server status
|
java.util.Timer |
getTimer()
Gets the global server timer
|
int |
getUserDefinedStatusCode()
Get the user defined status code
|
org.adroitlogic.ultraesb.jmx.view.ZabbixAgentView |
getZabbixAgentView() |
void |
initialize(org.springframework.context.ApplicationContext rootContext,
org.adroitlogic.ultraesb.core.ConfigurationImpl config)
Initialize ServerManager from a web container.
|
boolean |
isActingAs(java.util.Set serverNames)
Whether the server is acting as at least one of the server names specified in the set
|
boolean |
isActingAs(java.lang.String serverName)
Whether the server is acting as the given server name
|
boolean |
isClustered()
Used to check whether the server is in a clustered deployment
|
boolean |
isDeploymentUnitLoaded(java.lang.String id)
Whether there is a deployment unit loaded with the given identifier
|
boolean |
isFailed()
Has this instance failed?
|
boolean |
isStarted()
Return true if the system is currently running, and not begun a shutdown sequence
|
void |
markAsFailed()
Mark the instance as failed
|
void |
outdateEndpoint(org.adroitlogic.ultraesb.core.endpoint.Endpoint ep) |
void |
outdateProxyService(org.adroitlogic.ultraesb.core.ProxyService ps) |
void |
outdateSequence(org.adroitlogic.ultraesb.core.Sequence seq) |
boolean |
purgeAllOutdatedDeploymentUnits()
Purge all outdated configuration fragments
|
void |
refresh()
Refreshes the server manager, this is only called by some human intervention and will only fire the
LifecycleEventType.ON_SERVER_REFRESH event sending a signal
to the server interceptors to act on if interested about this human initiated action |
void |
registerEndpoint(org.adroitlogic.ultraesb.core.endpoint.Endpoint ep) |
void |
registerProxyService(org.adroitlogic.ultraesb.core.ProxyService ps) |
void |
registerSequence(org.adroitlogic.ultraesb.core.Sequence seq) |
boolean |
removeNonPersistedAlertConfig(java.lang.String stream,
long id)
Removes the custom alert configuration identified by the 'stream' and 'id'
|
void |
scheduleTask(java.util.TimerTask task,
long[] timeout)
Ability to schedule a timer task in the ESB, the variable argument timeout accepts one or two arguments
not passing a long value for the variable argument method or passing more than 2 arguments to the variable
argument will cause a
BusRuntimeException |
void |
setConfigurationDirPath(java.lang.String configurationDirPath) |
void |
setInstallationName(java.lang.String installationName)
Sets the name of the server which has to be unique in a clustered deployment
|
void |
setRootContextFilePath(java.lang.String rootContextFilePath) |
void |
setServerName(java.lang.String serverName)
Sets the name of the server which has to be unique in a clustered deployment
|
void |
setUserDefinedStatusCode(int userDefinedStatusCode)
Set the current value for the user defined status code
|
void |
shutdown()
Shutdown the UltraESB instance
|
void |
shutdown(long waitMillis)
Shutdown the UltraESB instance, giving a grace period of waitMillis
|
void |
start()
Start the configured engine, or restart the engine from the last used configuration file
|
void |
start(java.lang.String rootContextFilePath)
Perform startup using the supplied root configuration file
|
void |
startActingAs(java.lang.String actingNodeName)
Starts acting as the given server name, which means that all the pinned proxy services to the given node will
be started in the current server, unless it also is pinned into the current server.
|
void |
startMaintenance()
Put the server into the maintenance mode
|
void |
startTransportListeners()
Start actual listening for messages - must be invoked after all deployment units are initialized
|
void |
stop()
Stop the UltraESB server instance (without entering the maintenance mode)
|
void |
stopActingAs(java.lang.String actingNodeName)
Stops acting as the given server name, which means that all the pinned proxy services to the given node will
be stopped in the current server, unless it also is pinned into the current server.
|
void |
stopGracefully(long gracePeriod)
Stops the server gracefully within the specified grace period.
|
org.adroitlogic.ultraesb.jmx.view.ServerManagerView |
toDetailedView()
Return the immutable ServerManagerView from JMX.
|
void |
unloadAllDeploymentUnits()
Unload all deployment units currently loaded
|
void |
unloadDeploymentUnit(java.lang.String duId)
Unload deployment unit with the given id
|
void |
unregisterEndpoint(org.adroitlogic.ultraesb.core.endpoint.Endpoint ep) |
void |
unregisterProxyService(org.adroitlogic.ultraesb.core.ProxyService ps) |
void |
unregisterSequence(org.adroitlogic.ultraesb.core.Sequence seq) |
void |
updateConfigFile(java.lang.String filePath,
java.lang.String content) |
boolean |
waitUntilIdle(long waitMillis,
long endTime)
Wait and return when the server is idle, or at endTime
|
public void initialize(org.springframework.context.ApplicationContext rootContext, org.adroitlogic.ultraesb.core.ConfigurationImpl config)
rootContext
- the root application context to initializeconfig
- the ConfigurationImpl instancepublic void start(java.lang.String rootContextFilePath)
rootContextFilePath
- the path to the root configuration filepublic void markAsFailed()
public boolean isFailed()
public void start()
public void startTransportListeners()
public void registerEndpoint(org.adroitlogic.ultraesb.core.endpoint.Endpoint ep)
public void unregisterEndpoint(org.adroitlogic.ultraesb.core.endpoint.Endpoint ep)
public void registerSequence(org.adroitlogic.ultraesb.core.Sequence seq)
public void unregisterSequence(org.adroitlogic.ultraesb.core.Sequence seq)
public void registerProxyService(org.adroitlogic.ultraesb.core.ProxyService ps)
public void unregisterProxyService(org.adroitlogic.ultraesb.core.ProxyService ps)
public void outdateEndpoint(org.adroitlogic.ultraesb.core.endpoint.Endpoint ep)
public void outdateSequence(org.adroitlogic.ultraesb.core.Sequence seq)
public void outdateProxyService(org.adroitlogic.ultraesb.core.ProxyService ps)
public void shutdown()
shutdown
in interface ServerAdmin
public void shutdown(long waitMillis)
shutdown
in interface ServerAdmin
waitMillis
- the grace period for shutdownpublic boolean waitUntilIdle(long waitMillis, long endTime)
waitUntilIdle
in interface ServerAdmin
waitMillis
- maximum wait timeendTime
- actual deadlinepublic void startMaintenance()
startMaintenance
in interface ServerAdmin
public void endMaintenance()
endMaintenance
in interface ServerAdmin
public void stopGracefully(long gracePeriod)
stopGracefully
in interface ServerAdmin
gracePeriod
- the maximum time period the stop action will wait for the server to idle after entering the
maintenance modepublic void stop()
stop
in interface ServerAdmin
public boolean isStarted()
isStarted
in interface ServerAdmin
public java.util.Timer getTimer()
public void addOrUpdateDeploymentUnit(DeploymentUnitDefinition def)
addOrUpdateDeploymentUnit
in interface ServerAdmin
def
- deployment unit definition to be added or switchedpublic void addOrUpdateDeploymentUnit(java.lang.String id, byte[] config)
addOrUpdateDeploymentUnit
in interface ServerAdmin
id
- the deployment unit identifier which the configuration file is written toconfig
- the byte array containing file contents TODO change the byte stream to a compressed stream for better efficiencypublic boolean isDeploymentUnitLoaded(java.lang.String id)
isDeploymentUnitLoaded
in interface ServerAdmin
id
- the identifier to be checked for existencepublic void unloadDeploymentUnit(java.lang.String duId)
unloadDeploymentUnit
in interface ServerAdmin
duId
- deployment unit identifierpublic void unloadAllDeploymentUnits()
unloadAllDeploymentUnits
in interface ServerAdmin
public boolean purgeAllOutdatedDeploymentUnits()
purgeAllOutdatedDeploymentUnits
in interface ServerAdmin
public java.lang.String getStatus()
public static ServerManager getInstance()
public java.lang.Object getBean(java.lang.String id, java.lang.Class type)
getBean
in interface ServerAdmin
id
- the bean identifier of the spring bean to be retrievedtype
- the class of the bean to be retrievedpublic void setRootContextFilePath(java.lang.String rootContextFilePath)
public void setConfigurationDirPath(java.lang.String configurationDirPath)
public java.lang.String getConfigurationDirPath()
public java.io.File getDeploymentsDir()
public void updateConfigFile(java.lang.String filePath, java.lang.String content)
public java.lang.String getConfigFile(java.lang.String filePath)
public java.lang.String getServerName()
getServerName
in interface ServerAdmin
public void setServerName(java.lang.String serverName)
serverName
- the name of the server tobe setpublic int getUserDefinedStatusCode()
getUserDefinedStatusCode
in interface ServerAdmin
public java.util.List getProxyServiceIds()
getProxyServiceIds
in interface ServerAdmin
public void setUserDefinedStatusCode(int userDefinedStatusCode)
setUserDefinedStatusCode
in interface ServerAdmin
userDefinedStatusCode
- the status code valuepublic java.lang.String getInstallationName()
getInstallationName
in interface ServerAdmin
public void setInstallationName(java.lang.String installationName)
installationName
- the name of the installation to be setpublic org.adroitlogic.ultraesb.clustering.ClusterManager getClusterManager()
public boolean isClustered()
isClustered
in interface ServerAdmin
public java.lang.String getRemoteJmxServiceURL()
public void refresh()
LifecycleEventType.ON_SERVER_REFRESH
event sending a signal
to the server interceptors to act on if interested about this human initiated actionrefresh
in interface ServerAdmin
public java.util.List getActingServerNames()
getActingServerNames
in interface ServerAdmin
public boolean isActingAs(java.util.Set serverNames)
serverNames
- set containing the server names to check for acting aspublic boolean isActingAs(java.lang.String serverName)
isActingAs
in interface ServerAdmin
serverName
- to check for whether the server is acting as itpublic void startActingAs(java.lang.String actingNodeName)
startActingAs
in interface ServerAdmin
actingNodeName
- the name of the server to act as, in addition to selfpublic void stopActingAs(java.lang.String actingNodeName)
stopActingAs
in interface ServerAdmin
actingNodeName
- the name of the server to stop acting aspublic void definePersistedAlertConfig(AlertConfigurationDefinition alertConfig)
definePersistedAlertConfig
in interface ServerAdmin
alertConfig
- the alert configuration to be added to the registrypublic void defineNonPersistedAlertConfig(AlertConfigurationDefinition alertConfig)
defineNonPersistedAlertConfig
in interface ServerAdmin
alertConfig
- the alert configuration to be added to the registrypublic boolean removeNonPersistedAlertConfig(java.lang.String stream, long id)
removeNonPersistedAlertConfig
in interface ServerAdmin
stream
- stream for the policy alert configurationid
- id for the steampublic void scheduleTask(java.util.TimerTask task, long[] timeout)
BusRuntimeException
scheduleTask
in interface ServerAdmin
task
- the timer task to be scheduled, this will be wrapped in an internal timer task implementation
to make sure none of the tasks are causing the global ESB timer any issuestimeout
- if one argument is provided, it uses the Timer.schedule(java.util.TimerTask, long)
method while 2 arguments will invoke the Timer.schedule(java.util.TimerTask, long, long)
public org.adroitlogic.ultraesb.core.interceptor.message.MessageInterceptionHandler getMessageInterceptionHandler()
public ArtifactInterceptionHandler getArtifactInterceptionHandler()
public org.adroitlogic.ultraesb.jmx.view.DeploymentUnitView getDeploymentUnitView(java.lang.String id)
id
- the identifier of the deployment unit of which the view is to be returnedpublic org.adroitlogic.ultraesb.jmx.view.ServerManagerView toDetailedView()
public org.adroitlogic.ultraesb.jmx.view.ZabbixAgentView getZabbixAgentView()
public org.adroitlogic.ultraesb.jmx.view.DashboardView getDashboardView()
public java.util.List getPlaceHolderConfigurers()