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

## net.jini.core.transaction.server
Class NestableServerTransaction

    java.lang.Object
      net.jini.core.transaction.server.ServerTransaction
          net.jini.core.transaction.server.NestableServerTransaction

All Implemented Interfaces:
  NestableTransaction, Serializable, Transaction

public class NestableServerTransaction
extends ServerTransaction
implements NestableTransaction

Class implementing the `NestableTransaction` interface, for use with transaction participants that implement the default transaction semantics.

Since:
  1.0
See Also:
  `NestableTransaction`, `NestableTransactionManager`, `TransactionFactory`, Serialized Form

Nested Class Summary

Nested classes inherited from class net.jini.core.transaction.NestableTransaction
`NestableTransaction.Created`

Field Summary
`NestableServerTransaction` | `parent` The parent transaction, if any.

Fields inherited from class net.jini.core.transaction.server.ServerTransaction
`id, mgr`

Constructor Summary
`NestableServerTransaction(NestableTransactionManager mgr, long id, NestableServerTransaction parent)` Simple constructor.

Method Summary
`NestableTransaction.Created` | `create(long leaseTime)` Create a new nested transaction, with the current transaction as parent, managed by the same transaction manager as the current transaction.
`NestableTransaction.Created` | `create(NestableTransactionManager mgr, long leaseTime)` Create a new nested transaction, with the current transaction as parent, managed by the given transaction manager.
`boolean` | `enclosedBy(NestableTransaction enclosing)` Return true if the specified transaction is an ancestor of this transaction.
`boolean` | `isNested()` Return true if the transaction has a parent, false if the transaction is top level.
`void` | `promote(TransactionParticipant[] parts, long[] crashCounts, TransactionParticipant drop)` Promote the listed participants (from a subtransaction) into this (the parent) transaction.

Methods inherited from class net.jini.core.transaction.server.ServerTransaction
`abort, abort, commit, commit, equals, getState, hashCode, join, toString`

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

Methods inherited from interface net.jini.core.transaction.Transaction
`abort, abort, commit, commit`

Field Detail

### parent

    public final NestableServerTransaction parent

  The parent transaction, if any.

Constructor Detail

### NestableServerTransaction

    public NestableServerTransaction(NestableTransactionManager mgr,
                                     long id,
                                     NestableServerTransaction parent)

  Simple constructor. Clients should not call this directly, but should instead use `TransactionFactory` and `NestableTransaction` methods.

Parameters:
  `mgr` - the manager for this transaction
  `id` - the transaction id
  `parent` - the parent transaction, if any

Method Detail

### create

    public NestableTransaction.Created create(NestableTransactionManager mgr,
                                              long leaseTime)
                                       throws UnknownTransactionException,
                                              CannotJoinException,
                                              LeaseDeniedException,
                                              RemoteException

  Description copied from interface: `NestableTransaction`
  Create a new nested transaction, with the current transaction as parent, managed by the given transaction manager.

  Specified by:
    `create` in interface `NestableTransaction`
  Parameters:
    `mgr` - the transaction manager to use for this transaction
    `leaseTime` - the requested lease time for the transaction
  Returns:
    the created transaction and the lease granted
  Throws:
    `RemoteException` - if there is a communication error
    `LeaseDeniedException` - if this manager is unwilling to grant the requested lease time
    `CannotJoinException` - if the parent transaction is known to the manager but is no longer active.
    `UnknownTransactionException` - if the parent transaction is unknown to the parent transaction manager, either because the transaction ID is incorrect or because the transaction is no longer active and its state has been discarded by the manager.

### create

    public NestableTransaction.Created create(long leaseTime)
                                       throws UnknownTransactionException,
                                              CannotJoinException,
                                              LeaseDeniedException,
                                              RemoteException

  Description copied from interface: `NestableTransaction`
  Create a new nested transaction, with the current transaction as parent, managed by the same transaction manager as the current transaction.

  Specified by:
    `create` in interface `NestableTransaction`
  Parameters:
    `leaseTime` - the requested lease time for the transaction
  Returns:
    the created transaction and the lease granted
  Throws:
    `CannotJoinException` - if the parent transaction is known to the manager but is no longer active.
    `UnknownTransactionException` - if the parent transaction is unknown to the parent transaction manager, either because the transaction ID is incorrect or because the transaction is no longer active and its state has been discarded by the manager.
    `LeaseDeniedException` - if this manager is unwilling to grant the requested lease time
    `RemoteException` - if there is a communication error

### promote

    public void promote(TransactionParticipant[] parts,
                        long[] crashCounts,
                        TransactionParticipant drop)
                 throws UnknownTransactionException,
                        CannotJoinException,
                        CrashCountException,
                        RemoteException

  Promote the listed participants (from a subtransaction) into this (the parent) transaction. This method is for use by the manager of a subtransaction when the subtransaction commits. At this point, all participants of the subtransaction must become participants in the parent transaction. Prior to this point, the subtransaction's manager was a participant of the parent transaction, but after a successful promotion it need no longer be one (if it was not itself a participant of the subtransaction), and so it may specify itself as a participant to drop from the transaction. Otherwise, participants should not be dropped out of transactions. For each promoted participant, the participant's crash count is stored in the corresponding element of the `crashCounts` array.

  Parameters:
    `parts` - the participants being promoted to the parent
    `crashCounts` - the crash counts of the participants
    `drop` - the manager to drop out, if any
  Throws:
    `CrashCountException` - if the crash count provided for at least one participant differs from the crash count in a previous invocation of the same pairing of participant and transaction
    `UnknownTransactionException` - if a transaction is unknown to the transaction manager, either because the transaction ID is incorrect or because the transaction is complete and its state has been discarded by the manager.
    `CannotJoinException` - if a transaction is known to the manager but is no longer active.
    `RemoteException` - if there is a communication error
  See Also:
    `NestableTransactionManager.promote(long, net.jini.core.transaction.server.TransactionParticipant[], long[], net.jini.core.transaction.server.TransactionParticipant)`

### enclosedBy

    public boolean enclosedBy(NestableTransaction enclosing)

  Return true if the specified transaction is an ancestor of this transaction.

  Parameters:
    `enclosing` - transaction to test for being an ancestor
  Returns:
    true if the specified transaction is an ancestor of this transaction.

### isNested

    public boolean isNested()

  Description copied from class: `ServerTransaction`
  Return true if the transaction has a parent, false if the transaction is top level.

  Overrides:
    `isNested` in class `ServerTransaction`
  Returns:
    true if the transaction has a parent, false if the transaction is top level.

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 © 2004 Sun Microsystems, Inc. All rights reserved