public class BMServer extends Object implements ConfigConstants, org.alfresco.config.ConfigDataListener, org.alfresco.config.ConfigChildListener, org.I0Itec.zkclient.IZkStateListener, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>, org.springframework.context.ApplicationContextAware
ConfigConstants.RunState
DEFAULT_RUNSTATE, DEFAULT_SERVER_ID, EXT_JAR, EXT_PROPERTIES, EXT_XML, PATH_CLASSES, PATH_CLUSTER_PROPERTIES, PATH_CLUSTERS, PATH_CONFIG, PATH_JARS, PATH_LOADED, PATH_RUN_PROPERTIES, PATH_RUNS, PATH_SERVER, PATH_SERVERS, PATH_TEST_CONTEXT, PATH_TEST_PROPERTIES, PATH_TESTS, PROP_CLUSTER, PROP_CONTROL_RUN_STATE, PROP_EVENTS_THREAD_COUNT, PROP_EVENTS_THREAD_EVENTSPERSECONDPERTHREAD, PROP_EVENTS_THREAD_WAITFORCOMPLETION, PROP_HTTP_CONNECTION_MAX, PROP_HTTP_CONNECTION_TIMEOUT_MS, PROP_HTTP_SOCKET_TIMEOUT_MS, PROP_HTTP_SOCKET_TTL_MS, PROP_MONGO_AUTOCONNECTRETRY, PROP_MONGO_CONNECTIONSPERHOST, PROP_MONGO_SOCKETTIMEOUT, PROP_MONGO_URI, PROP_MONGO_WRITENUMBER, PROP_SERVER_ID, PROP_TEST_NAME, PROP_TEST_RUN_FQN, PROP_TEST_RUN_NAME, SEPARATOR
Constructor and Description |
---|
BMServer(org.alfresco.config.ConfigService configService,
String cluster)
Constructor as used by Spring context
|
Modifier and Type | Method and Description |
---|---|
void |
checkTestRunsForRestart()
Prompt the server to perform a check of the loaded test runs in case they have changed state.
|
void |
childrenChanged(String path) |
void |
dataChanged(String path,
boolean deleted)
Triggers a
restart
whenever the cluster configuration change is made. |
org.springframework.context.support.AbstractApplicationContext |
getApplicationContext()
Get the application context that the server is using
|
String |
getCluster()
Get the name of the cluster that the server will join
|
ConfigConstants.RunState |
getDesiredRunState() |
ConfigConstants.RunState |
getRunState() |
String |
getServerId() |
void |
handleNewSession() |
void |
handleStateChanged(org.apache.zookeeper.Watcher.Event.KeeperState state)
Triggers a
restart |
static void |
main(String... args)
Real main method
|
void |
onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
Starts up application contexts as required.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Stores the application context for use by the tests.
|
void |
setDesiredRunState(ConfigConstants.RunState runState)
Sets the desired run state and notifies listeners (main thread).
|
public BMServer(org.alfresco.config.ConfigService configService, String cluster)
public static void main(String... args)
args
- command line argumentspublic String getCluster()
public ConfigConstants.RunState getRunState()
public ConfigConstants.RunState getDesiredRunState()
public void setDesiredRunState(ConfigConstants.RunState runState)
runState
- the desired server run statepublic org.springframework.context.support.AbstractApplicationContext getApplicationContext()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
applicationContext
- the server's application contextorg.springframework.beans.BeansException
public String getServerId()
public void handleStateChanged(org.apache.zookeeper.Watcher.Event.KeeperState state) throws Exception
restart
handleStateChanged
in interface org.I0Itec.zkclient.IZkStateListener
Exception
public void handleNewSession() throws Exception
handleNewSession
in interface org.I0Itec.zkclient.IZkStateListener
Exception
public void checkTestRunsForRestart()
public void dataChanged(String path, boolean deleted)
restart
whenever the cluster configuration change is made. The entire server configuration is invalid.dataChanged
in interface org.alfresco.config.ConfigDataListener
public void childrenChanged(String path)
childrenChanged
in interface org.alfresco.config.ConfigChildListener
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
Copyright © 2014. All rights reserved.