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

## com.sun.jini.landlord
Interface LeasePeriodPolicy

All Known Implementing Classes:
  FixedLeasePeriodPolicy

public interface LeasePeriodPolicy

Interface for objects that define what policy to use when calculating lease grants and renewals.

Since:
  2.0

Nested Class Summary
`static class` | `LeasePeriodPolicy.Result` Simple class that holds a pair of times, the new expiration and duration for a lease.

Method Summary
`LeasePeriodPolicy.Result` | `grant(LeasedResource resource, long requestedDuration)` Calculate the initial expiration and duration for a new lease.
`LeasePeriodPolicy.Result` | `renew(LeasedResource resource, long requestedDuration)` Calculate the expiration and duration for an existing lease that is being renewed.

Method Detail

### grant

    public LeasePeriodPolicy.Result grant(LeasedResource resource,
                                          long requestedDuration)
                                   throws LeaseDeniedException

  Calculate the initial expiration and duration for a new lease.

  Parameters:
    `resource` - the server side representation of the new lease that needs an initial expiration and duration
    `requestedDuration` - the initial duration the requester of the resources would like. May be `Lease.ANY`
  Returns:
    A `Result` that holds both the expiration and duration.
  Throws:
    `LeaseDeniedException` - if the grant request is denied.
    `IllegalArgumentException` - if the requested duration is not `Lease.ANY` and is negative.

### renew

    public LeasePeriodPolicy.Result renew(LeasedResource resource,
                                          long requestedDuration)
                                   throws LeaseDeniedException

  Calculate the expiration and duration for an existing lease that is being renewed.

  Parameters:
    `resource` - the server side representation of the lease that is being renewed
    `requestedDuration` - the duration the client is requesting. May be `Lease.ANY`.
  Returns:
    A `Result` that holds both the expiration and duration.
  Throws:
    `LeaseDeniedException` - if the renewal request is denied.
    `IllegalArgumentException` - if the requested duration is not `Lease.ANY` and is negative.

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