org.rhq.plugins.byteman
Class BytemanAgentDiscoveryComponent
java.lang.Object
org.rhq.plugins.byteman.BytemanAgentDiscoveryComponent
- All Implemented Interfaces:
- ClassLoaderFacet<BytemanAgentComponent>, ManualAddFacet<BytemanAgentComponent>, ResourceDiscoveryComponent<BytemanAgentComponent>
public class BytemanAgentDiscoveryComponent
- extends Object
- implements ResourceDiscoveryComponent<BytemanAgentComponent>, ManualAddFacet<BytemanAgentComponent>, ClassLoaderFacet<BytemanAgentComponent>
Discovers a Byteman agent.
- Author:
- John Mazzitelli
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_BYTEMAN_ADDRESS
public static final String DEFAULT_BYTEMAN_ADDRESS
- See Also:
- Constant Field Values
DEFAULT_BYTEMAN_PORT
public static final String DEFAULT_BYTEMAN_PORT
- See Also:
- Constant Field Values
PLUGIN_CONFIG_PROP_ADDRESS
public static final String PLUGIN_CONFIG_PROP_ADDRESS
- See Also:
- Constant Field Values
PLUGIN_CONFIG_PROP_PORT
public static final String PLUGIN_CONFIG_PROP_PORT
- See Also:
- Constant Field Values
PLUGIN_CONFIG_PROP_CLIENT_JAR
public static final String PLUGIN_CONFIG_PROP_CLIENT_JAR
- See Also:
- Constant Field Values
BytemanAgentDiscoveryComponent
public BytemanAgentDiscoveryComponent()
discoverResources
public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<BytemanAgentComponent> context)
- Specified by:
discoverResources
in interface ResourceDiscoveryComponent<BytemanAgentComponent>
discoverResource
public DiscoveredResourceDetails discoverResource(Configuration pluginConfiguration,
ResourceDiscoveryContext<BytemanAgentComponent> context)
throws InvalidPluginConfigurationException
- Specified by:
discoverResource
in interface ManualAddFacet<BytemanAgentComponent>
- Throws:
InvalidPluginConfigurationException
getAdditionalClasspathUrls
public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext<BytemanAgentComponent> context,
DiscoveredResourceDetails details)
throws Exception
- Specified by:
getAdditionalClasspathUrls
in interface ClassLoaderFacet<BytemanAgentComponent>
- Throws:
Exception
getVersion
protected String getVersion(String address,
String port,
String jarPath)
- Tries to determine the version of the remote byteman agent. If, for some reason, the remote agent
cannot be contacted, the manifest within the given jar will be used as the version as a "best guess".
If all else fails, "0" will be returned as the version.
- Parameters:
address
- the address of the remote byteman agent listenerport
- the port that the remote byteman agent is listening tojarPath
- the path to the byteman jar (which may be the client jar, or the core byteman jar)
- Returns:
- the version of the managed byteman agent; "0" if unknown
getJarAttribute
public static String getJarAttribute(String jarPath,
String attributeName,
String defaultValue)
- Static utility method that can extract a main attribute value from a given jar file's manifest.
- Parameters:
jarPath
- location of the jar fileattributeName
- name of the main attribute to retrievedefaultValue
- if the manifest doesn't have the attribute or the manifest itself doesn't exist, this is returned
- Returns:
- the value of the attribute
Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.