orca.shirako.kernel
Class KernelWrapper

java.lang.Object
  extended by orca.shirako.kernel.KernelWrapper
All Implemented Interfaces:
IKernelWrapper

public class KernelWrapper
extends java.lang.Object
implements IKernelWrapper

One SlicesActor object must exist for each locally instantiated actor, and it handles all operations on the actor. Includes operations for all roles: Service Manager, Agent, or Authority, in both client and server modes. Operations may originate from a local thread (e.g., a main program) or from external clients, e.g., through a SOAP/RPC interface.

"Requests" apply to slices and reservations held by a peer (in an Agent or Service Manager role) and served by this server (in an Agent or Authority role).

"Initiates" apply to slices and reservations held by this actor (in a Service Manager or Agent role).

AccessMonitor encapsulates supplementary access control policy, credentials, payment, etc.

Note: any newly created Slice or Reservation object passed through this interface is taken over by the Kernel.


Constructor Summary
KernelWrapper(IActor actor, Kernel kernel, AccessMonitor monitor, Guard guard)
          Creates a new kernel wrapper instance.
 
Method Summary
 void claimRequest(BrokerReservation reservation, AuthToken caller, IClientCallbackProxy callback)
          Processes a request to claim a pre-reserved "will call" ticket.
 void close(ReservationID rid)
          Closes the reservation, potentially initiating a close request to another actor.
 void closeRequest(ResourceReservation reservation, AuthToken caller, boolean compareSequenceNumbers)
          Processes an incoming request to close a reservation.
 void export(BrokerReservation reservation, AuthToken client)
          Initiates a ticket export.
 void extendLease(ReservationClient reservation)
          Initiates a request to extend a lease.
 void extendLeaseRequest(AuthorityReservation reservation, AuthToken caller, boolean compareSequenceNumbers)
          Processes an incoming request for a lease extension.
 int extendReservation(ReservationID rid, ResourceSet resources, Term term)
          Extends the reservation with the given resources and term.
 void extendTicket(ReservationClient reservation)
          Initiates a request to extend a ticket.
 void extendTicketRequest(BrokerReservation reservation, AuthToken caller, boolean compareSequenceNumbers)
          Processes an incoming request for a ticket extension.
 void redeem(ReservationClient reservation)
          Initiates a request to redeem a ticketed reservation.
 void redeemRequest(AuthorityReservation reservation, AuthToken caller, IServiceManagerCallbackProxy callback, boolean compareSequenceNumbers)
          Processes an incoming request for a new lease.
protected  void registerListener(ResourceReservation r)
           
 void removeReservation(ReservationID rid)
          Removes the specified reservation from the kernel data structures.
 void ticket(ReservationClient reservation, IActorIdentity destination)
          Initiates a ticket request.
 void ticketRequest(BrokerReservation reservation, AuthToken caller, IClientCallbackProxy callback, boolean compareSequenceNumbers)
          Processes an incoming request for a new ticket.
 void updateLease(ReservationClient reservation, UpdateData udd, AuthToken caller)
          Handles a lease update from an authority.
 void updateTicket(ReservationClient reservation, UpdateData udd, AuthToken caller)
          Handles a ticket update from upstream broker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KernelWrapper

public KernelWrapper(IActor actor,
                     Kernel kernel,
                     AccessMonitor monitor,
                     Guard guard)
Creates a new kernel wrapper instance.

Parameters:
actor - actor
kernel - kernel
monitor - access control monitor
guard - source for access control lists
Method Detail

removeReservation

public void removeReservation(ReservationID rid)
                       throws java.lang.Exception
Description copied from interface: IKernelWrapper
Removes the specified reservation from the kernel data structures.

Specified by:
removeReservation in interface IKernelWrapper
Parameters:
rid - identifier of reservation to remove
Throws:
java.lang.Exception

extendReservation

public int extendReservation(ReservationID rid,
                             ResourceSet resources,
                             Term term)
                      throws java.lang.Exception
Description copied from interface: IKernelWrapper
Extends the reservation with the given resources and term.

Specified by:
extendReservation in interface IKernelWrapper
Parameters:
rid - identifier of reservation to extend
resources - resources for extension
term - term for extension
Returns:
0 on success, a negative exit code on error
Throws:
java.lang.Exception

close

public void close(ReservationID rid)
           throws java.lang.Exception
Description copied from interface: IKernelWrapper
Closes the reservation, potentially initiating a close request to another actor. If the reservation has concrete resources bound to it, this method may return before all close operations have completed. Check the reservation state to determine when close completes.

Specified by:
close in interface IKernelWrapper
Parameters:
rid - identifier of reservation to close
Throws:
java.lang.Exception

ticket

public void ticket(ReservationClient reservation,
                   IActorIdentity destination)
            throws java.lang.Exception
Description copied from interface: IKernelWrapper
Initiates a ticket request. If the exported flag is set, this is a claim on a pre-reserved "will call" ticket.

Role: Broker or Service Manager.

Specified by:
ticket in interface IKernelWrapper
Parameters:
reservation - reservation parameters for ticket request
destination - identity of the actor the request must be sent to
Throws:
java.lang.Exception

redeem

public void redeem(ReservationClient reservation)
            throws java.lang.Exception
Description copied from interface: IKernelWrapper
Initiates a request to redeem a ticketed reservation.

Role: Service Manager.

Specified by:
redeem in interface IKernelWrapper
Parameters:
reservation - the reservation being redeemed
Throws:
java.lang.Exception

extendTicket

public void extendTicket(ReservationClient reservation)
                  throws java.lang.Exception
Description copied from interface: IKernelWrapper
Initiates a request to extend a ticket.

Role: Broker or Service Manager

Specified by:
extendTicket in interface IKernelWrapper
Parameters:
reservation - reservation describing the ticket extension request
Throws:
java.lang.Exception

extendLease

public void extendLease(ReservationClient reservation)
                 throws java.lang.Exception
Description copied from interface: IKernelWrapper
Initiates a request to extend a lease.

Role: Service Manager

Specified by:
extendLease in interface IKernelWrapper
Parameters:
reservation - reservation describing the extend request
Throws:
java.lang.Exception

updateTicket

public void updateTicket(ReservationClient reservation,
                         UpdateData udd,
                         AuthToken caller)
                  throws java.lang.Exception
Description copied from interface: IKernelWrapper
Handles a ticket update from upstream broker.

Role: Agent or Service Manager.

Specified by:
updateTicket in interface IKernelWrapper
Parameters:
reservation - reservation describing the update
udd - status of the update
caller - identity of the caller
Throws:
java.lang.Exception

updateLease

public void updateLease(ReservationClient reservation,
                        UpdateData udd,
                        AuthToken caller)
                 throws java.lang.Exception
Description copied from interface: IKernelWrapper
Handles a lease update from an authority.

Role: Service Manager

Specified by:
updateLease in interface IKernelWrapper
Parameters:
reservation - reservation describing the update
udd - status of the update
caller - identity of the caller
Throws:
java.lang.Exception

export

public void export(BrokerReservation reservation,
                   AuthToken client)
            throws java.lang.Exception
Description copied from interface: IKernelWrapper
Initiates a ticket export.

Role: Broker or Authority

Prepare/hold a ticket for "will call" claim by a client.

Specified by:
export in interface IKernelWrapper
Parameters:
reservation - reservation to be exported
client - client identity
Throws:
java.lang.Exception

ticketRequest

public void ticketRequest(BrokerReservation reservation,
                          AuthToken caller,
                          IClientCallbackProxy callback,
                          boolean compareSequenceNumbers)
                   throws java.lang.Exception
Description copied from interface: IKernelWrapper
Processes an incoming request for a new ticket.

Role: Broker

Specified by:
ticketRequest in interface IKernelWrapper
Parameters:
reservation - reservation representing the ticket request
caller - caller identity
callback - callback object
compareSequenceNumbers - if true, the incoming sequence number will be compared to the local sequence number to detect fresh requests, if false, no comparison will be performed.
Throws:
java.lang.Exception

claimRequest

public void claimRequest(BrokerReservation reservation,
                         AuthToken caller,
                         IClientCallbackProxy callback)
                  throws java.lang.Exception
Description copied from interface: IKernelWrapper
Processes a request to claim a pre-reserved "will call" ticket.

Role: Broker

Specified by:
claimRequest in interface IKernelWrapper
Parameters:
reservation - reservation describing the claim request
caller - caller identity
callback - callback proxy
Throws:
java.lang.Exception

redeemRequest

public void redeemRequest(AuthorityReservation reservation,
                          AuthToken caller,
                          IServiceManagerCallbackProxy callback,
                          boolean compareSequenceNumbers)
                   throws java.lang.Exception
Description copied from interface: IKernelWrapper
Processes an incoming request for a new lease.

Role: Authority

Specified by:
redeemRequest in interface IKernelWrapper
Parameters:
reservation - reservation representing the lease request. Must contain a valid ticket.
caller - caller identity
callback - callback object
compareSequenceNumbers - if true, the incoming sequence number will be compared to the local sequence number to detect fresh requests, if false, no comparison will be performed.
Throws:
java.lang.Exception

extendTicketRequest

public void extendTicketRequest(BrokerReservation reservation,
                                AuthToken caller,
                                boolean compareSequenceNumbers)
                         throws java.lang.Exception
Description copied from interface: IKernelWrapper
Processes an incoming request for a ticket extension.

Role: Broker

Specified by:
extendTicketRequest in interface IKernelWrapper
Parameters:
reservation - reservation representing the ticket extension request.
caller - caller identity
compareSequenceNumbers - if true, the incoming sequence number will be compared to the local sequence number to detect fresh requests, if false, no comparison will be performed.
Throws:
java.lang.Exception

extendLeaseRequest

public void extendLeaseRequest(AuthorityReservation reservation,
                               AuthToken caller,
                               boolean compareSequenceNumbers)
                        throws java.lang.Exception
Description copied from interface: IKernelWrapper
Processes an incoming request for a lease extension.

Role: Authority

Specified by:
extendLeaseRequest in interface IKernelWrapper
Parameters:
reservation - reservation representing the lease extension request.
caller - caller identity
compareSequenceNumbers - if true, the incoming sequence number will be compared to the local sequence number to detect fresh requests, if false, no comparison will be performed.
Throws:
java.lang.Exception

closeRequest

public void closeRequest(ResourceReservation reservation,
                         AuthToken caller,
                         boolean compareSequenceNumbers)
                  throws java.lang.Exception
Description copied from interface: IKernelWrapper
Processes an incoming request to close a reservation.

Role: Authority

Specified by:
closeRequest in interface IKernelWrapper
Parameters:
reservation - reservation to close.
caller - caller identity
compareSequenceNumbers - if true, the incoming sequence number will be compared to the local sequence number to detect fresh requests, if false, no comparison will be performed.
Throws:
java.lang.Exception

registerListener

protected void registerListener(ResourceReservation r)


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.