|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.pc.inventory.ResourceContainer
public class ResourceContainer
This object holds information relative to the running state of a ResourceComponent in the Plugin Container.
It is serializable for persistence to the Plugin Container's storage mechanisms.
| Nested Class Summary | |
|---|---|
static class |
ResourceContainer.ResourceComponentState
|
static class |
ResourceContainer.SynchronizationState
|
| Constructor Summary | |
|---|---|
ResourceContainer(org.rhq.core.domain.resource.Resource resource,
ClassLoader resourceClassLoader)
|
|
| Method Summary | ||
|---|---|---|
void |
addDriftDefinition(org.rhq.core.domain.drift.DriftDefinition d)
|
|
boolean |
containsDriftDefinition(org.rhq.core.domain.drift.DriftDefinition d)
|
|
|
createResourceComponentProxy(Class<T> facetInterface,
FacetLockType lockType,
long timeout,
boolean daemonThread,
boolean onlyIfStarted)
Creates a proxy to this container's resource component, essentially returning the component exposed as the given facet interface. |
|
org.rhq.core.domain.measurement.Availability |
getAvailability()
Returns the currently known availability of the resource. |
|
Collection<org.rhq.core.domain.drift.DriftDefinition> |
getDriftDefinitions()
|
|
Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> |
getInstalledPackages()
|
|
Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> |
getMeasurementSchedule()
|
|
Lock |
getReadFacetLock()
If a piece of code wants to make a call into a plugin component's facet, and that call doesn't need to write or modify any data within the component or the managed resource itself, that code should obtain the returned read lock. |
|
org.rhq.core.domain.resource.Resource |
getResource()
|
|
ClassLoader |
getResourceClassLoader()
|
|
ResourceComponent |
getResourceComponent()
|
|
ResourceContainer.ResourceComponentState |
getResourceComponentState()
|
|
ResourceContext |
getResourceContext()
|
|
ResourceContainer.SynchronizationState |
getSynchronizationState()
|
|
Lock |
getWriteFacetLock()
If a piece of code wants to make a call into a plugin component's facet, and that call may need to write or modify data within the component or the managed resource itself, that code should obtain the returned write lock. |
|
static void |
initialize()
Initialize the ResourceContainer's internals, such as its thread pools. |
|
void |
removeDriftDefinition(org.rhq.core.domain.drift.DriftDefinition d)
|
|
void |
setInstalledPackages(Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> installedPackages)
|
|
void |
setMeasurementSchedule(Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> measurementSchedule)
|
|
void |
setResourceClassLoader(ClassLoader resourceClassLoader)
Sets the classloader that should be used by the resource when its component interfaces are being invoked. |
|
void |
setResourceComponent(ResourceComponent resourceComponent)
|
|
void |
setResourceComponentState(ResourceContainer.ResourceComponentState state)
|
|
void |
setResourceContext(ResourceContext resourceContext)
|
|
void |
setSynchronizationState(ResourceContainer.SynchronizationState synchronizationState)
|
|
static void |
shutdown()
Shuts down ResourceContainer's internals, such as its thread pools. |
|
String |
toString()
|
|
org.rhq.core.domain.measurement.Availability |
updateAvailability(org.rhq.core.domain.measurement.AvailabilityType availabilityType)
|
|
boolean |
updateMeasurementSchedule(Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> measurementScheduleUpdate)
Updates the measurementSchedule with the modifications made in the measurementScheduleUpdate. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceContainer(org.rhq.core.domain.resource.Resource resource,
ClassLoader resourceClassLoader)
| Method Detail |
|---|
public static void initialize()
public static void shutdown()
public org.rhq.core.domain.measurement.Availability updateAvailability(org.rhq.core.domain.measurement.AvailabilityType availabilityType)
public org.rhq.core.domain.resource.Resource getResource()
@Nullable public org.rhq.core.domain.measurement.Availability getAvailability()
null if this resource is
new and we do not yet know what its availability is.
null if it is not knownpublic Lock getReadFacetLock()
public Lock getWriteFacetLock()
public Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> getInstalledPackages()
public void setInstalledPackages(Set<org.rhq.core.domain.content.transfer.ResourcePackageDetails> installedPackages)
public ResourceComponent getResourceComponent()
public void setResourceComponent(ResourceComponent resourceComponent)
public ResourceContext getResourceContext()
public void setResourceContext(ResourceContext resourceContext)
public Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> getMeasurementSchedule()
public void setMeasurementSchedule(Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> measurementSchedule)
public boolean updateMeasurementSchedule(Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> measurementScheduleUpdate)
measurementScheduleUpdate - the updates to the current measurementSchedule
public Collection<org.rhq.core.domain.drift.DriftDefinition> getDriftDefinitions()
public boolean containsDriftDefinition(org.rhq.core.domain.drift.DriftDefinition d)
public void addDriftDefinition(org.rhq.core.domain.drift.DriftDefinition d)
public void removeDriftDefinition(org.rhq.core.domain.drift.DriftDefinition d)
public ResourceContainer.ResourceComponentState getResourceComponentState()
public void setResourceComponentState(ResourceContainer.ResourceComponentState state)
public ResourceContainer.SynchronizationState getSynchronizationState()
public void setSynchronizationState(ResourceContainer.SynchronizationState synchronizationState)
public ClassLoader getResourceClassLoader()
public void setResourceClassLoader(ClassLoader resourceClassLoader)
resourceClassLoader - the resource's context classloaderpublic String toString()
toString in class Object
public <T> T createResourceComponentProxy(Class<T> facetInterface,
FacetLockType lockType,
long timeout,
boolean daemonThread,
boolean onlyIfStarted)
throws PluginContainerException
lockType is FacetLockType.NONE and there is no timeout, then the resource's
actual component instance is returned as-is (i.e. it will not be wrapped in a proxy - which means this returns
the same as getResourceComponent()).
facetInterface - the interface that the component implements and will expose via the proxylockType - the type of lock to use when synchronizing access; must not be nulltimeout - if the method invocation thread has not completed after this many milliseconds, interrupt
it; value must be positivedaemonThread - whether or not the thread used for the invocation should be a daemon threadonlyIfStarted - if true, and the component is not started, an exception is thrown
PluginContainerException - if the component does not exist or does not implement the interface
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||