ca.odell.glazedlists.io
Class ListPeer
java.lang.Object
ca.odell.glazedlists.io.ListPeer
public class ListPeer
extends java.lang.Object
ListPeer(int listenPort) - Creates a new ListPeer that binds to the specified port.
|
ListPeer
public ListPeer(int listenPort)
Creates a new ListPeer that binds to the specified port.
NetworkList publish
public NetworkList publish(EventList source,
String path,
ByteCoder byteCoder)
Publish the specified EventList with the specified name.
source
- the EventList
to publish. Each change to this EventList
will be immediately published to all subscribers.path
- the address that the EventList
shall be published under.
The path must start with a slash character. This must be unique among
all EventList
s published on this ListPeer
.byteCoder
- a helper that can convert the elements of the EventList
into binary network-transmittable form. Some general purpose ByteCoder
s
are available in the GlazedLists
factory class.
- a simple decorator of the published
EventList
with additional methods to bring the list offline. This list is writable.
start
public void start()
throws IOException
Starts the peer. This binds to the listen port and allows connections to
be sent and received.
stop
public void stop()
Stops the peer. This disconnects all active
EventList
s and releases
the listen port.
subscribe
public NetworkList<E> subscribe(String host,
int port,
String path,
ByteCoder byteCoder)
Subscribe to the EventList with the specified name.
host
- the network hostname of the machine serving the original copy
of the data of interest. Together with the port, this should map
to a proper InetSocketAddress
.port
- the port the EventList
of interest is being published on.path
- the address that the EventList
is published under.byteCoder
- a helper that can convert the binary data from the network
into list elements for this EventList
. Some general purpose ByteCoder
s
are available in the GlazedLists
factory class.
- the
EventList
that gets its data from the specified remote
source. This EventList
will contain no data until the connection
completes. This list is not writable.
Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by pbuilder at 2009-07-14 22:05