org.jboss.cache.config
Class Option

java.lang.Object
  extended by org.jboss.cache.config.Option

public class Option
extends java.lang.Object

Used to override characteristics of specific calls to the cache. The javadocs of each of the setters below detail functionality and behaviour.

Since:
1.3.0
Author:
Manik Surtani (manik@jboss.org)

Constructor Summary
Option()
           
 
Method Summary
 DataVersion getDataVersion()
           
 boolean getForceDataGravitation()
           
 boolean isCacheModeLocal()
          only applies to put() and remove() methods on the cache.
 boolean isFailSilently()
           
 boolean isSuppressLocking()
           
 void setCacheModeLocal(boolean cacheModeLocal)
          overriding CacheMode from REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC, INVALIDATION_ASYNC to LOCAL.
 void setDataVersion(DataVersion dataVersion)
          Passing in an DataVersion instance when using optimistic locking will override the default behaviour of internally generated version info and allow the caller to handle data versioning.
 void setFailSilently(boolean failSilently)
          suppress any failures in your cache operation, including version mismatches with optimistic locking, timeouts obtaining locks, transaction rollbacks.
 void setForceDataGravitation(boolean enableDataGravitation)
          Enables data gravitation calls if a cache miss is detected when using Buddy Replication.
 void setSuppressLocking(boolean suppressLocking)
          Suppresses acquiring locks for the given invocation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Option

public Option()
Method Detail

isSuppressLocking

public boolean isSuppressLocking()
Since:
1.4.0

setSuppressLocking

public void setSuppressLocking(boolean suppressLocking)
Suppresses acquiring locks for the given invocation. Used with pessimistic locking only. Use with extreme care, may lead to a breach in data integrity!

Since:
1.4.0

isFailSilently

public boolean isFailSilently()
Since:
1.3.0

setFailSilently

public void setFailSilently(boolean failSilently)
suppress any failures in your cache operation, including version mismatches with optimistic locking, timeouts obtaining locks, transaction rollbacks. If this is option is set, the method invocation will __never fail or throw an exception__, although it may not succeed. With this option enabled the call will not participate in any ongoing transactions even if a transaction is running.

Since:
1.3.0

isCacheModeLocal

public boolean isCacheModeLocal()
only applies to put() and remove() methods on the cache.

Since:
1.3.0

setCacheModeLocal

public void setCacheModeLocal(boolean cacheModeLocal)
overriding CacheMode from REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC, INVALIDATION_ASYNC to LOCAL. Only applies to put() and remove() methods on the cache.

Parameters:
cacheModeLocal -
Since:
1.3.0

getDataVersion

public DataVersion getDataVersion()
Since:
1.3.0

setDataVersion

public void setDataVersion(DataVersion dataVersion)
Passing in an DataVersion instance when using optimistic locking will override the default behaviour of internally generated version info and allow the caller to handle data versioning.

Since:
1.3.0

getForceDataGravitation

public boolean getForceDataGravitation()
Since:
1.4.0

setForceDataGravitation

public void setForceDataGravitation(boolean enableDataGravitation)
Enables data gravitation calls if a cache miss is detected when using Buddy Replication. Enabled only for a given invocation, and only useful if autoDataGravitation is set to false. See Buddy Replication documentation for more details.

Since:
1.4.0

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright 1998-2005 JBoss Inc . All Rights Reserved.