Examples of EmsAttribute


Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        return configuration;
    }

    // Reset the String provided by the MBean with a more user friendly longString paired down to just the relevant name
    private void resetConfig(String property, Pattern pattern, Configuration configuration) {
        EmsAttribute attribute = getEmsBean().getAttribute(property);
        Object valueObject = attribute.refresh();
        String[] vals = (String[]) valueObject;
        if (vals.length > 0) {
            String delim = "";
            StringBuilder sb = new StringBuilder();
            Matcher matcher = pattern.matcher("");
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

            // If it is, let's set the plugin config property automatically so we can collect the proper metrics.
            // Note that if the "executorName" attribute on the Connector MBean is "Internal", that means it is NOT shared.
            String connectorON = pluginConfiguration.getSimpleValue(TomcatConnectorComponent.OBJECT_NAME_PROP, null);
            if (connectorON != null) {
                EmsBean connectorBean = connection.getBean(connectorON);
                EmsAttribute executorNameAttrib = connectorBean.getAttribute("executorName");
                if (executorNameAttrib != null) {
                    Object executorNameValue = executorNameAttrib.getValue();
                    if (executorNameValue != null) {
                        String executorName = executorNameValue.toString();
                        if (!executorName.isEmpty() && !executorName.equalsIgnoreCase("Internal")) {
                            pluginConfiguration.put(new PropertySimple(
                                TomcatConnectorComponent.PLUGIN_CONFIG_SHARED_EXECUTOR, executorName));
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        return configuration;
    }

    // Reset the StringArray provided by the MBean with a more user friendly longString
    private void resetConfig(String property, Configuration configuration) {
        EmsAttribute attribute = getEmsBean().getAttribute(property);
        Object valueObject = attribute.refresh();
        String[] vals = (String[]) valueObject;
        if (vals.length > 0) {
            String delim = "";
            StringBuilder sb = new StringBuilder();
            for (String val : vals) {
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        return configuration;
    }

    // Reset the String provided by the MBean with a more user friendly longString paired down to just the relevant name
    private void resetConfig(String property, Pattern pattern, Configuration configuration) {
        EmsAttribute attribute = getEmsBean().getAttribute(property);
        Object valueObject = attribute.refresh();
        String[] vals = (String[]) valueObject;
        if (vals.length > 0) {
            String delim = "";
            StringBuilder sb = new StringBuilder();
            Matcher matcher = pattern.matcher("");
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

            + parentEARComponent.getApplicationName();
        ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(objectNameTemplate);
        List<EmsBean> mBeans = parentJBossASComponent.getEmsConnection().queryBeans(queryUtility.getTranslatedQuery());
        if (mBeans.size() == 1) {
            EmsBean theBean = mBeans.get(0);
            EmsAttribute ddAttr = theBean.getAttribute("deploymentDescriptor");
            ddAttr.refresh();
            ddAttr.getValue();
            String dd = (String) ddAttr.getValue();
            // dd contains application.xml

            InputSource is = new InputSource(new StringReader(dd));

            XPath xp = XPathFactory.newInstance().newXPath();
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

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

        try {
            String baseName = getScriptBaseName(context.getSystemInformation());
            EmsAttribute attrib = context.getParentResourceComponent().getAgentBean().getAttribute("Version");
            String version;
            if (attrib != null && attrib.getValue() != null) {
                version = attrib.getValue().toString();
            } else {
                version = Version.getProductVersion(); // just use the one we can get statically, its probably the correct version
            }

            // we know our agent plugin is running in the same process as our agent
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

     */
    private boolean findInAgentHome(ResourceDiscoveryContext<AgentServerComponent<?>> context, String version,
        String baseName, HashSet<DiscoveredResourceDetails> discoveries) {

        try {
            EmsAttribute home = context.getParentResourceComponent().getAgentBean().getAttribute("AgentHomeDirectory");
            home.refresh();
            Object agentHome = home.getValue();
            if (agentHome != null) {
                File file = new File(agentHome.toString(), "bin/" + baseName);
                if (file.exists()) {
                    discoveries.add(createDetails(context, version, file));
                }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

        OperationResult result = new OperationResult();
        try {
            EmsConnection emsConnection = getEmsConnection();
            EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");

            EmsAttribute operationModeAttr = storageService.getAttribute("OperationMode");
            String operationMode = (String) operationModeAttr.refresh();
            if (operationMode.equals("DECOMMISSIONED")) {
                log.info("The storage node " + getHost() + " is already decommissioned.");
            } else {
                Class<?>[] emptyParams = new Class<?>[0];
                EmsOperation operation = storageService.getOperation("decommission", emptyParams);
                operation.invoke((Object[]) emptyParams);

                operationMode = (String) operationModeAttr.refresh();
                if (!operationMode.equals("DECOMMISSIONED")) {
                    result.setErrorMessage("Failed to decommission storage node " + getHost() + ". The " +
                        "StorageService is reporting " + operationMode + " for its operation mode but it should be " +
                        "reporting DECOMMISSIONED. The StorageService operation mode is not to be confused with the " +
                        "Storage Node operation mode.");
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

                }
            }

            EmsConnection emsConnection = getEmsConnection();
            EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");
            EmsAttribute attribute = storageService.getAttribute("OperationMode");
            String operationMode = (String) attribute.refresh();

            if (!operationMode.equals("NORMAL")) {
                result.setErrorMessage("Bootstrapping " + getHost() + " failed. The StorageService is reporting " +
                    operationMode + " for its operation mode but it should be reporting NORMAL. The StorageService " +
                    "operation mode is not to be confused with the Storage Node operation mode.");
View Full Code Here

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute

                }
            }

            EmsConnection emsConnection = getEmsConnection();
            EmsBean storageService = emsConnection.getBean("org.apache.cassandra.db:type=StorageService");
            EmsAttribute attribute = storageService.getAttribute("OperationMode");
            String operationMode = (String) attribute.refresh();

            if (!operationMode.equals("NORMAL")) {
                result.setErrorMessage("Bootstrapping " + getHost() + " failed. The StorageService is reporting " +
                        operationMode + " for its operation mode but it should be reporting NORMAL. The StorageService " +
                        "operation mode is not to be confused with the Storage Node operation mode.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.