org.apache.jcs.auxiliary.remote
Class RemoteCacheAttributes

java.lang.Object
  extended by org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes
      extended by org.apache.jcs.auxiliary.remote.RemoteCacheAttributes
All Implemented Interfaces:
Serializable, Cloneable, AuxiliaryCacheAttributes, IRemoteCacheAttributes
Direct Known Subclasses:
RemoteHttpCacheAttributes

public class RemoteCacheAttributes
extends AbstractAuxiliaryCacheAttributes
implements IRemoteCacheAttributes

These objects are used to configure the remote cache client.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes
cacheName, eventQueuePoolName, eventQueueType, name
 
Fields inherited from interface org.apache.jcs.auxiliary.remote.behavior.IRemoteCacheAttributes
CLUSTER, DEFAULT_RECEIVE, DEFAULT_RMI_SOCKET_FACTORY_TIMEOUT_MILLIS, DEFAULT_ZOMBIE_QUEUE_MAX_SIZE, LOCAL
 
Fields inherited from interface org.apache.jcs.auxiliary.AuxiliaryCacheAttributes
POOLED_QUEUE_TYPE, SINGLE_QUEUE_TYPE
 
Constructor Summary
RemoteCacheAttributes()
          Default constructor for the RemoteCacheAttributes object
 
Method Summary
 AuxiliaryCacheAttributes copy()
          Clones
 String getClusterServers()
          Gets the clusterServers attribute of the RemoteCacheAttributes object.
 int getFailoverIndex()
          Gets the failoverIndex attribute of the RemoteCacheAttributes object.
 String[] getFailovers()
          Gets the failovers attribute of the RemoteCacheAttributes object.
 String getFailoverServers()
          Gets the failoverServers attribute of the RemoteCacheAttributes object.
 boolean getGetOnly()
          Gets the getOnly attribute of the RemoteCacheAttributes object.
 int getGetTimeoutMillis()
          -1 and 0 mean no timeout, this is the default if the timeout is -1 or 0, no threadpool will be used.
 boolean getLocalClusterConsistency()
          Should cluster updates be propogated to the locals.
 int getLocalPort()
          Gets the localPort attribute of the RemoteCacheAttributes object.
 String getRemoteHost()
          Gets the remoteHost attribute of the RemoteCacheAttributes object.
 int getRemotePort()
          Gets the remotePort attribute of the RemoteCacheAttributes object.
 String getRemoteServiceName()
          Gets the remoteServiceName attribute of the RemoteCacheAttributes object.
 int getRemoteType()
          Gets the remoteType attribute of the RemoteCacheAttributes object.
 String getRemoteTypeName()
          Gets the remoteTypeName attribute of the RemoteCacheAttributes object.
 boolean getRemoveUponRemotePut()
          Gets the removeUponRemotePut attribute of the RemoteCacheAttributes object.
 int getRmiSocketFactoryTimeoutMillis()
          This sets a general timeout on the rmi socket factory.
 String getThreadPoolName()
          The thread pool the remote cache should use.
 int getZombieQueueMaxSize()
          The number of elements the zombie queue will hold.
 boolean isReceive()
          If RECEIVE is false then the remote cache will not register a listener with the remote server.
 void setClusterServers(String s)
          Sets the clusterServers attribute of the RemoteCacheAttributes object.
 void setFailoverIndex(int p)
          Sets the failoverIndex attribute of the RemoteCacheAttributes object.
 void setFailovers(String[] f)
          Sets the failovers attribute of the RemoteCacheAttributes object.
 void setFailoverServers(String s)
          Sets the failoverServers attribute of the RemoteCacheAttributes object.
 void setGetOnly(boolean r)
          Sets the getOnly attribute of the RemoteCacheAttributes object
 void setGetTimeoutMillis(int millis)
          -1 means no timeout, this is the default if the timeout is -1 or 0, no threadpool will be used.
 void setLocalClusterConsistency(boolean r)
          Should cluster updates be propogated to the locals.
 void setLocalPort(int p)
          Sets the localPort attribute of the RemoteCacheAttributes object
 void setReceive(boolean receive)
          By default this option is true.
 void setRemoteHost(String s)
          Sets the remoteHost attribute of the RemoteCacheAttributes object.
 void setRemotePort(int p)
          Sets the remotePort attribute of the RemoteCacheAttributes object.
 void setRemoteServiceName(String s)
          Sets the remoteServiceName attribute of the RemoteCacheAttributes object.
 void setRemoteType(int p)
          Sets the remoteType attribute of the RemoteCacheAttributes object.
 void setRemoteTypeName(String s)
          Sets the remoteTypeName attribute of the RemoteCacheAttributes object.
 void setRemoveUponRemotePut(boolean r)
          Sets the removeUponRemotePut attribute of the RemoteCacheAttributes object.
 void setRmiSocketFactoryTimeoutMillis(int rmiSocketFactoryTimeoutMillis)
          This sets a general timeout on the RMI socket factory.
 void setThreadPoolName(String name)
          Set the anme of the pool to use.
 void setZombieQueueMaxSize(int zombieQueueMaxSize)
          The number of elements the zombie queue will hold.
 String toString()
           
 
Methods inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes
getCacheName, getEventQueuePoolName, getEventQueueType, getName, setCacheName, setEventQueuePoolName, setEventQueueType, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jcs.auxiliary.AuxiliaryCacheAttributes
getCacheName, getEventQueuePoolName, getEventQueueType, getName, setCacheName, setEventQueuePoolName, setEventQueueType, setName
 

Constructor Detail

RemoteCacheAttributes

public RemoteCacheAttributes()
Default constructor for the RemoteCacheAttributes object

Method Detail

getRemoteTypeName

public String getRemoteTypeName()
Gets the remoteTypeName attribute of the RemoteCacheAttributes object.

Specified by:
getRemoteTypeName in interface IRemoteCacheAttributes
Returns:
The remoteTypeName value

setRemoteTypeName

public void setRemoteTypeName(String s)
Sets the remoteTypeName attribute of the RemoteCacheAttributes object.

Specified by:
setRemoteTypeName in interface IRemoteCacheAttributes
Parameters:
s - The new remoteTypeName value

getFailoverIndex

public int getFailoverIndex()
Gets the failoverIndex attribute of the RemoteCacheAttributes object.

Specified by:
getFailoverIndex in interface IRemoteCacheAttributes
Returns:
The failoverIndex value

setFailoverIndex

public void setFailoverIndex(int p)
Sets the failoverIndex attribute of the RemoteCacheAttributes object.

Specified by:
setFailoverIndex in interface IRemoteCacheAttributes
Parameters:
p - The new failoverIndex value

getFailovers

public String[] getFailovers()
Gets the failovers attribute of the RemoteCacheAttributes object.

Specified by:
getFailovers in interface IRemoteCacheAttributes
Returns:
The failovers value

setFailovers

public void setFailovers(String[] f)
Sets the failovers attribute of the RemoteCacheAttributes object.

Specified by:
setFailovers in interface IRemoteCacheAttributes
Parameters:
f - The new failovers value

getRemoteType

public int getRemoteType()
Gets the remoteType attribute of the RemoteCacheAttributes object.

Specified by:
getRemoteType in interface IRemoteCacheAttributes
Returns:
The remoteType value

setRemoteType

public void setRemoteType(int p)
Sets the remoteType attribute of the RemoteCacheAttributes object.

Specified by:
setRemoteType in interface IRemoteCacheAttributes
Parameters:
p - The new remoteType value

copy

public AuxiliaryCacheAttributes copy()
Description copied from interface: AuxiliaryCacheAttributes
Clones

Specified by:
copy in interface AuxiliaryCacheAttributes
Returns:
AuxiliaryCacheAttributes

getRemoteServiceName

public String getRemoteServiceName()
Gets the remoteServiceName attribute of the RemoteCacheAttributes object.

Specified by:
getRemoteServiceName in interface IRemoteCacheAttributes
Returns:
The remoteServiceName value

setRemoteServiceName

public void setRemoteServiceName(String s)
Sets the remoteServiceName attribute of the RemoteCacheAttributes object.

Specified by:
setRemoteServiceName in interface IRemoteCacheAttributes
Parameters:
s - The new remoteServiceName value

getRemoteHost

public String getRemoteHost()
Gets the remoteHost attribute of the RemoteCacheAttributes object.

Specified by:
getRemoteHost in interface IRemoteCacheAttributes
Returns:
The remoteHost value

setRemoteHost

public void setRemoteHost(String s)
Sets the remoteHost attribute of the RemoteCacheAttributes object.

Specified by:
setRemoteHost in interface IRemoteCacheAttributes
Parameters:
s - The new remoteHost value

getRemotePort

public int getRemotePort()
Gets the remotePort attribute of the RemoteCacheAttributes object.

Specified by:
getRemotePort in interface IRemoteCacheAttributes
Returns:
The remotePort value

setRemotePort

public void setRemotePort(int p)
Sets the remotePort attribute of the RemoteCacheAttributes object.

Specified by:
setRemotePort in interface IRemoteCacheAttributes
Parameters:
p - The new remotePort value

getClusterServers

public String getClusterServers()
Gets the clusterServers attribute of the RemoteCacheAttributes object.

Specified by:
getClusterServers in interface IRemoteCacheAttributes
Returns:
The clusterServers value

setClusterServers

public void setClusterServers(String s)
Sets the clusterServers attribute of the RemoteCacheAttributes object.

Specified by:
setClusterServers in interface IRemoteCacheAttributes
Parameters:
s - The new clusterServers value

getFailoverServers

public String getFailoverServers()
Gets the failoverServers attribute of the RemoteCacheAttributes object.

Specified by:
getFailoverServers in interface IRemoteCacheAttributes
Returns:
The failoverServers value

setFailoverServers

public void setFailoverServers(String s)
Sets the failoverServers attribute of the RemoteCacheAttributes object.

Specified by:
setFailoverServers in interface IRemoteCacheAttributes
Parameters:
s - The new failoverServers value

getLocalPort

public int getLocalPort()
Gets the localPort attribute of the RemoteCacheAttributes object.

Specified by:
getLocalPort in interface IRemoteCacheAttributes
Returns:
The localPort value

setLocalPort

public void setLocalPort(int p)
Sets the localPort attribute of the RemoteCacheAttributes object

Specified by:
setLocalPort in interface IRemoteCacheAttributes
Parameters:
p - The new localPort value

getRemoveUponRemotePut

public boolean getRemoveUponRemotePut()
Gets the removeUponRemotePut attribute of the RemoteCacheAttributes object.

Specified by:
getRemoveUponRemotePut in interface IRemoteCacheAttributes
Returns:
The removeUponRemotePut value

setRemoveUponRemotePut

public void setRemoveUponRemotePut(boolean r)
Sets the removeUponRemotePut attribute of the RemoteCacheAttributes object.

Specified by:
setRemoveUponRemotePut in interface IRemoteCacheAttributes
Parameters:
r - The new removeUponRemotePut value

getGetOnly

public boolean getGetOnly()
Gets the getOnly attribute of the RemoteCacheAttributes object.

Specified by:
getGetOnly in interface IRemoteCacheAttributes
Returns:
The getOnly value

setGetOnly

public void setGetOnly(boolean r)
Sets the getOnly attribute of the RemoteCacheAttributes object

Specified by:
setGetOnly in interface IRemoteCacheAttributes
Parameters:
r - The new getOnly value

getLocalClusterConsistency

public boolean getLocalClusterConsistency()
Should cluster updates be propogated to the locals.

Specified by:
getLocalClusterConsistency in interface IRemoteCacheAttributes
Returns:
The localClusterConsistency value

setLocalClusterConsistency

public void setLocalClusterConsistency(boolean r)
Should cluster updates be propogated to the locals.

Specified by:
setLocalClusterConsistency in interface IRemoteCacheAttributes
Parameters:
r - The new localClusterConsistency value

getThreadPoolName

public String getThreadPoolName()
Description copied from interface: IRemoteCacheAttributes
The thread pool the remote cache should use. At first this will only be for gets.

The default name is "remote_cache_client"

Specified by:
getThreadPoolName in interface IRemoteCacheAttributes
Returns:
the name of the pool

setThreadPoolName

public void setThreadPoolName(String name)
Description copied from interface: IRemoteCacheAttributes
Set the anme of the pool to use. Pools should be defined in the cache.ccf.

Specified by:
setThreadPoolName in interface IRemoteCacheAttributes
Parameters:
name -

getGetTimeoutMillis

public int getGetTimeoutMillis()
Description copied from interface: IRemoteCacheAttributes
-1 and 0 mean no timeout, this is the default if the timeout is -1 or 0, no threadpool will be used.

Specified by:
getGetTimeoutMillis in interface IRemoteCacheAttributes
Returns:
getTimeoutMillis

setGetTimeoutMillis

public void setGetTimeoutMillis(int millis)
Description copied from interface: IRemoteCacheAttributes
-1 means no timeout, this is the default if the timeout is -1 or 0, no threadpool will be used. If the timeout is greater than 0 a threadpool will be used for get requests.

Specified by:
setGetTimeoutMillis in interface IRemoteCacheAttributes
Parameters:
millis -

setRmiSocketFactoryTimeoutMillis

public void setRmiSocketFactoryTimeoutMillis(int rmiSocketFactoryTimeoutMillis)
Description copied from interface: IRemoteCacheAttributes
This sets a general timeout on the RMI socket factory. By default the socket factory will block forever.

Specified by:
setRmiSocketFactoryTimeoutMillis in interface IRemoteCacheAttributes
Parameters:
rmiSocketFactoryTimeoutMillis - The rmiSocketFactoryTimeoutMillis to set.

getRmiSocketFactoryTimeoutMillis

public int getRmiSocketFactoryTimeoutMillis()
Description copied from interface: IRemoteCacheAttributes
This sets a general timeout on the rmi socket factory. By default the socket factory will block forever.

We have a default setting. The default rmi behavior should never be used.

Specified by:
getRmiSocketFactoryTimeoutMillis in interface IRemoteCacheAttributes
Returns:
Returns the rmiSocketFactoryTimeoutMillis.

setReceive

public void setReceive(boolean receive)
By default this option is true. If you set it to false, you will not receive updates or removes from the remote server.

Specified by:
setReceive in interface IRemoteCacheAttributes
Parameters:
receive -

isReceive

public boolean isReceive()
If RECEIVE is false then the remote cache will not register a listener with the remote server. This allows you to configure a remote server as a repository from which you can get and to which you put, but from which you do not reveive any notifications. That is, you will not receive updates or removes.

If you set this option to false, you should set your locl memory size to 0.

The remote cache manager uses this value to decide whether or not to register a listener.

Specified by:
isReceive in interface IRemoteCacheAttributes
Returns:
the receive value.

setZombieQueueMaxSize

public void setZombieQueueMaxSize(int zombieQueueMaxSize)
The number of elements the zombie queue will hold. This queue is used to store events if we loose our connection with the server.

Specified by:
setZombieQueueMaxSize in interface IRemoteCacheAttributes
Parameters:
zombieQueueMaxSize - The zombieQueueMaxSize to set.

getZombieQueueMaxSize

public int getZombieQueueMaxSize()
The number of elements the zombie queue will hold. This queue is used to store events if we loose our connection with the server.

Specified by:
getZombieQueueMaxSize in interface IRemoteCacheAttributes
Returns:
Returns the zombieQueueMaxSize.

toString

public String toString()
Overrides:
toString in class Object
Returns:
String, all the important values that can be configured


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.