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 (mondain@gmail.com)
-
Field Summary
Modifier and TypeFieldDescriptionprivate ApplicationContext
Spring Application contextprivate ApplicationContext
Red5 core contextprivate ContextLoader
Red5 context loaderprivate ApplicationContext
Red5 core contextprivate ExecutorService
private Future<?>
private LoaderBase
private org.slf4j.Logger
private int
Port to which the server listens for shutdown requests.private AtomicBoolean
private int
Delay or wait time in seconds before exiting.private String
Name for the file containing the shutdown tokenprivate final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
destroy()
void
setApplicationContext
(ApplicationContext applicationContext) void
setCommonContext
(ApplicationContext commonContext) void
setContextLoader
(ContextLoader contextLoader) void
setCoreContext
(ApplicationContext coreContext) void
setPort
(int port) void
setShutdownDelay
(int shutdownDelay) void
setShutdownTokenFileName
(String shutdownTokenFileName) private void
void
start()
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:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
Exception
-
destroy
- Specified by:
destroy
in 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:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-
setCoreContext
-
setCommonContext
-
setContextLoader
-