use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.
the class ApplicationReady method handleWithException.
public void handleWithException(IHttpRequest req, IMutableHttpResponse resp) throws HandlerException {
try {
IEventBroker evb = this.getRuntime().getEventBroker();
evb.register(this);
evb.send(this, evb.createEvent(IEventConst.EVENT_TYPE_APPLICATION_READY));
this.m_logger.info("Send application ready event.");
evb.unregister(this);
resp.getContentStreamForWrite().close();
} catch (Exception e) {
throw new HandlerException(e.getMessage(), 500);
}
}
use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.
the class HtmlCallManager method startup.
public void startup() {
super.startup();
IEventBroker b = this.getRuntime().getEventBroker();
b.register(this, b.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED));
b.register(this, b.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED));
b.register(this, b.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED));
if (this.m_callList == null)
this.m_callList = getRuntime().getCallFactory().createCallList();
}
use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.
the class HtmlCallManager method shutdown.
public void shutdown() {
super.shutdown();
IEventBroker b = this.getRuntime().getEventBroker();
b.unregister(this, b.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED));
b.unregister(this, b.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED));
b.unregister(this, b.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED));
// this.saveDatabase();
}
use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.
the class DefaultCallDialogService method startup.
public void startup() {
super.startup();
IEventBroker eventBroker = this.getRuntime().getEventBroker();
eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_CALL));
if (isDetectOutgoing())
eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_OUTGOING_CALL));
this.m_logger.info("DefaultCallDialogService is started ...");
}
use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.
the class CallSimulator method sendAcceptEvent.
protected void sendAcceptEvent() {
if (this.m_currentIdentifiedCall != null) {
IEventBroker evtBroker = this.getRuntime().getEventBroker();
evtBroker.register(this);
this.m_currentIdentifiedCall.setAttribute(this.getRuntime().getCallFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_REASON, Integer.toString(IEventConst.EVENT_TYPE_CALLACCEPTED)));
this.m_currentIdentifiedCall.setAttribute(this.getRuntime().getCallFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS, IJAMConst.ATTRIBUTE_VALUE_ACCEPTED));
IEvent ev = evtBroker.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED, this.m_currentIdentifiedCall);
evtBroker.send(this, ev);
evtBroker.unregister(this);
evtBroker.unregister(this, evtBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_CALL));
}
}
Aggregations