Search in sources :

Example 6 with IHttpRequest

use of de.janrufmonitor.service.commons.http.IHttpRequest in project janrufmonitor by tbrandt77.

the class Server method shutdown.

public void shutdown() {
    super.shutdown();
    IHttpRequest request = new ShutdownHandler();
    this.sendRequest(getRuntime().getEventBroker().createEvent(-1), request);
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        this.m_logger.severe(e.getMessage());
    }
    IEventBroker eventBroker = this.getRuntime().getEventBroker();
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_INCOMINGCALL));
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED));
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED));
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED));
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_MANUALCALLACCEPTED));
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_APPLICATION_READY));
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_CALL));
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_OUTGOING_CALL));
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_OUTGOINGCALL));
    // stop HTTP Server
    this.m_httpSrv.stop();
    this.m_httpSrv = null;
    ClientRegistry.getInstance().shutdown();
    this.m_logger.info("Server is shut down ...");
}
Also used : IHttpRequest(de.janrufmonitor.service.commons.http.IHttpRequest) ShutdownHandler(de.janrufmonitor.service.server.request.handler.ShutdownHandler) IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Aggregations

IHttpRequest (de.janrufmonitor.service.commons.http.IHttpRequest)6 IRequester (de.janrufmonitor.service.commons.http.IRequester)3 GetImageHandler (de.janrufmonitor.service.client.request.handler.GetImageHandler)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 MalformedURLException (java.net.MalformedURLException)2 ICall (de.janrufmonitor.framework.ICall)1 IEventBroker (de.janrufmonitor.framework.event.IEventBroker)1 ClientHandler (de.janrufmonitor.service.client.http.simple.ClientHandler)1 SimplePortListener (de.janrufmonitor.service.commons.http.simple.SimplePortListener)1 AcceptHandler (de.janrufmonitor.service.server.request.handler.AcceptHandler)1 ApplicationReadyHandler (de.janrufmonitor.service.server.request.handler.ApplicationReadyHandler)1 ClearHandler (de.janrufmonitor.service.server.request.handler.ClearHandler)1 IdentifiedCallHandler (de.janrufmonitor.service.server.request.handler.IdentifiedCallHandler)1 IdentifiedOutgoingCallHandler (de.janrufmonitor.service.server.request.handler.IdentifiedOutgoingCallHandler)1 IncomingCallHandler (de.janrufmonitor.service.server.request.handler.IncomingCallHandler)1 OutgoingCallHandler (de.janrufmonitor.service.server.request.handler.OutgoingCallHandler)1 RejectedHandler (de.janrufmonitor.service.server.request.handler.RejectedHandler)1 ShutdownHandler (de.janrufmonitor.service.server.request.handler.ShutdownHandler)1 BufferedInputStream (java.io.BufferedInputStream)1