Package org.rhq.plugins.jbossas.helper

Examples of org.rhq.plugins.jbossas.helper.JBossInstallationInfo


        setPluginConfigurationDefaults(pluginConfiguration);

        ProcessInfo processInfo = null;
        String jbossHomeDir = pluginConfiguration.getSimpleValue(JBossASServerComponent.JBOSS_HOME_DIR_CONFIG_PROP,
            null);// this will never be null
        JBossInstallationInfo installInfo;
        try {
            installInfo = new JBossInstallationInfo(new File(jbossHomeDir));
        } catch (IOException e) {
            throw new InvalidPluginConfigurationException(e);
        }
        String version = installInfo.getVersion();
        if (version.startsWith("5") || version.startsWith("6")) {
            throw new InvalidPluginConfigurationException(
                "The specified server is JBoss AS 5.0 or later - only AS 3.2 or 4.x are valid for this Resource type.");
        }
        DiscoveredResourceDetails resourceDetails = createResourceDetails(discoveryContext, pluginConfiguration,
View Full Code Here


                log.error("Failed to process JBoss AS command line: " + Arrays.asList(processInfo.getCommandLine()), e);
                continue;
            }

            // See if we have an AS 5 or AS 6 - if so, skip it.
            JBossInstallationInfo installInfo = cmdLine.getInstallInfo();
            String version = installInfo.getVersion();
            if (version.startsWith("5") || version.startsWith("6")) {
                if (log.isDebugEnabled())
                    log.debug("Found JBoss AS 5.0 or later, which is not supported by this plugin - skipping...");
                continue;
            }
View Full Code Here

            ObjectName configObjectName = new ObjectName("jboss.system:type=ServerConfig");
            Set set = server.queryNames(configObjectName, null);
            if (set.iterator().hasNext()) {
                // ServerConfig MBean found
                File homeDir = (File) server.getAttribute(configObjectName, "HomeDir");
                JBossInstallationInfo installInfo;
                try {
                    installInfo = new JBossInstallationInfo(homeDir);
                } catch (IOException e) {
                    throw new IllegalStateException("Failed to determine installation info for JBoss home dir ["
                        + homeDir + "].", e);
                }
                File configDir = (File) server.getAttribute(configObjectName, "ServerHomeDir");

                //if (isEmbeddedInServer(configDir)) {
                //    return null; // abort - we are embedded, but we're inside the enterprise Server
                //}

                String configName = (String) server.getAttribute(configObjectName, "ServerName");
                String version = (String) server.getAttribute(configObjectName, "SpecificationVersion");

                Configuration pluginConfiguration = context.getDefaultPluginConfiguration();

                // Set the connection type (used by JMX plugin to connect to the MBean server).
                pluginConfiguration.put(new PropertySimple(JMXDiscoveryComponent.CONNECTION_TYPE,
                    InternalVMTypeDescriptor.class.getName()));

                pluginConfiguration.put(new PropertySimple(JBossASServerComponent.JBOSS_HOME_DIR_CONFIG_PROP, homeDir));
                pluginConfiguration.put(new PropertySimple(JBossASServerComponent.CONFIGURATION_PATH_CONFIG_PROP,
                    configDir));
                pluginConfiguration.put(new PropertySimple(JBossASServerComponent.CONFIGURATION_SET_CONFIG_PROP,
                    configName));

                // Now set default values on any props that are still not set.
                setPluginConfigurationDefaults(pluginConfiguration);

                JBossProductType productType = installInfo.getProductType();
                String name = formatServerName(bindAddress, jnpPort, context.getSystemInformation().getHostname(),
                    configName, productType, isRhqServer(configDir));
                String description = productType.NAME +
                    " server that the RHQ Plugin Container is running within";
                DiscoveredResourceDetails resource = new DiscoveredResourceDetails(context.getResourceType(),
View Full Code Here

TOP

Related Classes of org.rhq.plugins.jbossas.helper.JBossInstallationInfo

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.