Package org.rhq.enterprise.agent

Examples of org.rhq.enterprise.agent.AgentManagementMBean


        log.debug("Discovering RHQ Agent...");

        HashSet<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();

        try {
            AgentManagementMBean mbean = getAgentManagementMBean();

            String name = RESOURCE_NAME;
            String key = getResourceKey(context.getParentResourceContext(), mbean);
            String version = mbean.getVersion();
            String description = "RHQ Management Agent";

            DiscoveredResourceDetails localVM = new DiscoveredResourceDetails(context.getResourceType(), key, name,
                version, description, null, null);
View Full Code Here


        return set;
    }

    public ResourceUpgradeReport upgrade(ResourceUpgradeContext inventoriedResource) {
        AgentManagementMBean mbean = getAgentManagementMBean();

        String oldResourceKey = inventoriedResource.getResourceKey();
        String newResourceKey = getResourceKey(inventoriedResource.getParentResourceContext(), mbean);

        ResourceUpgradeReport ret = null;
View Full Code Here

     * @throws RuntimeException if failed to get the agent management MBean - this should really never occur since that
     *                          MBean should always been available whenever the agent is started
     */
    static AgentManagementMBean getAgentManagementMBean() {
        try {
            AgentManagementMBean mbean;

            mbean = MBeanServerInvocationHandler
                .newProxyInstance(getAgentManagementMBeanServer(), AgentManagement.singletonObjectName,
                    AgentManagementMBean.class, false);

View Full Code Here

    }

    public Configuration loadResourceConfiguration() {
        // the agent preferences are simple name/value pairs; just create a Configuration
        // with a bunch of simple properties, one simple property for each agent preference
        AgentManagementMBean mbean = AgentDiscoveryComponent.getAgentManagementMBean();
        Properties agent_prefs = mbean.getAgentConfiguration();
        Configuration config = new Configuration();

        for (Map.Entry<Object, Object> pref : agent_prefs.entrySet()) {
            config.put(new PropertySimple(pref.getKey().toString(), pref.getValue()));
        }
View Full Code Here

                prefsToRemove.add(config_name);
            }
        }

        try {
            AgentManagementMBean mbean = AgentDiscoveryComponent.getAgentManagementMBean();
            mbean.mergeIntoAgentConfiguration(prefsToMerge);
            mbean.removeFromAgentConfiguration(prefsToRemove);
            request.setStatus(ConfigurationUpdateStatus.SUCCESS);
        } catch (Exception e) {
            request.setErrorMessage(new ExceptionPackage(Severity.Severe, e).toString());
        }
View Full Code Here

        return;
    }

    public SnapshotReportResults getSnapshotReport(SnapshotReportRequest request) throws Exception {
        AgentManagementMBean mbean = AgentDiscoveryComponent.getAgentManagementMBean();
        ResourceContext resourceContext = getResourceContext();
        Configuration pluginConfig = resourceContext.getPluginConfiguration();
        String installDir = mbean.getAgentHomeDirectory();
        Properties config = mbean.getAgentConfiguration();
        String tmpDir = resourceContext.getTemporaryDirectory().getAbsolutePath();
        String name = request.getName();
        String description = request.getDescription();
        AgentSnapshotReport report = new AgentSnapshotReport(name, description, pluginConfig, installDir, config,
            tmpDir);
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.agent.AgentManagementMBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.