|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lwes.emitter.MulticastEventEmitter
public class MulticastEventEmitter
MulticastEventEmitter emits events to multicast groups on the network. This is the most common class used by users of the Light Weight Event System. Example code:
MulticastEventEmitter emitter = new MulticastEventEmitter();
emitter.setESFFilePath("/path/to/esf/file");
emitter.setMulticastAddress(InetAddress.getByName("224.0.0.69"));
emitter.setMulticastPort(9191);
emitter.initialize();
Event e = emitter.createEvent("MyEvent", false);
e.setString("key","value");
emitter.emit(e);
| Constructor Summary | |
|---|---|
MulticastEventEmitter()
Default constructor. |
|
| Method Summary | |
|---|---|
Event |
createEvent(java.lang.String eventName)
Creates a new event named eventName. |
Event |
createEvent(java.lang.String eventName,
boolean validate)
Creates a new event named eventName. |
protected void |
emit(byte[] bytes)
Emits a byte array to the network. |
void |
emit(Event event)
Emits the event to the network. |
java.lang.String |
getESFFilePath()
Gets the ESF file used for event validation |
java.io.InputStream |
getESFInputStream()
Gets the InputStream being used for event validation. |
java.net.InetAddress |
getInterface()
Gets the network interface for this emitter. |
java.net.InetAddress |
getMulticastAddress()
Gets the multicast address for this emitter. |
int |
getMulticastPort()
Gets the multicast port for this emitter. |
int |
getTimeToLive()
Gets the multicast time-to-live for this emitter. |
void |
initialize()
Initializes the emitter. |
void |
setESFFilePath(java.lang.String esfFilePath)
Sets the ESF file used for event validation. |
void |
setESFInputStream(java.io.InputStream esfInputStream)
Sets an InputStream to be used for event validation. |
void |
setInterface(java.net.InetAddress iface)
Sets the network interface for this emitter. |
void |
setMulticastAddress(java.net.InetAddress address)
Sets the multicast address for this emitter. |
void |
setMulticastPort(int port)
Sets the multicast port for this emitter. |
void |
setTimeToLive(int ttl)
Sets the multicast time-to-live for this emitter. |
void |
shutdown()
Shuts down the emitter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MulticastEventEmitter()
| Method Detail |
|---|
public void setMulticastAddress(java.net.InetAddress address)
address - the multicast addresspublic java.net.InetAddress getMulticastAddress()
public void setMulticastPort(int port)
port - the multicast portpublic int getMulticastPort()
public void setInterface(java.net.InetAddress iface)
iface - the network interfacepublic java.net.InetAddress getInterface()
public void setTimeToLive(int ttl)
ttl - the time to livepublic int getTimeToLive()
public void setESFFilePath(java.lang.String esfFilePath)
setESFFilePath in interface EventEmitteresfFilePath - the path of the ESF filepublic java.lang.String getESFFilePath()
getESFFilePath in interface EventEmitterpublic void setESFInputStream(java.io.InputStream esfInputStream)
setESFInputStream in interface EventEmitteresfInputStream - an InputStream used for event validationpublic java.io.InputStream getESFInputStream()
getESFInputStream in interface EventEmitter
public void initialize()
throws java.io.IOException
initialize in interface EventEmitterjava.io.IOException - if an I/O error occurs during initialization
public void shutdown()
throws java.io.IOException
shutdown in interface EventEmitterjava.io.IOException - if an I/O error occurs during initialization
public Event createEvent(java.lang.String eventName)
throws EventSystemException
createEvent in interface EventEmittereventName - the name of the event to be created
EventSystemException - if there is a problem creating the event
public Event createEvent(java.lang.String eventName,
boolean validate)
throws EventSystemException
createEvent in interface EventEmittereventName - the name of the event to be createdvalidate - whether or not to validate the event against the EventTemplateDB
EventSystemException - if there is a problem creating the event
public void emit(Event event)
throws java.io.IOException
emit in interface EventEmitterevent - the event to emit
java.io.IOException - throws an IOException is there is a network error.
protected void emit(byte[] bytes)
throws java.io.IOException
bytes - the byte array to emit
java.io.IOException - throws an IOException if there is a network error.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||