|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the parent resource component type for this component. This means you can nest a hierarchy of resource
components that mimic the resource type hierarchy as defined in a plugin deployment descriptor.public interface ResourceComponent<T extends ResourceComponent<?>>
The plugin component that wraps a Resource
. This component allows you to work with the actual resource, such
as determining its availability and setting its configuration, among other things. Resource components have a
lifecycle controlled by the plugin container - see start(ResourceContext)
and stop()
.
Implementations of this interface can also implement one or more of the different functionality facets which will allow the component to support different features such as measureability, configurability and others. These functionality facets are:
MeasurementFacet
ConfigurationFacet
OperationFacet
DeleteResourceFacet
CreateChildResourceFacet
ContentFacet
SupportFacet
AvailabilityFacet
.
Method Summary | |
---|---|
void |
start(ResourceContext<T> context)
Initializes the resource component, possibly connecting to the managed resource itself. |
void |
stop()
Stops the resource component, which usually indicates the plugin container itself is shutting down. |
Methods inherited from interface org.rhq.core.pluginapi.availability.AvailabilityFacet |
---|
getAvailability |
Method Detail |
---|
void start(ResourceContext<T> context) throws InvalidPluginConfigurationException, Exception
stop()
is called).
This method typically examines the plugin configuration from ResourceContext.getPluginConfiguration()
and uses that information to connect to the managed resource. If this method finds that the plugin configuration
is invalid which causes the connection to the managed resource to fail, then this method should throw
InvalidPluginConfigurationException
. This exception typically should not be thrown if the connection
failed for some reason other than an invalid plugin configuration (e.g. in the case the managed resource is
simply not running now) because usually those conditions can be tracked as part of the resource's
availability
data.
Note that this method does not imply that the actual managed resource should be started; this only
starts the plugin's resource component. To start the actual resource, plugins must utilize the
OperationFacet
facet to provide an operation to start it.
context
- the context for this resource which includes information about the resource
InvalidPluginConfigurationException
- if the resource component failed to start because it could not
connect to the resource due to a bad plugin configuration
Exception
- any other exception that causes the component to fail to startvoid stop()
Note that this does not imply that the actual managed resource should be stopped; this only stops the
plugin's resource component. To stop the actual resource, plugins must utilize the OperationFacet
facet
to provide an operation to stop it.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |