org.rhq.plugins.jbossas5
Class ManagedComponentDiscoveryComponent<P extends ProfileServiceComponent<?>>

java.lang.Object
  extended by org.rhq.plugins.jbossas5.ManagedComponentDiscoveryComponent<P>
All Implemented Interfaces:
ResourceDiscoveryComponent<P>
Direct Known Subclasses:
Ejb2BeanDiscoveryComponent, Ejb3BeanDiscoveryComponent, JBossMessagingDiscoveryComponent, JmsDestinationDiscoveryComponent, ManagerDiscoveryComponent

public class ManagedComponentDiscoveryComponent<P extends ProfileServiceComponent<?>>
extends Object
implements ResourceDiscoveryComponent<P>

Discovery component for ManagedComponents exposed by the JBoss AS 5.x Profile Service that will be represented as child Resources of the JBoss AS Resource.

Author:
Jason Dobies, Mark Spritzer, Ian Springer

Constructor Summary
ManagedComponentDiscoveryComponent()
           
 
Method Summary
protected  boolean accept(ResourceDiscoveryContext<P> discoveryContext, org.jboss.managed.api.ManagedComponent component)
          This method is called during discoverResources(ResourceDiscoveryContext) to determine whether given component that has been found in the management view by this component's configured component type is applicable in the discovery context.
 Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<P> discoveryContext)
           
protected  org.jboss.managed.api.ComponentType getComponentType(ResourceDiscoveryContext<P> discoveryContext)
           
protected  String getResourceKey(org.jboss.managed.api.ManagedComponent component)
          Return the unique resource key for the component.
protected  String getResourceName(org.jboss.managed.api.ManagedComponent component)
          Subclasses can override this method if they don't want to use the ManagedComponent name as the initial Resource name.
protected  String getResourceVersion(org.jboss.managed.api.ManagedComponent component)
          Subclasses can override this method if they want the discovered ManagedComponent to have a version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedComponentDiscoveryComponent

public ManagedComponentDiscoveryComponent()
Method Detail

discoverResources

public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<P> discoveryContext)
                                                 throws Exception
Specified by:
discoverResources in interface ResourceDiscoveryComponent<P extends ProfileServiceComponent<?>>
Throws:
Exception

getComponentType

protected org.jboss.managed.api.ComponentType getComponentType(ResourceDiscoveryContext<P> discoveryContext)

getResourceName

protected String getResourceName(org.jboss.managed.api.ManagedComponent component)
Subclasses can override this method if they don't want to use the ManagedComponent name as the initial Resource name.

Parameters:
component - the ManagedComponent being discovered
Returns:
the name to be assigned to the corresponding Resource

getResourceKey

protected String getResourceKey(org.jboss.managed.api.ManagedComponent component)
Return the unique resource key for the component. If you override this method, make sure to override ManagedComponentComponent.getManagedComponent() method as well because the return value of this method is used as the component name (ManagedComponentComponent.getComponentName()).

Parameters:
component - the component to uniquely identify
Returns:
the unique identifier for the component

getResourceVersion

protected String getResourceVersion(org.jboss.managed.api.ManagedComponent component)
Subclasses can override this method if they want the discovered ManagedComponent to have a version.

Parameters:
component - the ManagedComponent being discovered
Returns:
the version to be assigned to the corresponding Resource

accept

protected boolean accept(ResourceDiscoveryContext<P> discoveryContext,
                         org.jboss.managed.api.ManagedComponent component)
This method is called during discoverResources(ResourceDiscoveryContext) to determine whether given component that has been found in the management view by this component's configured component type is applicable in the discovery context.

Because the Profile Service doesn't always provide the components in a hierarchy we present the resources we need this method to filter the components into their appropriate places.

This default implementation always returns true.

Parameters:
discoveryContext - the current discovery context
component - the discovered component
Returns:
true if the component logically belongs in the context, false otherwise.


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