org.rhq.modules.plugins.jbossas7
Class BaseComponent<T extends ResourceComponent<?>>

java.lang.Object
  extended by org.rhq.modules.plugins.jbossas7.BaseComponent<T>
All Implemented Interfaces:
AvailabilityFacet, ConfigurationFacet, CreateChildResourceFacet, DeleteResourceFacet, ResourceComponent<T>, MeasurementFacet, OperationFacet
Direct Known Subclasses:
BaseServerComponent, DatasourceComponent, DeploymentComponent, JmsComponent, LoggerComponent, ManagedASComponent, ModClusterComponent, NamingComponent

public class BaseComponent<T extends ResourceComponent<?>>
extends Object
implements ResourceComponent<T>, MeasurementFacet, ConfigurationFacet, DeleteResourceFacet, CreateChildResourceFacet, OperationFacet


Constructor Summary
BaseComponent()
           
 
Method Summary
 CreateResourceReport createResource(CreateResourceReport report)
           
 void deleteResource()
           
protected  CreateResourceReport deployContent(CreateResourceReport report)
          Deploy content to the remote server - this is one half of #createResource
 Address getAddress()
           
protected  ASConnection getASConnection()
           
 org.rhq.core.domain.measurement.AvailabilityType getAvailability()
          Return availability of this resource
protected  String getPath()
           
 void getValues(org.rhq.core.domain.measurement.MeasurementReport report, Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> metrics)
          Gather measurement data
 OperationResult invokeOperation(String name, org.rhq.core.domain.configuration.Configuration parameters)
           
 org.rhq.core.domain.configuration.Configuration loadResourceConfiguration()
           
 CreateResourceReport runDeploymentMagicOnServer(CreateResourceReport report, String runtimeName, String deploymentName, String hash)
          Do the actual fumbling with the domain api to deploy the uploaded content
 void setConnection(ASConnection connection)
           
 void setPath(String path)
           
 void start(ResourceContext context)
          Start the resource connection
 void stop()
          Tear down the resource connection
 void updateResourceConfiguration(ConfigurationUpdateReport report)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseComponent

public BaseComponent()
Method Detail

getAvailability

public org.rhq.core.domain.measurement.AvailabilityType getAvailability()
Return availability of this resource

Specified by:
getAvailability in interface AvailabilityFacet
See Also:
AvailabilityFacet.getAvailability()

start

public void start(ResourceContext context)
           throws InvalidPluginConfigurationException,
                  Exception
Start the resource connection

Specified by:
start in interface ResourceComponent<T extends ResourceComponent<?>>
Throws:
InvalidPluginConfigurationException
Exception
See Also:
ResourceComponent.start(org.rhq.core.pluginapi.inventory.ResourceContext)

stop

public void stop()
Tear down the resource connection

Specified by:
stop in interface ResourceComponent<T extends ResourceComponent<?>>
See Also:
ResourceComponent.stop()

getValues

public void getValues(org.rhq.core.domain.measurement.MeasurementReport report,
                      Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> metrics)
               throws Exception
Gather measurement data

Specified by:
getValues in interface MeasurementFacet
Throws:
Exception
See Also:
MeasurementFacet.getValues(org.rhq.core.domain.measurement.MeasurementReport, java.util.Set)

getASConnection

protected ASConnection getASConnection()

getPath

protected String getPath()

loadResourceConfiguration

public org.rhq.core.domain.configuration.Configuration loadResourceConfiguration()
                                                                          throws Exception
Specified by:
loadResourceConfiguration in interface ConfigurationFacet
Throws:
Exception

updateResourceConfiguration

public void updateResourceConfiguration(ConfigurationUpdateReport report)
Specified by:
updateResourceConfiguration in interface ConfigurationFacet

deleteResource

public void deleteResource()
                    throws Exception
Specified by:
deleteResource in interface DeleteResourceFacet
Throws:
Exception

createResource

public CreateResourceReport createResource(CreateResourceReport report)
Specified by:
createResource in interface CreateChildResourceFacet

deployContent

protected CreateResourceReport deployContent(CreateResourceReport report)
Deploy content to the remote server - this is one half of #createResource

Parameters:
report - Create resource report that tells us what to do
Returns:
report that tells us what has been done.

runDeploymentMagicOnServer

public CreateResourceReport runDeploymentMagicOnServer(CreateResourceReport report,
                                                       String runtimeName,
                                                       String deploymentName,
                                                       String hash)
Do the actual fumbling with the domain api to deploy the uploaded content

Parameters:
report - CreateResourceReport to report the result
runtimeName - File name to use as runtime name
deploymentName - Name of the deployment
hash - Hash of the content bytes
Returns:
the passed report with success or failure settings

invokeOperation

public OperationResult invokeOperation(String name,
                                       org.rhq.core.domain.configuration.Configuration parameters)
                                throws InterruptedException,
                                       Exception
Specified by:
invokeOperation in interface OperationFacet
Throws:
InterruptedException
Exception

setConnection

public void setConnection(ASConnection connection)

setPath

public void setPath(String path)

getAddress

public Address getAddress()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.