org.jboss.cache.interceptors
Class OptimisticCreateIfNotExistsInterceptor

java.lang.Object
  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.MethodDispacherInterceptor
          extended by org.jboss.cache.interceptors.OptimisticInterceptor
              extended by org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor
All Implemented Interfaces:
InterceptorMBean

public class OptimisticCreateIfNotExistsInterceptor
extends OptimisticInterceptor

Used to create new NodeSPI instances in the main data structure and then copy it into the TransactionWorkspace as WorkspaceNodes as needed. This is only invoked if nodes needed do not exist in the underlying structure, they are added and the corresponding WorkspaceNode.isCreated() would return true to denote that this node has been freshly created in the underlying structure.

Author:
Manik Surtani (manik@jboss.org), Steve Woodcock (stevew@jofti.com)

Field Summary
 
Fields inherited from class org.jboss.cache.interceptors.OptimisticInterceptor
txManager, txTable
 
Fields inherited from class org.jboss.cache.interceptors.Interceptor
cache, configuration, last, log, next, trace
 
Constructor Summary
OptimisticCreateIfNotExistsInterceptor()
           
 
Method Summary
protected  Object handleMoveMethod(InvocationContext ctx, Fqn from, Fqn to)
          Handles CacheImpl._move(org.jboss.cache.Fqn, org.jboss.cache.Fqn)
protected  Object handlePutDataEraseMethod(InvocationContext ctx, GlobalTransaction gt, Fqn fqn, Map newData, boolean createUndoOps, boolean eraseContents)
          Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, java.util.Map, boolean, boolean)
protected  Object handlePutDataEraseVersionedMethod(InvocationContext ctx, GlobalTransaction gtx, Fqn fqn, Map data, boolean createUndoOps, boolean eraseContent, DataVersion dv)
          Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, java.util.Map, boolean, boolean, org.jboss.cache.optimistic.DataVersion)
protected  Object handlePutDataMethod(InvocationContext ctx, GlobalTransaction tx, Fqn fqn, Map data, boolean createUndoOps)
          Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, String, java.util.Map, boolean)
protected  Object handlePutDataVersionedMethod(InvocationContext ctx, GlobalTransaction globalTransaction, Fqn fqn, Map map, Boolean createUndoOps, DataVersion dataVersion)
          Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, java.util.Map, boolean, org.jboss.cache.optimistic.DataVersion)
protected  Object handlePutForExternalReadMethod(InvocationContext ctx, GlobalTransaction tx, Fqn fqn, Object key, Object value)
          Handles CacheImpl._putForExternalRead(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, Object, Object)
protected  Object handlePutForExternalReadVersionedMethod(InvocationContext ctx, GlobalTransaction gtx, Fqn fqn, Object key, Object value, DataVersion dv)
          Handles CacheImpl._putForExternalRead(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, Object, Object, org.jboss.cache.optimistic.DataVersion)
protected  Object handlePutKeyValueMethod(InvocationContext ctx, GlobalTransaction gtx, Fqn fqn, Object key, Object value, boolean createUndoOps)
          Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, String, Object, Object, boolean)
protected  Object handlePutKeyValueVersionedMethod(InvocationContext ctx, GlobalTransaction gtx, Fqn fqn, Object key, Object value, boolean createUndoOps, DataVersion dv)
          Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, Object, Object, boolean, org.jboss.cache.optimistic.DataVersion)
 
Methods inherited from class org.jboss.cache.interceptors.OptimisticInterceptor
getGlobalTransaction, getTransactionWorkspace, greedyGetFqns, lockAndCreateWorkspaceNode, undeleteWorkspaceNode, undeleteWorkspaceNode
 
Methods inherited from class org.jboss.cache.interceptors.MethodDispacherInterceptor
handleAddChildMethod, handleBlockChannelMethod, handleCommitMethod, handleDataGravitationCleanupMethod, handleEvictMethod, handleEvictVersionedNodeMethod, handleExistsMethod, handleGetDataMapMethod, handleGetChildrenNamesMethod, handleGetKeysMethod, handleGetKeyValueMethod, handleGetNodeMethod, handleLockMethod, handleOptimisticPrepareMethod, handlePrepareMethod, handlePrintMethod, handleReleaseAllLocksMethod, handleRemoveDataMethod, handleRemoveDataVersionedMethod, handleRemoveKeyMethod, handleRemoveKeyVersionedMethod, handleRemoveNodeMethod, handleRemoveNodeVersionedMethod, handleRollbackMethod, handleUnblockChannelMethod, invoke, skipMethodCall
 
Methods inherited from class org.jboss.cache.interceptors.Interceptor
assertTransactionValid, dumpStatistics, getLast, getNext, getStatisticsEnabled, initLogger, isActive, isPreparing, isValid, nextInterceptor, peekNode, resetStatistics, setCache, setLast, setNext, setStatisticsEnabled, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptimisticCreateIfNotExistsInterceptor

public OptimisticCreateIfNotExistsInterceptor()
Method Detail

handlePutDataMethod

protected Object handlePutDataMethod(InvocationContext ctx,
                                     GlobalTransaction tx,
                                     Fqn fqn,
                                     Map data,
                                     boolean createUndoOps)
                              throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, String, java.util.Map, boolean)

Overrides:
handlePutDataMethod in class MethodDispacherInterceptor
Throws:
Throwable

handlePutDataEraseVersionedMethod

protected Object handlePutDataEraseVersionedMethod(InvocationContext ctx,
                                                   GlobalTransaction gtx,
                                                   Fqn fqn,
                                                   Map data,
                                                   boolean createUndoOps,
                                                   boolean eraseContent,
                                                   DataVersion dv)
                                            throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, java.util.Map, boolean, boolean, org.jboss.cache.optimistic.DataVersion)

Overrides:
handlePutDataEraseVersionedMethod in class MethodDispacherInterceptor
Throws:
Throwable

handlePutKeyValueMethod

protected Object handlePutKeyValueMethod(InvocationContext ctx,
                                         GlobalTransaction gtx,
                                         Fqn fqn,
                                         Object key,
                                         Object value,
                                         boolean createUndoOps)
                                  throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, String, Object, Object, boolean)

Overrides:
handlePutKeyValueMethod in class MethodDispacherInterceptor
Throws:
Throwable

handlePutDataEraseMethod

protected Object handlePutDataEraseMethod(InvocationContext ctx,
                                          GlobalTransaction gt,
                                          Fqn fqn,
                                          Map newData,
                                          boolean createUndoOps,
                                          boolean eraseContents)
                                   throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, java.util.Map, boolean, boolean)

Overrides:
handlePutDataEraseMethod in class MethodDispacherInterceptor
Throws:
Throwable

handlePutDataVersionedMethod

protected Object handlePutDataVersionedMethod(InvocationContext ctx,
                                              GlobalTransaction globalTransaction,
                                              Fqn fqn,
                                              Map map,
                                              Boolean createUndoOps,
                                              DataVersion dataVersion)
                                       throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, java.util.Map, boolean, org.jboss.cache.optimistic.DataVersion)

Overrides:
handlePutDataVersionedMethod in class MethodDispacherInterceptor
Throws:
Throwable

handlePutKeyValueVersionedMethod

protected Object handlePutKeyValueVersionedMethod(InvocationContext ctx,
                                                  GlobalTransaction gtx,
                                                  Fqn fqn,
                                                  Object key,
                                                  Object value,
                                                  boolean createUndoOps,
                                                  DataVersion dv)
                                           throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._put(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, Object, Object, boolean, org.jboss.cache.optimistic.DataVersion)

Overrides:
handlePutKeyValueVersionedMethod in class MethodDispacherInterceptor
Throws:
Throwable

handlePutForExternalReadMethod

protected Object handlePutForExternalReadMethod(InvocationContext ctx,
                                                GlobalTransaction tx,
                                                Fqn fqn,
                                                Object key,
                                                Object value)
                                         throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._putForExternalRead(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, Object, Object)

Overrides:
handlePutForExternalReadMethod in class MethodDispacherInterceptor
Throws:
Throwable

handlePutForExternalReadVersionedMethod

protected Object handlePutForExternalReadVersionedMethod(InvocationContext ctx,
                                                         GlobalTransaction gtx,
                                                         Fqn fqn,
                                                         Object key,
                                                         Object value,
                                                         DataVersion dv)
                                                  throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._putForExternalRead(org.jboss.cache.transaction.GlobalTransaction, org.jboss.cache.Fqn, Object, Object, org.jboss.cache.optimistic.DataVersion)

Overrides:
handlePutForExternalReadVersionedMethod in class MethodDispacherInterceptor
Throws:
Throwable

handleMoveMethod

protected Object handleMoveMethod(InvocationContext ctx,
                                  Fqn from,
                                  Fqn to)
                           throws Throwable
Description copied from class: MethodDispacherInterceptor
Handles CacheImpl._move(org.jboss.cache.Fqn, org.jboss.cache.Fqn)

Overrides:
handleMoveMethod in class MethodDispacherInterceptor
Throws:
Throwable


Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.