kodo.event
Class TCPRemoteCommitProvider
java.lang.Object
|
+--kodo.event.AbstractRemoteCommitProvider
|
+--kodo.event.TCPRemoteCommitProvider
- All Implemented Interfaces:
- com.solarmetric.util.Closeable, Configurable, RemoteCommitProvider
- public class TCPRemoteCommitProvider
- extends AbstractRemoteCommitProvider
- implements Configurable
TCP-based implementation of RemoteCommitProvider
that
listens for object modifications and propagates those changes to
other RemoteCommitProviders over TCP sockets.
- Since:
- 2.5.0
Method Summary |
void |
broadcast(RemoteCommitEvent event)
Notifies other remote event managers in this JVM and on other machines
of changes to the cache. |
void |
close()
Close any resources used by this provider |
void |
endConfiguration()
Subclasses that need to perform actions in
Configurable.endConfiguration() must invoke this method. |
protected long |
getID()
|
protected byte[] |
getLocalhost()
|
protected int |
getPort()
|
protected void |
sendUpdatePacket(byte[] bytes)
Sends a change notification packet to other machines in this
provider cluster. |
void |
setAddresses(String names)
Sets the list of addresses to which this provider will broadcast
to the values in the comma-separated names list. |
void |
setPort(int port)
Sets the port that this provider should listen on. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TCPRemoteCommitProvider
public TCPRemoteCommitProvider()
throws UnknownHostException
getID
protected long getID()
- Returns:
- a number for this provider that is unique to this JVM.
getLocalhost
protected byte[] getLocalhost()
- Returns:
- the cached address of this machine.
getPort
protected int getPort()
- Returns:
- the port that this provider will listen on.
setPort
public void setPort(int port)
- Sets the port that this provider should listen on.
setAddresses
public void setAddresses(String names)
throws UnknownHostException
- Sets the list of addresses to which this provider will broadcast
to the values in the comma-separated
names
list.
broadcast
public void broadcast(RemoteCommitEvent event)
- Description copied from interface:
RemoteCommitProvider
- Notifies other remote event managers in this JVM and on other machines
of changes to the cache. This method must not notify the
event manager associated with the persistence manager that originated
this commit.
close
public void close()
- Description copied from interface:
RemoteCommitProvider
- Close any resources used by this provider
endConfiguration
public void endConfiguration()
- Subclasses that need to perform actions in
Configurable.endConfiguration()
must invoke this method.
- Specified by:
endConfiguration
in interface Configurable
- Overrides:
endConfiguration
in class AbstractRemoteCommitProvider
sendUpdatePacket
protected void sendUpdatePacket(byte[] bytes)
- Sends a change notification packet to other machines in this
provider cluster.
Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.