All Packages Class Hierarchy This Package Previous Next Index
Interface JavaTransaction.ResourceManager
- public interface ResourceManager
- extends Remote
Distributed Transaction System in Java.
Class: ResourceManager
Description: necessary ResourceManager interface.
-
abort(int)
- Abort transaction.
-
addCars(int, String, int, int)
- Addition and deletion of cars.
-
addFlight(int, int, int, int)
- Add seats to a flight.
-
addRooms(int, String, int, int)
- Add rooms to a location.
-
commit(int)
- Commit transaction.
-
deleteCars(int, String, int)
-
-
deleteCustomer(int)
-
-
deleteFlight(int, int)
- Delete the entire flight.
-
deleteRooms(int, String, int)
- Delete Rooms from a location.
-
newCustomer()
-
-
queryCars(int, String)
-
-
queryCarsPrice(int, String)
-
-
queryCustomerInfo(int)
-
-
queryFlight(int, int)
-
-
queryFlightPrice(int, int)
-
-
queryRooms(int, String)
-
-
queryRoomsPrice(int, String)
-
-
reserveCar(int, int, String)
-
-
reserveFlight(int, int, int)
-
-
reserveRoom(int, int, String)
-
-
selfDestruct(int)
- Call exit after a specified number of disk writes.
-
shutdown()
- Shutdown gracefully.
-
start()
- Start transaction.
start
public abstract int start() throws RemoteException
- Start transaction.
Returns: a unique transaction ID.
commit
public abstract boolean commit(int transactionId) throws RemoteException
- Commit transaction.
Returns: success.
abort
public abstract void abort(int transactionId) throws RemoteException
- Abort transaction.
Returns: nothing, but this may change.
addFlight
public abstract boolean addFlight(int Xid,
int flightNum,
int flightPrice,
int flightSeats) throws RemoteException
- Add seats to a flight. In general this will be used to create a new
flight, but it should be possible to add seats to an existing flight.
Adding to an existing flight should overwrite the current price of the
available seats.
Returns: success.
deleteFlight
public abstract boolean deleteFlight(int Xid,
int flightNum) throws RemoteException
- Delete the entire flight.
deleteflight implies whole deletion of the flight.
all seats, all reservations. It's undecided what will happen
if a customer has a reservation on this flight, but one possibility
is to delete the customer as well. The other possibility is to
return failure.
Returns: success.
addRooms
public abstract boolean addRooms(int Xid,
String location,
int numRooms,
int price) throws RemoteException
- Add rooms to a location.
This should look a lot like addFlight, only keyed on a string location
instead of a flight number.
deleteRooms
public abstract boolean deleteRooms(int Xid,
String location,
int numRooms) throws RemoteException
- Delete Rooms from a location.
This subtracts from the available room count without allocating the
rooms to a customer. It should fail if it would make the count of
available rooms negative.
Returns: success
addCars
public abstract boolean addCars(int Xid,
String location,
int numCars,
int price) throws RemoteException
- Addition and deletion of cars.
Cars have the same semantics as hotels.
deleteCars
public abstract boolean deleteCars(int Xid,
String location,
int numCars) throws RemoteException
shutdown
public abstract boolean shutdown() throws RemoteException
- Shutdown gracefully.
When this RM restarts, it should not attempt to recover its state if
the client called shutdown to terminate it.
Returns: success
selfDestruct
public abstract boolean selfDestruct(int diskWritesToWait) throws RemoteException
- Call exit after a specified number of disk writes.
Support for this method requires a wrapper around the system's
write to disk command that decrements the counter set by this method.
This counter should default to 0, which implies that the wrapper
will do nothing. If the count is non-zero, the wrapper should decrement
the counter, see if it becomes zero, and if so, call exit(), otherwise
continue the write.
This method is not part of a transaction.
Returns: success
queryFlight
public abstract int queryFlight(int Xid,
int flightNumber) throws RemoteException
queryFlightPrice
public abstract int queryFlightPrice(int Xid,
int flightNumber) throws RemoteException
queryRooms
public abstract int queryRooms(int Xid,
String location) throws RemoteException
queryRoomsPrice
public abstract int queryRoomsPrice(int Xid,
String location) throws RemoteException
queryCars
public abstract int queryCars(int Xid,
String location) throws RemoteException
queryCarsPrice
public abstract int queryCarsPrice(int Xid,
String location) throws RemoteException
queryCustomerInfo
public abstract String queryCustomerInfo(int customer) throws RemoteException
newCustomer
public abstract int newCustomer() throws RemoteException
deleteCustomer
public abstract boolean deleteCustomer(int customer) throws RemoteException
reserveFlight
public abstract boolean reserveFlight(int Xid,
int customer,
int flightNumber) throws RemoteException
reserveCar
public abstract boolean reserveCar(int Xid,
int customer,
String location) throws RemoteException
reserveRoom
public abstract boolean reserveRoom(int Xid,
int customer,
String location) throws RemoteException
All Packages Class Hierarchy This Package Previous Next Index