public class NetworkEventListener extends Object implements SessionEventHandler
GameRoom
to send
NetworkEvent
s to the connected sessions. When the game room
publishes such events to its channel, this listener will pick it up and
transmit it to the session which in turn will transmit it to the remote
machine/vm.Modifier and Type | Field and Description |
---|---|
private static int |
EVENT_TYPE |
private Session |
session |
Constructor and Description |
---|
NetworkEventListener(Session session) |
Modifier and Type | Method and Description |
---|---|
int |
getEventType() |
Session |
getSession() |
void |
onEvent(Event event)
On event
|
void |
setSession(Session session)
Sets the session instance on this handler.
|
private static final int EVENT_TYPE
private final Session session
public NetworkEventListener(Session session)
public void onEvent(Event event)
EventHandler
onEvent
in interface EventHandler
public int getEventType()
getEventType
in interface EventHandler
public Session getSession()
getSession
in interface SessionEventHandler
public void setSession(Session session)
SessionEventHandler
setSession
in interface SessionEventHandler
session
- The session instance to set.Copyright © 2013. All Rights Reserved.