ist.palcom.resource.manager
Class ResourceManager

java.lang.Object
  extended by ist.palcom.resource.manager.ResourceManager

public class ResourceManager
extends java.lang.Object


Constructor Summary
ResourceManager(PalcomScheduler scheduler, PointToPointManager pointToPointManager, CommunicationManager communicationManager, PRDDevice localPRDDevice)
           
 
Method Summary
 void initiateDiscovery()
          (Re)initiate discovery.
 void removeLocalSIDReceiver(ServiceInstanceID serviceInstanceID, PalcomThread receiver)
          Unregister a receiver thread for LocalSIDs from the service identified by serviceInstanceID.
 void removePRDConnectionReceiver(DeviceID deviceID, PalcomThread receiver)
          Unregister a receiver thread for PRDConnections from the device identified by deviceID.
 void removePRDDeviceReceiver(PalcomThread receiver)
          Unregister a PRDDevice receiver thread.
 void removePRDServiceFMDescriptionReceiver(LocalSID localSID, PalcomThread receiver)
          Unregister a receiver thread for the PRDServiceFMDescription of the service identified by localSID.
 void removePRDServiceListReceiver(LocalSID localSID, PalcomThread receiver)
          Unregister a receiver thread for PRDServiceLists from the device identified by localSID.
 void removePRDServiceReceiver(LocalSID localSID, PalcomThread receiver)
          Unregister a receiver thread for the PRDService identified by localSID.
 void removeReceiver(PalcomThread receiver)
          Unregister a receiver thread for all PRDDatas and other information.
 void removeSelectorReceiver(LocalSID localSID, PalcomThread receiver)
          Unregister a receiver thread for Selectors from the service identified by localSID.
 void removeServiceInstanceIDReceiver(LocalSID localSID, PalcomThread receiver)
          Unregister a receiver thread for ServiceInstanceIDs from the service identified by localSID.
 void removeServiceStatusReceiver(LocalSID localSID, PalcomThread receiver)
          Unregister a receiver thread for service status events from the service identified by localSID.
 void setRequestMessageTimeout(int requestMessageTimeout)
          Set the number of heartbeats a requestMessage can wait for a reply message before it is sent out again.
 void start()
          Start the ResourceManager.
 void stop()
          Stop the ResourceManager.
 void updateLocalSIDReceiver(ServiceInstanceID serviceInstanceID, PalcomThread receiver)
          Add a receiver thread for the LocalSID of the service identified by serviceInstanceID.
 void updatePRDConnectionReceiver(DeviceID deviceID, PalcomThread receiver)
          Add a receiver thread for PRDConnections from the device identified by deviceID.
 void updatePRDDeviceReceiver(PalcomThread receiver)
          Add a PRDDevice receiver thread.
 void updatePRDServiceFMDescriptionReceiver(LocalSID localSID, PalcomThread receiver)
          Add a receiver thread for the PRDServiceFMDescription of the service identified by localSID.
 void updatePRDServiceListReceiver(DeviceID deviceID, PalcomThread receiver)
          Like updatePRDServiceListReceiver(LocalSID localSID, PalcomThread receiver) but for the top level of the tree.
 void updatePRDServiceListReceiver(LocalSID localSID, PalcomThread receiver)
          Add a receiver thread for PRDServiceLists from the device and service identified by localSID.
 void updatePRDServiceReceiver(LocalSID localSID, PalcomThread receiver)
          Add a receiver thread for PRDService from the device and service identified by localSID.
 void updateSelectorReceiver(LocalSID localSID, PalcomThread receiver)
          Add a receiver thread for the Selector of the service identified by localSID.
 void updateServiceInstanceIDReceiver(LocalSID localSID, PalcomThread receiver)
          Add a receiver thread for the ServiceInstanceID of the service identified by localSID.
 void updateServiceStatusReceiver(LocalSID localSID, PalcomThread receiver)
          Add a receiver thread for the service status of the service identified by localSID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager(PalcomScheduler scheduler,
                       PointToPointManager pointToPointManager,
                       CommunicationManager communicationManager,
                       PRDDevice localPRDDevice)
Method Detail

start

public void start()
Start the ResourceManager. Listening for remote PRDData requests will begin, and an initial announcement about this device will be sent out (the PRDDevice sent out in an PRDDataEvent with keepPRDData=true).

The PubSubManager that was passed to the constructor must be started before this call.


stop

public void stop()
Stop the ResourceManager.

The PubSubManager that was passed to the constructor will not be stopped.


setRequestMessageTimeout

public void setRequestMessageTimeout(int requestMessageTimeout)
Set the number of heartbeats a requestMessage can wait for a reply message before it is sent out again.


initiateDiscovery

public void initiateDiscovery()
(Re)initiate discovery. All stored info will be discarded and a heartbeat will be sent out.


updatePRDDeviceReceiver

public void updatePRDDeviceReceiver(PalcomThread receiver)
Add a PRDDevice receiver thread. If the receiver is already registered, nothing happens. Otherwise, the following will happen:


removePRDDeviceReceiver

public void removePRDDeviceReceiver(PalcomThread receiver)
Unregister a PRDDevice receiver thread.


updatePRDServiceListReceiver

public void updatePRDServiceListReceiver(LocalSID localSID,
                                         PalcomThread receiver)
Add a receiver thread for PRDServiceLists from the device and service identified by localSID. If the thread is already registered for that device, nothing happens. Otherwise, the following will happen:


updatePRDServiceListReceiver

public void updatePRDServiceListReceiver(DeviceID deviceID,
                                         PalcomThread receiver)
Like updatePRDServiceListReceiver(LocalSID localSID, PalcomThread receiver) but for the top level of the tree.


removePRDServiceListReceiver

public void removePRDServiceListReceiver(LocalSID localSID,
                                         PalcomThread receiver)
Unregister a receiver thread for PRDServiceLists from the device identified by localSID.


updatePRDServiceReceiver

public void updatePRDServiceReceiver(LocalSID localSID,
                                     PalcomThread receiver)
Add a receiver thread for PRDService from the device and service identified by localSID. If the thread is already registered for that device, nothing happens. Otherwise, the following will happen:


removePRDServiceReceiver

public void removePRDServiceReceiver(LocalSID localSID,
                                     PalcomThread receiver)
Unregister a receiver thread for the PRDService identified by localSID.


updatePRDServiceFMDescriptionReceiver

public void updatePRDServiceFMDescriptionReceiver(LocalSID localSID,
                                                  PalcomThread receiver)
Add a receiver thread for the PRDServiceFMDescription of the service identified by localSID. If the thread is already registered for that service, nothing happens. Otherwise, the behavior corresponds to the behavior for updatePRDServiceListReceiver.


removePRDServiceFMDescriptionReceiver

public void removePRDServiceFMDescriptionReceiver(LocalSID localSID,
                                                  PalcomThread receiver)
Unregister a receiver thread for the PRDServiceFMDescription of the service identified by localSID.


updatePRDConnectionReceiver

public void updatePRDConnectionReceiver(DeviceID deviceID,
                                        PalcomThread receiver)
Add a receiver thread for PRDConnections from the device identified by deviceID. If the thread is already registered for that device, nothing happens. Otherwise, the behavior corresponds to the behavior for updatePRDServiceListReceiver.


removePRDConnectionReceiver

public void removePRDConnectionReceiver(DeviceID deviceID,
                                        PalcomThread receiver)
Unregister a receiver thread for PRDConnections from the device identified by deviceID.


updateSelectorReceiver

public void updateSelectorReceiver(LocalSID localSID,
                                   PalcomThread receiver)
Add a receiver thread for the Selector of the service identified by localSID. The selector for the service is always received in a SelectorEvent unless the service is unavailable.


removeSelectorReceiver

public void removeSelectorReceiver(LocalSID localSID,
                                   PalcomThread receiver)
Unregister a receiver thread for Selectors from the service identified by localSID.


updateServiceInstanceIDReceiver

public void updateServiceInstanceIDReceiver(LocalSID localSID,
                                            PalcomThread receiver)
Add a receiver thread for the ServiceInstanceID of the service identified by localSID. The serviceInstanceID for the service is always received in a ServiceInstanceIDEvent unless the service is unavailable.


removeServiceInstanceIDReceiver

public void removeServiceInstanceIDReceiver(LocalSID localSID,
                                            PalcomThread receiver)
Unregister a receiver thread for ServiceInstanceIDs from the service identified by localSID.


updateLocalSIDReceiver

public void updateLocalSIDReceiver(ServiceInstanceID serviceInstanceID,
                                   PalcomThread receiver)
Add a receiver thread for the LocalSID of the service identified by serviceInstanceID. The LocalSID for the service is always received in a ServiceInstanceIDEvent unless the service is unavailable.


removeLocalSIDReceiver

public void removeLocalSIDReceiver(ServiceInstanceID serviceInstanceID,
                                   PalcomThread receiver)
Unregister a receiver thread for LocalSIDs from the service identified by serviceInstanceID.


updateServiceStatusReceiver

public void updateServiceStatusReceiver(LocalSID localSID,
                                        PalcomThread receiver)
Add a receiver thread for the service status of the service identified by localSID. The service status for the service is always received in a ServiceStatusEvent unless the service is unavailable.


removeServiceStatusReceiver

public void removeServiceStatusReceiver(LocalSID localSID,
                                        PalcomThread receiver)
Unregister a receiver thread for service status events from the service identified by localSID.


removeReceiver

public void removeReceiver(PalcomThread receiver)
Unregister a receiver thread for all PRDDatas and other information.