|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjgroup.test.jini.txn.NonReplicatedBankServer2
public class NonReplicatedBankServer2
Bank server without replication support used as participant in a transaction.
Nested Class Summary | |
---|---|
class |
NonReplicatedBankServer2.CreditDebit
Class that holds a temporary credit/debit operation, before doing a commit/abort operation. |
Field Summary |
---|
Fields inherited from interface net.jini.core.transaction.server.TransactionConstants |
---|
ABORTED, ACTIVE, COMMITTED, NOTCHANGED, PREPARED, VOTING |
Constructor Summary | |
---|---|
NonReplicatedBankServer2(java.lang.String[] configArgs,
com.sun.jini.start.LifeCycle lifeCycle)
Constructor compatible with the jini service starter. |
Method Summary | |
---|---|
void |
abort(net.jini.core.transaction.server.TransactionManager mgr,
long id)
|
void |
commit(net.jini.core.transaction.server.TransactionManager mgr,
long id)
|
void |
deposit(long accountNumber,
int amount,
long transactionID)
Do a deposit operation on given account. |
java.lang.Integer |
getBalance(long accNumber)
Get balance of an account. |
java.lang.String |
getName()
Get the name of a bank service. |
int |
prepare(net.jini.core.transaction.server.TransactionManager mgr,
long id)
|
int |
prepareAndCommit(net.jini.core.transaction.server.TransactionManager mgr,
long id)
|
void |
serviceIDNotify(net.jini.core.lookup.ServiceID serviceID)
|
void |
withdraw(long accountNumber,
int amount,
long transactionID)
Do a withdraw operation on given account. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NonReplicatedBankServer2(java.lang.String[] configArgs, com.sun.jini.start.LifeCycle lifeCycle) throws java.lang.Exception
configArgs
- String
array whose elements are
the arguments to use when creating the server.lifeCycle
- instance of LifeCycle
that, if
non-null
, will cause this object's
unregister
method to be invoked during
shutdown to notify the service starter framework that
the reference to this service's implementation can be
'released' for garbage collection. A value of
null
for this argument is allowed.
java.lang.Exception
- If there was a problem initializing the service.Method Detail |
---|
public java.lang.Integer getBalance(long accNumber) throws java.rmi.RemoteException
Bank
getBalance
in interface Bank
accNumber
- Account number
java.rmi.RemoteException
public void withdraw(long accountNumber, int amount, long transactionID) throws java.rmi.RemoteException
Bank
withdraw
in interface Bank
accountNumber
- The account number to useamount
- The amount to withdrawtransactionID
- The transaction id to use
java.rmi.RemoteException
public void deposit(long accountNumber, int amount, long transactionID) throws java.rmi.RemoteException
Bank
deposit
in interface Bank
accountNumber
- The account number to useamount
- The amount to deposit
java.rmi.RemoteException
public java.lang.String getName() throws java.rmi.RemoteException
Bank
getName
in interface Bank
java.rmi.RemoteException
public int prepare(net.jini.core.transaction.server.TransactionManager mgr, long id) throws net.jini.core.transaction.UnknownTransactionException, java.rmi.RemoteException
prepare
in interface net.jini.core.transaction.server.TransactionParticipant
net.jini.core.transaction.UnknownTransactionException
java.rmi.RemoteException
public void commit(net.jini.core.transaction.server.TransactionManager mgr, long id) throws net.jini.core.transaction.UnknownTransactionException, java.rmi.RemoteException
commit
in interface net.jini.core.transaction.server.TransactionParticipant
net.jini.core.transaction.UnknownTransactionException
java.rmi.RemoteException
public void abort(net.jini.core.transaction.server.TransactionManager mgr, long id) throws net.jini.core.transaction.UnknownTransactionException, java.rmi.RemoteException
abort
in interface net.jini.core.transaction.server.TransactionParticipant
net.jini.core.transaction.UnknownTransactionException
java.rmi.RemoteException
public int prepareAndCommit(net.jini.core.transaction.server.TransactionManager mgr, long id) throws net.jini.core.transaction.UnknownTransactionException, java.rmi.RemoteException
prepareAndCommit
in interface net.jini.core.transaction.server.TransactionParticipant
net.jini.core.transaction.UnknownTransactionException
java.rmi.RemoteException
public void serviceIDNotify(net.jini.core.lookup.ServiceID serviceID)
serviceIDNotify
in interface net.jini.lookup.ServiceIDListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |