public final class EventManager
extends java.lang.Object
implements com.alcineo.connection.dispatcher.DispatcherListener<com.yello.api.system.events.RPCEvent>
EventManager
singleton class allows one to register for event notifications from the secure processorCardEvent
IntegrityStatusEvent
LifeCycleEvent
PongEvent
SecureUpdateEvent
SFPGAModeEvent
TestDoneEvent
TestResultEvent
public class EventTest { @Subscribe public void anyMethodName(CardEvent event) { System.out.println("Received event:" + event.getType().getDescription()); } @Subscribe public void anyMethodName2(SFPGAModeEvent event) { System.out.println("Received event:" + event.getMode().toString()); } } ... EventTest dummy = new EventTest(); EventManager.registerEventListener(dummy); try { Thread.sleep(10000 * 1000); } catch (InterruptedException e) { System.out.println("Exception:" + e.getMessage()); } EventManager.unRegisterEventListener(dummy);
Modifier and Type | Method and Description |
---|---|
void |
handle(com.yello.api.system.events.RPCEvent event)
The handle function is called by the YelloDispatcherService upon receiving an event frame
|
void |
onDeadEvent(com.google.common.eventbus.DeadEvent deadEvent)
Internal use only
Logs unhandled events, mainly used for a debug purposes |
void |
onRPCDConnectionFailedEvent(com.yello.api.system.events.RPCDConnectionFailedEvent event)
Internal use only
Exception is generated by the EventManger in case of disconnection from the security processor |
void |
onSystemExceptionEvent(com.yello.api.system.events.SystemExceptionEvent event)
Internal use only
Logs exceptions, mainly is used for a debugging purposes |
static void |
registerEventListener(java.lang.Object listener)
Registers a listener object inside the
EventManager |
static void |
start()
Initiates a connection to the secure processor
|
static void |
stop()
Stops
EventManager connection to the secure processor |
static void |
unRegisterEventListener(java.lang.Object listener)
Unregisters a listener object from the
EventManager |
public static void registerEventListener(java.lang.Object listener)
EventManager
listener
- object to be registered as an event listenerpublic static void unRegisterEventListener(java.lang.Object listener)
EventManager
listener
- object to be unregisteredpublic void handle(com.yello.api.system.events.RPCEvent event)
handle
in interface com.alcineo.connection.dispatcher.DispatcherListener<com.yello.api.system.events.RPCEvent>
public void onDeadEvent(com.google.common.eventbus.DeadEvent deadEvent)
deadEvent
- - non-handled eventpublic void onSystemExceptionEvent(com.yello.api.system.events.SystemExceptionEvent event)
event
- - SystemExceptionEvent generated by EventManagerpublic void onRPCDConnectionFailedEvent(com.yello.api.system.events.RPCDConnectionFailedEvent event)
event
- - connection failed eventpublic static void stop()
EventManager
connection to the secure processorpublic static void start()
Copyright © 2019 Yello. All rights reserved.