Skip navigation links

Package org.ogema.core.resourcemanager

Defines the "basic access" to resources.

See: Description

Package org.ogema.core.resourcemanager Description

Defines the "basic access" to resources. The main acccess classes are the ResourceAccess, defining the access methods and the ResourceManagement providing methods for creation of top-level resources and deletion of resources by-name. Note that a lot of resource-manipulation methods are defined on the Resource itself, so the ResourceManagement is usually only required to create a top-level resource.
Access to the resources is possible in two ways:
- Direct access: It is possible to directly search the existing resources at a given time.
- Listener-based access: Instead of searching the resource graph at a given time, an application can add a ResourceDemandListener, which is as long as it is registered to the framework will be informed about all existing and newly-available suitable resources, as well as in the case that such a resource becomes unavailable for some reasons.

In addition to the resource listener, further listeners are defined that can be used to trace the state of the resource graph. Contrary to the "search listener" ResourceDemandListener they are applied to explicit resources (both virtual and non-virtual):
- the ResourceListener listens to changes in the entries of Schedules and SimpleResources.
- the ResourceStructureListener listens to changes of the resource state except the value contained. The possible events are defined in ResourceStructureEvent.
- the AccessModeListener listens to changes in the application-specific AccessMode (events reported to the ResourceStructureListener are the same for all applications).

A more "advanced" form of resource access is the Transaction. Applications can get a transaction object an fill it with commands to the resource graph that are then performed in an "atomic" transaction, meaning that no other applications see an intermediate state between the individual commands. This can be done to avoid "illegal" intermediate states, e.g. if a set of individual values only make sense combined.
Skip navigation links