Package org.red5.server.service
Class ShutdownServer
java.lang.Object
org.red5.server.service.ShutdownServer
- All Implemented Interfaces:
Aware,DisposableBean,InitializingBean,ApplicationContextAware
public class ShutdownServer
extends Object
implements ApplicationContextAware, InitializingBean, DisposableBean
Server/service to perform orderly and controlled shutdown and clean up of Red5.
- Author:
- Paul Gregoire ([email protected])
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ApplicationContextSpring Application contextprivate ApplicationContextRed5 core contextprivate ContextLoaderRed5 context loaderprivate ApplicationContextRed5 core contextprivate ExecutorServiceprivate Future<?>private LoaderBaseprivate org.slf4j.Loggerprivate intPort to which the server listens for shutdown requests.private AtomicBooleanprivate intDelay or wait time in seconds before exiting.private StringName for the file containing the shutdown tokenprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()voidsetApplicationContext(ApplicationContext applicationContext) voidsetCommonContext(ApplicationContext commonContext) voidsetContextLoader(ContextLoader contextLoader) voidsetCoreContext(ApplicationContext coreContext) voidsetPort(int port) voidsetShutdownDelay(int shutdownDelay) voidsetShutdownTokenFileName(String shutdownTokenFileName) private voidvoidstart()Starts internal server listening for shutdown requests.
-
Field Details
-
log
private org.slf4j.Logger log -
port
private int portPort to which the server listens for shutdown requests. Default is 9999. -
shutdownDelay
private int shutdownDelayDelay or wait time in seconds before exiting. -
shutdownTokenFileName
Name for the file containing the shutdown token -
applicationContext
Spring Application context -
coreContext
Red5 core context -
commonContext
Red5 core context -
contextLoader
Red5 context loader -
token
-
shutdown
-
executor
-
future
-
jeeServer
-
-
Constructor Details
-
ShutdownServer
public ShutdownServer()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception
-
destroy
- Specified by:
destroyin interfaceDisposableBean- Throws:
Exception
-
start
public void start()Starts internal server listening for shutdown requests. -
shutdownOrderly
private void shutdownOrderly() -
setPort
public void setPort(int port) -
setShutdownDelay
public void setShutdownDelay(int shutdownDelay) -
setShutdownTokenFileName
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware- Throws:
BeansException
-
setCoreContext
-
setCommonContext
-
setContextLoader
-