com.sun.multicast.allocation
Interface MulticastAddressAllocator

All Known Implementing Classes:
StaticAllocator

public interface MulticastAddressAllocator

A multicast address allocator. This interface must be implemented by any allocator that wishes to plug into the Multicast Address Management Service Provider Interface (MAMSPI). Most applications should access multicast address allocators through the MulticastAddressManager class.

Several different allocators will be supplied with JRMS (SASA, SAPA, etc.).

See Also:
MulticastAddressManager

Method Summary
 Lease allocateAddresses(Scope scope, int ttl, int count, java.util.Date requestedStartTime, java.util.Date requiredStartTime, int requestedDuration, int requiredDuration, AddressSet addressesRequested)
          Allocate one or more multicast addresses, matching the specified parameters.
 java.lang.String getAllocatorName()
          Get the name used to identify the allocator.
 ScopeList getScopeList(AddressType addressType)
          Get the multicast scope list.
 void init()
          Inform the allocator that the MulticastAddressManager is now managing it.
 void term()
          Inform the allocator that the MulticastAddressManager is no longer managing it.
 

Method Detail

init

public void init()
          throws AddressAllocationException
Inform the allocator that the MulticastAddressManager is now managing it. If this method throws an exception, the MulticastAddressManager will not accept it for management.
Throws:
javax.jrms.addralloc.AddressAllocationException - if the allocator does not want to be managed

term

public void term()
Inform the allocator that the MulticastAddressManager is no longer managing it. There is no way for the allocator to reject this.

getAllocatorName

public java.lang.String getAllocatorName()
Get the name used to identify the allocator. The application may supply this name as an argument to MulticastAddressManager.allocAddress() and MulticastAddressManager.findAllocator(). The name may not be null, should be unique, and must remain the same during the lifetime of a MulticastAddressAllocator object.
Returns:
the allocator name

getScopeList

public ScopeList getScopeList(AddressType addressType)
                       throws AddressAllocationException
Get the multicast scope list.
Returns:
the multicast scope list
Throws:
AddressAllocationException - if an exception was encountered

allocateAddresses

public Lease allocateAddresses(Scope scope,
                               int ttl,
                               int count,
                               java.util.Date requestedStartTime,
                               java.util.Date requiredStartTime,
                               int requestedDuration,
                               int requiredDuration,
                               AddressSet addressesRequested)
                        throws AddressAllocationException,
                               NoAddressAvailableException
Allocate one or more multicast addresses, matching the specified parameters.

This method is used by the MulticastAddressManager when its allocateAddresses method has been called.

Parameters:
scope - the administrative scope requested
count - the number of multicast addresses requested (usually one)
ttl - the maximum ttl that will be used
requestedStartTime - the requested start time (null if now)
requiredStartTime - the latest acceptable start time (null if now)
requestedDuration - the requested duration in seconds (-1 if indefinite)
requiredDuration - the required duration in seconds (-1 if indefinite)
addressesRequested - a requested address set (null if any will do)
Returns:
the multicast address lease granted
Throws:
javax.jrms.addralloc.AddressAllocationException - if an error occurred
javax.jrms.addralloc.NoAddressAvailableException - if no address was available that met the requirements


JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.