Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.atomikos.icatch.trmi
Class TrmiTransactionManager

    java.lang.Object
      com.atomikos.icatch.imp.BaseTransactionManager
          com.atomikos.icatch.trmi.TrmiTransactionManager

All Implemented Interfaces:
  CompositeTransactionManager, ExportingTransactionManager, ImportingTransactionManager, SubTxAwareParticipant, CompositeTransactionServer, ParticipantServer, RecoveryServer, Serializable, Remote

    public final class TrmiTransactionManager

extends BaseTransactionManager
implements CompositeTransactionServer, ParticipantServer, RecoveryServer, Remote, ImportingTransactionManager, ExportingTransactionManager

Copyright © 2001-2004, Atomikos. All rights reserved. A transaction manager implementation for RMI-based composite systems.

See Also:
  Serialized Form

Constructor Summary
`TrmiTransactionManager(boolean trustClientTM, StateRecoveryManager srecmgr, String jndiName, Console console, String outputDirPath, long maxTimeout, int maxActives, boolean threaded2PC)` Create a new instance that listens on the given name.

Method Summary
`void` | `addExtent(Extent extent)` Called after call returns successfully: add the extent of the call to the current tx.
`com.atomikos.icatch.trmi.RecoveryCoordinatorProxy` | `addParticipant(Participant participantproxy, String txid)` Add a new participant to the transaction of the given tid.
`void` | `addSubTxAwareParticipant(SubTxAwareParticipant subtxaware, String txid)` Add a subtx aware participant to the given tx.
`HeuristicMessage[]` | `commit(String root)` Commit the participant of the given root, after prepare was sent.
`HeuristicMessage[]` | `commitOnePhase(String root, int siblings, Dictionary cascadeList)` Perform one-phase commit for the given root.
`protected CompositeTransaction` | `createProxy(CompositeTransaction current)`
`boolean` | `equals(Object o)`
`void` | `forget(String root)` Forget all about a given root.
`Propagation` | `getPropagation()` Get the propagation info of the tx for the calling thread.
`int` | `hashCode()`
`CompositeTransaction` | `importTransaction(Propagation propagation, boolean orphancheck, boolean heur_commit)` Notify TM of incoming request with given propagation.
`void` | `init(Properties properties)` Should be called as first method, to initialize the internal state.
`int` | `prepare(String root, int siblings, Dictionary cascadelist)` Prepare the participant of the given root.
`Boolean` | `replayCompletion(String root, Participant participant)` Replay completion for given root, on given participant.
`HeuristicMessage[]` | `rollback(String root)` Rollback the participant for the given root.
`void` | `shutdown(boolean force)` Shuts down the server.
`Extent` | `terminated(boolean commit)` Termination callback for current tx.

Methods inherited from class com.atomikos.icatch.imp.BaseTransactionManager
`committed, createCompositeTransaction, getCompositeTransaction, getCompositeTransaction, getParticipant, init, printMsg, recreateCompositeTransaction, resume, rolledback, startlistening, suspend`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TrmiTransactionManager

    public TrmiTransactionManager(boolean trustClientTM,
                                  StateRecoveryManager srecmgr,
                                  String jndiName,
                                  Console console,
                                  String outputDirPath,
                                  long maxTimeout,
                                  int maxActives,
                                  boolean threaded2PC)
                           throws UnknownHostException

  Create a new instance that listens on the given name.

  Parameters:
    `trustClientTM` - If true, then a forget() on behalf of a remote client TM will be executed. This means that problem cases of 2PC will disappear from the log, and should be used with great care! The advantage of this is less administration on intranet clusters.
    `srecmgr` - The state recovery manager to use.
    `jndiName` - The unique jndi name to listen on. Max BYTE length is 64!
    `console` - For messages from system.
    `outputDirPath` - The output directory path (including ending slash) where the server can write its files.
    `maxTimeout` - The max timeout for new or imported txs.
    `maxActives` - The max no of active txs, or negative if no such number.
    `threaded2PC` - Whether commit should be multi-threaded or not.
  Throws:
    `UnknownHostException` - If local hostIP can not be found.

Method Detail

### init

    public void init(Properties properties)
              throws SysException

  Should be called as first method, to initialize the internal state. This method first exports the object to RMI. Then a binding is done into JNDI.

  Parameters:
    `properties` - The properties.
  Throws:
    `SysException`

### createProxy

    protected CompositeTransaction createProxy(CompositeTransaction current)
                                        throws SysException

  Throws:
    `SysException`

### addExtent

    public void addExtent(Extent extent)
                   throws SysException,
                          RollbackException

  Description copied from interface: `ExportingTransactionManager`
  Called after call returns successfully: add the extent of the call to the current tx. If a remote call has failed, this method should NOT be called.

  Specified by:
    `addExtent` in interface `ExportingTransactionManager`
  Parameters:
    `extent` - The extent of the call.
  Throws:
    `SysException` - On failure.
    `RollbackException` - If the current transaction has already rolled back.
  See Also:
    `ExportingTransactionManager`

### terminated

    public Extent terminated(boolean commit)
                      throws SysException,
                             RollbackException

  Description copied from interface: `ImportingTransactionManager`
  Termination callback for current tx. Called by comm layer right before a remote call returns.

  Specified by:
    `terminated` in interface `ImportingTransactionManager`
  Parameters:
    `commit` - True iff the invocation had no errors. Implies that the local subtx is committed.
  Returns:
    Extent The extent to return to remote client.
  Throws:
    `SysException` - Unexpected error.
    `RollbackException` - If the transaction has timed out.
  See Also:
    `ImportingTransactionManager`

### prepare

    public int prepare(String root,
                       int siblings,
                       Dictionary cascadelist)
                throws RollbackException,
                       HeurHazardException,
                       HeurMixedException,
                       SysException,
                       RemoteException

  Description copied from interface: `ParticipantServer`
  Prepare the participant of the given root.

  Specified by:
    `prepare` in interface `ParticipantServer`
  Parameters:
    `root` - The root String of the participant.
    `siblings` - The count of siblings for the given participant.
    `cascadelist` - The list of participants to cascade to, if any.
  Throws:
    `RollbackException`
    `HeurHazardException`
    `HeurMixedException`
    `SysException`
    `RemoteException`
  See Also:
    `ParticipantServer.`

### commit

    public HeuristicMessage[] commit(String root)
                              throws HeurRollbackException,
                                     HeurHazardException,
                                     HeurMixedException,
                                     RollbackException,
                                     SysException,
                                     RemoteException

  Description copied from interface: `ParticipantServer`
  Commit the participant of the given root, after prepare was sent.

  Specified by:
    `commit` in interface `ParticipantServer`
  Parameters:
    `root` - The String of the given root.
  Throws:
    `HeurRollbackException`
    `HeurHazardException`
    `HeurMixedException`
    `RollbackException`
    `SysException`
    `RemoteException`
  See Also:
    `ParticipantServer.`

### commitOnePhase

    public HeuristicMessage[] commitOnePhase(String root,
                                             int siblings,
                                             Dictionary cascadeList)
                                      throws HeurRollbackException,
                                             HeurHazardException,
                                             HeurMixedException,
                                             RollbackException,
                                             SysException,
                                             RemoteException

  Description copied from interface: `ParticipantServer`
  Perform one-phase commit for the given root.

  Specified by:
    `commitOnePhase` in interface `ParticipantServer`
  Parameters:
    `root` - The root id.
    `siblings` - The count of siblings for the given participant.
    `cascadeList` - The info needed for orphan detection.
  Throws:
    `HeurRollbackException`
    `HeurHazardException`
    `HeurMixedException`
    `RollbackException`
    `SysException`
    `RemoteException`
  See Also:
    `ParticipantServer.`

### rollback

    public HeuristicMessage[] rollback(String root)
                                throws HeurCommitException,
                                       HeurMixedException,
                                       HeurHazardException,
                                       SysException,
                                       RemoteException

  Description copied from interface: `ParticipantServer`
  Rollback the participant for the given root.

  Specified by:
    `rollback` in interface `ParticipantServer`
  Parameters:
    `root` - The given root.
  Throws:
    `HeurCommitException`
    `HeurMixedException`
    `HeurHazardException`
    `SysException`
    `RemoteException`
  See Also:
    `ParticipantServer`

### forget

    public void forget(String root)
                throws SysException,
                       RemoteException

  Description copied from interface: `ParticipantServer`
  Forget all about a given root.

  Specified by:
    `forget` in interface `ParticipantServer`
  Parameters:
    `root` - The root to forget about.
  Throws:
    `SysException`
    `RemoteException`
  See Also:
    `ParticipantServer.`

### equals

    public boolean equals(Object o)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### addSubTxAwareParticipant

    public void addSubTxAwareParticipant(SubTxAwareParticipant subtxaware,
                                         String txid)
                                  throws SysException,
                                         IllegalStateException,
                                         RemoteException

  Description copied from interface: `CompositeTransactionServer`
  Add a subtx aware participant to the given tx.

  Specified by:
    `addSubTxAwareParticipant` in interface `CompositeTransactionServer`
  Parameters:
    `subtxaware` - The participant to add, will be notified on end().
    `txid` - The ID of the transaction to which the participant must be added.
  Throws:
    `SysException` - Unexpected error.
    `IllegalStateException` - If txid is no longer an active tx.
    `RemoteException`
  See Also:
    `CompositeTransactionServer`

### addParticipant

    public com.atomikos.icatch.trmi.RecoveryCoordinatorProxy addParticipant(Participant participantproxy,
                                                                            String txid)
                                                                     throws SysException,
                                                                            IllegalStateException,
                                                                            RemoteException

  Description copied from interface: `CompositeTransactionServer`
  Add a new participant to the transaction of the given tid.

  Specified by:
    `addParticipant` in interface `CompositeTransactionServer`
  Returns:
    RecoveryCoordinatorProxy Whom to ask for indoubt timeout resolution.
  Throws:
    `SysException` - Unexpected.
    `IllegalStateException` - Illegal state.
    `RemoteException`

### replayCompletion

    public Boolean replayCompletion(String root,
                                    Participant participant)
                             throws RemoteException,
                                    SysException

  Description copied from interface: `RecoveryServer`
  Replay completion for given root, on given participant.

  Specified by:
    `replayCompletion` in interface `RecoveryServer`
  Parameters:
    `root` - The root.
    `participant` - The participant.
  Throws:
    `RemoteException` - On remote failure.
    `SysException`

### shutdown

    public void shutdown(boolean force)
                  throws SysException,
                         IllegalStateException

  Shuts down the server.

  Overrides:
    `shutdown` in class `BaseTransactionManager`
  Parameters:
    `force` - If true, possibly indoubt txs will not be taken into account.
  Throws:
    `SysException` - On failure.
    `IllegalStateException` - If active txs and not force.

### importTransaction

    public CompositeTransaction importTransaction(Propagation propagation,
                                                  boolean orphancheck,
                                                  boolean heur_commit)
                                           throws SysException

  Description copied from interface: `ImportingTransactionManager`
  Notify TM of incoming request with given propagation. Makes the TM start a tx and associate it with calling thread.

  Specified by:
    `importTransaction` in interface `ImportingTransactionManager`
  Parameters:
    `propagation` - The ancestor information.
    `orphancheck` - True iff orphans are to be checked.
    `heur_commit` - True iff heuristic means commit.
  Returns:
    CompositeTransaction The local tx instance.
  Throws:
    `SysException`

### getPropagation

    public Propagation getPropagation()
                               throws SysException,
                                      RollbackException

  Description copied from interface: `ExportingTransactionManager`
  Get the propagation info of the tx for the calling thread. Called before doing the remote call.

  Specified by:
    `getPropagation` in interface `ExportingTransactionManager`
  Returns:
    Propagation The propagation for the current thread.
  Throws:
    `SysException` - If no tx for current thread.
    `RollbackException` - If the current transaction has already rolled back.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012. All Rights Reserved.