|
|
Resource Provider DocumentationDescriptionThe resource provider is the central component in a Hedeby system. It acts as both a main communications hub and as the decision maker for resource reassignment and reprovisioning. In a given Hedeby system, there may only be one active resource provider at any time. the resource provider is componsed of three main elements. The first is the main resource provider implementation, which can be found in the ResourceProviderImpl class. This class provides an implementation of the ResourceProvider interface, which defines methods for adding, modifying, removing, and listing resources, resource attributes, policies, and services. The second element is the RequestProcessor. This class is run in its own thread by the ResourceProviderImpl. The RequestProcessor's job is to handle incoming resource requests. Such requests are received as events by the ResourceProviderImpl and then placed in a request queue to be processed by the RequestProcessor. The third element is the data store. The data store is implemented by the ResourceStore, HandleStore, and OrderStore classes. These classes are responsible for persisting resource and service information. The ResourceProviderImpl has a master list of resources stored in a ResourceStore instance. Service references are stored as ServiceHandle objects in the HandleStore. A ServiceHandle object contains a reference to a service container, a service state, and a list of the resources currently assigned to that service. Because all intercomponent communications are asynchronous, the resource provider must be able to leave messages for itself about what the intended destination of a resource is. For example, if a resource must be released, reprovisioned, then assigned, the resource provider requests that the resource be released and leaves itself a message When the resource is released, the resource provider is notified. The resource provider then reads the message to find out that the resource must next be reprovisioned. And so on. These messages are represented by Order objects and are stored in the OrderStore. To help resolve resource request priorities, the resource provider implements policies. A policy is an instance of a Policy object. Currently, the only policy implementation is the Priority class. The Priority class sets an absolute priority (1-99) for a service. When a resource request is made, the relative priorities of the services will be used to determine whether a resource should be reassigned. Policies can be set either through the configuration file or through the ResourceProvider interface. Policies set through the interface, however, will not be persisted (yet). While the resource provider is running, it periodically looks for an OS provisioner instance. When one is found, the resource provider will register with the OS provisioner as an event listener. The resource provider will also request a list of all known resources from the OS provisioner, and that list will be used to update the resource provider's master resource list. When the resource provider needs to communication with the OS provisioner, it will use the discovered instance. If there is no discovered instance, the resource provider will simply disable its ability to reprovision resources. When the OS provisioner needs to communication with the resource provider, the OS provisioner sends a ResourceEvent. While the resource provider is running, it is also periodically looking for any down services that it knows about. When a previously down service is discovered, the resource provider will register with the service as an event listener. The resource provider will also request a list of all known resources from the service. That list will then be used to update the resource provider's master resource list. Finally, the resource provider will send the service a list of all resources that the resource provider has recorded as being assigned to that service. When the resource provider needs to communication with a service, it will use the service referance in the ServiceHandle. When the service needs to communication with the resource provider, the OS provisioner sends a ServiceEvent. ConfigurationFollowing configuration attributes are available for the resource provider Component:
|
||||
|
![]() |
By any use of this Website, you agree to be bound by these Policies and Terms of Use. |