public class TCPRemoteCommitProvider extends AbstractRemoteCommitProvider implements Configurable
RemoteCommitProvider
that
listens for object modifications and propagates those changes to
other RemoteCommitProviders over TCP sockets.Modifier and Type | Class and Description |
---|---|
protected class |
TCPRemoteCommitProvider.HostAddress
Utility class to store an InetAddress and an int.
|
Modifier and Type | Field and Description |
---|---|
protected List<TCPRemoteCommitProvider.HostAddress> |
_addresses |
protected ReentrantLock |
_addressesLock |
protected int |
_port |
protected static Localizer |
s_loc |
eventManager, log
Constructor and Description |
---|
TCPRemoteCommitProvider() |
Modifier and Type | Method and Description |
---|---|
void |
broadcast(RemoteCommitEvent event)
Notifies other remote event managers in this JVM and on other machines
of changes to the cache.
|
void |
close()
Free the resources used by this provider.
|
void |
endConfiguration()
Subclasses that need to perform actions in
Configurable.endConfiguration() must invoke this method. |
int |
getMaxIdle() |
int |
getMaxTotal() |
int |
getNumBroadcastThreads() |
int |
getPort() |
int |
getRecoveryTimeMillis() |
void |
setAddresses(String names)
Sets the list of addresses of peers to which this provider will send events to.
|
void |
setMaxActive(int maxActive)
Deprecated.
|
void |
setMaxIdle(int maxIdle)
Set the number of idle sockets that this provider can keep open to each peer in the cluster.
|
void |
setMaxTotal(int maxTotal)
Set the maximum total number of sockets that this provider can simultaneously open to each peer in the cluster.
|
void |
setNumBroadcastThreads(int numBroadcastThreads)
Set the number of worker threads that are used for transmitting packets to peers in the cluster.
|
void |
setPort(int port)
Set the port that this provider should listen on.
|
void |
setRecoveryTimeMillis(int recoverytime)
Set the number of milliseconds to wait before retrying to reconnect to a peer after it becomes unreachable.
|
fireEvent, setConfiguration, setRemoteCommitEventManager, startConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConfiguration, startConfiguration
protected static final Localizer s_loc
protected int _port
protected List<TCPRemoteCommitProvider.HostAddress> _addresses
protected final ReentrantLock _addressesLock
public TCPRemoteCommitProvider() throws UnknownHostException
UnknownHostException
public int getPort()
public void setPort(int port)
port
- the port that this provider should listen onpublic void setRecoveryTimeMillis(int recoverytime)
recoverytime
- the number of milliseconds to wait before retrying to reconnect to a peer after it becomes
unreachablepublic int getRecoveryTimeMillis()
@Deprecated public void setMaxActive(int maxActive)
maxActive
- the maximum total number of sockets that this provider can simultaneously open to each peer in
the cluster. * @deprecated please use setMaxTotal(int)
insteadpublic void setMaxTotal(int maxTotal)
maxTotal
- the maximum total number of sockets that this provider can simultaneously open to each peer in
the cluster.public int getMaxTotal()
public void setMaxIdle(int maxIdle)
maxIdle
- the number of idle sockets that this provider can keep open to each peer in the clusterpublic int getMaxIdle()
public void setNumBroadcastThreads(int numBroadcastThreads)
numBroadcastThreads
- the number of worker threads that are used for transmitting packets to peers in the
clusterpublic int getNumBroadcastThreads()
public void setAddresses(String names) throws UnknownHostException
names
list in the form of "myhost1:portA;myhost2:portB".names
- the list of addresses of peers to which this provider will send events toUnknownHostException
- in case peer name cannot be resolvedpublic void endConfiguration()
Configurable.endConfiguration()
must invoke this method.endConfiguration
in interface Configurable
endConfiguration
in class AbstractRemoteCommitProvider
public void broadcast(RemoteCommitEvent event)
RemoteCommitProvider
broadcast
in interface RemoteCommitProvider
public void close()
RemoteCommitProvider
close
in interface RemoteCommitProvider
close
in interface Closeable
Copyright © 2006–2020 Apache Software Foundation. All rights reserved.