org.apache.ignite.internal.processors.cache.transactions

## Class IgniteTxHandler<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.transactions.IgniteTxHandler<K,V>

    public class IgniteTxHandler<K,V>
    extends Object

Isolated logic to process cache messages.

### Constructor Summary

Constructors
Constructor and Description
`IgniteTxHandler(GridCacheSharedContext<K,V> ctx)`

### Method Summary

Methods
`protected void` `finish(UUID nodeId, GridDistributedTxRemoteAdapter<K,V> tx, GridDhtTxPrepareRequest<K,V> req)`
`IgniteInternalFuture<IgniteInternalTx>` `finish(UUID nodeId, GridNearTxLocal<K,V> locTx, GridNearTxFinishRequest<K,V> req)`
`protected void` `finish(UUID nodeId, IgniteTxRemoteEx<K,V> tx, GridDhtTxFinishRequest<K,V> req)`
`IgniteInternalFuture<IgniteInternalTx>` `finishColocatedLocal(boolean commit, GridNearTxLocal<K,V> tx)`
`IgniteInternalFuture<IgniteInternalTx<K,V>>` `prepareTx(UUID nearNodeId, GridNearTxLocal<K,V> locTx, GridNearTxPrepareRequest<K,V> req, IgniteInClosure<GridNearTxPrepareResponse<K,V>> completeCb)`
`protected void` `processCheckPreparedTxRequest(UUID nodeId, GridCacheOptimisticCheckPreparedTxRequest<K,V> req)`
`protected void` `processCheckPreparedTxResponse(UUID nodeId, GridCacheOptimisticCheckPreparedTxResponse<K,V> res)`
`protected void` `processDhtTxFinishRequest(UUID nodeId, GridDhtTxFinishRequest<K,V> req)`
`protected void` `processDhtTxPrepareRequest(UUID nodeId, GridDhtTxPrepareRequest<K,V> req)`
`IgniteInternalFuture<IgniteInternalTx>` `processNearTxFinishRequest(UUID nodeId, GridNearTxFinishRequest<K,V> req)`
`IgniteInternalFuture<IgniteInternalTx<K,V>>` `processNearTxPrepareRequest(UUID nearNodeId, GridNearTxPrepareRequest<K,V> req)`
`protected void` `sendReply(UUID nodeId, GridDhtTxFinishRequest<K,V> req)` Sends tx finish response to remote node, if response is requested.
`GridNearTxRemote<K,V>` `startNearRemoteTx(ClassLoader ldr, UUID nodeId, GridDhtTxPrepareRequest<K,V> req)` Called while processing dht tx prepare request.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### IgniteTxHandler

    public IgniteTxHandler(GridCacheSharedContext<K,V> ctx)

Parameters:
  `ctx` - Shared cache context.

### Method Detail

#### processNearTxPrepareRequest

    public IgniteInternalFuture<IgniteInternalTx<K,V>> processNearTxPrepareRequest(UUID nearNodeId,
                                                                          GridNearTxPrepareRequest<K,V> req)

#### prepareTx

    public IgniteInternalFuture<IgniteInternalTx<K,V>> prepareTx(UUID nearNodeId,
                                                        @Nullable
                                                        GridNearTxLocal<K,V> locTx,
                                                        GridNearTxPrepareRequest<K,V> req,
                                                        @Nullable
                                                        IgniteInClosure<GridNearTxPrepareResponse<K,V>> completeCb)

Parameters:
  `nearNodeId` - Near node ID that initiated transaction.
  `locTx` - Optional local transaction.
  `req` - Near prepare request.
Returns:
  Future for transaction.

#### processNearTxFinishRequest

    @Nullable
    public IgniteInternalFuture<IgniteInternalTx> processNearTxFinishRequest(UUID nodeId,
                                                                             GridNearTxFinishRequest<K,V> req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.
Returns:
  Future.

#### finish

    @Nullable
    public IgniteInternalFuture<IgniteInternalTx> finish(UUID nodeId,
                                                         @Nullable
                                                         GridNearTxLocal<K,V> locTx,
                                                         GridNearTxFinishRequest<K,V> req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.
Returns:
  Future.

#### finishColocatedLocal

    public IgniteInternalFuture<IgniteInternalTx> finishColocatedLocal(boolean commit,
                                                              GridNearTxLocal<K,V> tx)

Parameters:
  `commit` - Commit flag (rollback if `false`).
  `tx` - Transaction to commit.
Returns:
  Future.

#### processDhtTxPrepareRequest

    protected final void processDhtTxPrepareRequest(UUID nodeId,
                                  GridDhtTxPrepareRequest<K,V> req)

Parameters:
  `nodeId` - Sender node ID.
  `req` - Request.

#### processDhtTxFinishRequest

    protected final void processDhtTxFinishRequest(UUID nodeId,
                                 GridDhtTxFinishRequest<K,V> req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.

#### finish

    protected void finish(UUID nodeId,
              IgniteTxRemoteEx<K,V> tx,
              GridDhtTxFinishRequest<K,V> req)

Parameters:
  `nodeId` - Node ID.
  `tx` - Transaction.
  `req` - Request.

#### finish

    protected void finish(UUID nodeId,
              GridDistributedTxRemoteAdapter<K,V> tx,
              GridDhtTxPrepareRequest<K,V> req)
                   throws IgniteTxHeuristicCheckedException

Parameters:
  `nodeId` - Node ID.
  `tx` - Transaction.
  `req` - Request.
Throws:
  `IgniteTxHeuristicCheckedException`

#### sendReply

    protected void sendReply(UUID nodeId,
                 GridDhtTxFinishRequest<K,V> req)

Sends tx finish response to remote node, if response is requested.

Parameters:
  `nodeId` - Node id that originated finish request.
  `req` - Request.

#### startNearRemoteTx

    @Nullable
    public GridNearTxRemote<K,V> startNearRemoteTx(ClassLoader ldr,
                                                   UUID nodeId,
                                                   GridDhtTxPrepareRequest<K,V> req)
                                            throws IgniteCheckedException

Called while processing dht tx prepare request.

Parameters:
  `ldr` - Loader.
  `nodeId` - Sender node ID.
  `req` - Request.
Returns:
  Remote transaction.
Throws:
  `IgniteCheckedException` - If failed.

#### processCheckPreparedTxRequest

    protected void processCheckPreparedTxRequest(UUID nodeId,
                                     GridCacheOptimisticCheckPreparedTxRequest<K,V> req)

Parameters:
  `nodeId` - Node ID.
  `req` - Request.

#### processCheckPreparedTxResponse

    protected void processCheckPreparedTxResponse(UUID nodeId,
                                      GridCacheOptimisticCheckPreparedTxResponse<K,V> res)

Parameters:
  `nodeId` - Node ID.
  `res` - Response.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015