Package org.mc4j.ems.connection.bean.attribute

Examples of org.mc4j.ems.connection.bean.attribute.EmsAttribute.refresh()


        try {
            String baseName = getBaseName(context.getSystemInformation());

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


    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(), baseName);
                if (file.exists()) {
                    discoveries.add(createDetails(context, version, file));
View Full Code Here

        for (PropertyDefinition property : configurationDefinition.getPropertyDefinitions().values()) {
            if (property instanceof PropertyDefinitionSimple) {
                EmsAttribute attribute = getEmsBean().getAttribute(property.getName());
                if (attribute != null) {
                    configuration.put(new PropertySimple(property.getName(), attribute.refresh()));
                }
            }
        }

        return configuration;
View Full Code Here

        try {
            String baseName = getBaseName(context.getSystemInformation());

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

    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(), baseName);
                if (file.exists()) {
                    discoveries.add(createDetails(context, version, file));
View Full Code Here

    private static String getSystemProperty(EmsBean runtimeMBean, String propertyName) throws Exception {
        // We must use reflection for the Open MBean classes (TabularData and CompositeData) to avoid
        // ClassCastExceptions due to EMS having used a different classloader than us to load them.
        EmsAttribute systemPropertiesAttribute = runtimeMBean.getAttribute("systemProperties");
        Object tabularDataObj = systemPropertiesAttribute.refresh();
        Method getMethod = tabularDataObj.getClass().getMethod("get",
            new Class[] { Class.forName("[Ljava.lang.Object;") });
        // varargs don't work out when the arg itself is an array, so specify the parameters explicitly using arrays.
        Object compositeDataObj = getMethod.invoke(tabularDataObj, new Object[] { new Object[] { propertyName } });
        getMethod = compositeDataObj.getClass().getMethod("get", String.class);
View Full Code Here

            }
        }

        EmsAttribute namesAttribute = getEmsBean().getAttribute("LoggerNames");

        String[] names = (String[]) namesAttribute.refresh();

        //There should only be 50 elements (checked against jmx-console, but it is returning 51 the first element is blank
        //so I put code in the for loop to not add if the name is blank
        Arrays.sort(names);
View Full Code Here

            String attributeName = name.substring(name.lastIndexOf(':') + 1);

            try {
                EmsAttribute attribute = getEmsBean().getAttribute(attributeName);

                Object valueObject = attribute.refresh();

                if (attributeName.equals("aliases")) {
                    String[] vals = (String[]) valueObject;
                    MeasurementDataTrait mdt = new MeasurementDataTrait(request, Arrays.toString(vals));
                    report.addData(mdt);
View Full Code Here

                    log.warn("Bean " + beanName + " not found, skipping ...");
                    continue;
                }

                EmsAttribute attribute = eBean.getAttribute(attributeName);
                Object valueObject = attribute.refresh();
               
                if (valueObject != null) {
                    if (request.getDataType() == DataType.TRAIT) {
                        report.addData(new MeasurementDataTrait(request, valueObject.toString()));
                  } else { // numeric
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.