Class LeaseFactory

java.lang.Object
com.sun.jini.landlord.LeaseFactory

public class LeaseFactory extends Object
Factory for LandlordLease instances.
Since:
2.0
Author:
Sun Microsystems, Inc.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LeaseFactory(Landlord landlord, Uuid landlordUuid)
    Create a new LeaseFactory that will create LandlordLeases with the specified Landlord and landlord Uuid.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return a TrustVerifier that will verify the proxies produced by this factory.
    newLease(Uuid cookie, long expiration)
    Return a new LandlordLease with the specified initial expiration and cookie using the inner proxy and Uuid the factory was created with.
    newTransactionLease(Uuid cookie, long expiration)
    Return a new MahaloTxnLease with the specified initial expiration and cookie using the inner proxy and Uuid the factory was created with.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LeaseFactory

      public LeaseFactory(Landlord landlord, Uuid landlordUuid)
      Create a new LeaseFactory that will create LandlordLeases with the specified Landlord and landlord Uuid.
      Parameters:
      landlord - the inner proxy that the leases will use to communicate back to the server.
      landlordUuid - a universally unique id that has been assigned to the server granting of the lease. Ideally the Uuid landlord.getUuid would return if landlord implemented ReferentUuid. Used to determine when two leases can be batched together.
      Throws:
      NullPointerException - if either argument is null
  • Method Details

    • newLease

      public LandlordLease newLease(Uuid cookie, long expiration)
      Return a new LandlordLease with the specified initial expiration and cookie using the inner proxy and Uuid the factory was created with. Will return a ConstrainableLandlordLease if inner proxy this factory was created with implements RemoteMethodControl.
      Parameters:
      cookie - a Uuid that will universally and uniquely identify the lease
      expiration - the initial expiration time of the lease.
      Returns:
      a new LandlordLease.
      Throws:
      NullPointerException - if the cookie argument is null.
    • newTransactionLease

      public LandlordLease newTransactionLease(Uuid cookie, long expiration)
      Return a new MahaloTxnLease with the specified initial expiration and cookie using the inner proxy and Uuid the factory was created with. Will return a ConstrainableLandlordLease if inner proxy this factory was created with implements RemoteMethodControl.
      Parameters:
      cookie - a Uuid that will universally and uniquely identify the lease
      expiration - the initial expiration time of the lease.
      Returns:
      a new LandlordLease.
      Throws:
      NullPointerException - if the cookie argument is null.
    • getVerifier

      public TrustVerifier getVerifier()
      Return a TrustVerifier that will verify the proxies produced by this factory. Currently the verifier returned will be an instance of LandlordProxyVerifier.
      Returns:
      a new TrustVerifier.
      Throws:
      UnsupportedOperationException - if the Landlord this factory was created with does not implement both RemoteMethodControl and TrustEquivalence.