Examples of EmsBean


Examples of org.mc4j.ems.connection.bean.EmsBean

        EmsOperation operation = emsBean.getOperation(SNAPSHOT_OPERATION, String.class, String[].class);
        operation.invoke(snapshotName, keySpaces);
    }

    public String[] getKeySpaceDataFileLocations() {
        EmsBean emsBean = loadBean(KeyspaceService.STORAGE_SERVICE_BEAN);
        EmsAttribute attribute = emsBean.getAttribute("AllDataFileLocations");
        return (String[]) attribute.getValue();
    }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

    @SuppressWarnings("unchecked")
    public List<Object> getKeyspaces() {
        List<Object> value = null;

        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN);
        if (emsBean != null) {
            EmsAttribute attribute = emsBean.getAttribute("Keyspaces");
            if (attribute != null) {
                value = (List<Object>) attribute.refresh();
            }
        }
        if (value == null) {
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

        }
        return dirs;
    }

    private EmsBean loadBean(String objectName) {
        EmsBean bean = emsConnection.getBean(objectName);
        if (bean == null) {
            // In some cases, this resource component may have been discovered by some means other than querying its
            // parent's EMSConnection (e.g. ApplicationDiscoveryComponent uses a filesystem to discover EARs and
            // WARs that are not yet deployed). In such cases, getBean() will return null, since EMS won't have the
            // bean in its cache. To cover such cases, make an attempt to query the underlying MBeanServer for the
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

    @Override
    public AvailabilityType getAvailability() {
        ResourceContext<?> context = getResourceContext();
        try {
            EmsBean emsBean = loadBean();
            if (emsBean == null) {
                log.warn("Unable to establish JMX connection to " + context.getResourceKey());
                return DOWN;
            }

            AvailabilityType availability = UP;

            EmsAttribute nativeTransportEnabledAttr = emsBean.getAttribute("NativeTransportRunning");
            Boolean nativeTransportEnabled = (Boolean) nativeTransportEnabledAttr.getValue();

            if (!nativeTransportEnabled) {
                if (log.isWarnEnabled()) {
                    log.warn("Native transport is disabled for " + context.getResourceKey());
                }
                availability = DOWN;
            }

            EmsAttribute initializedAttr = emsBean.getAttribute("Initialized");
            Boolean initialized = (Boolean) initializedAttr.getValue();

            if (!initialized) {
                if (log.isWarnEnabled()) {
                    log.warn(context.getResourceKey() + " is not initialized");
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

        return super.invokeOperation(name, parameters);
    }

    private OperationResult takeSnapshot(Configuration parameters) {
        EmsBean emsBean = getEmsBean();
        EmsOperation operation = emsBean.getOperation("takeSnapshot", String.class, String[].class);
        String snapshotName = parameters.getSimpleValue("snapshotName");
        if (snapshotName == null || snapshotName.trim().isEmpty()) {
            snapshotName = System.currentTimeMillis() + "";
        }
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

        return new OperationResult();
    }

    private OperationResult setLog4jLevel(Configuration parameters) {
        EmsBean emsBean = getEmsBean();
        EmsOperation operation = emsBean.getOperation("setLog4jLevel", String.class, String.class);

        String classQualifier = parameters.getSimpleValue("classQualifier");
        String level = parameters.getSimpleValue("level");

        operation.invoke(classQualifier, level);
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

        boolean skipUnknownProps) {

        Set<DiscoveredResourceDetails> results = super.discoverResources(context, skipUnknownProps);

        for (DiscoveredResourceDetails discoveredResource : results) {
            EmsBean emsBean = loadBean(context.getParentResourceComponent(), discoveredResource.getResourceKey());

            if (emsBean != null) {
                String name = emsBean.getClassTypeName();

                name = name.substring(name.lastIndexOf(".") + 1);
                name = name.substring(0, name.lastIndexOf("LoadMetric"));

                discoveredResource.setResourceName(name);
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

            ClassLoader cl = Thread.currentThread().getContextClassLoader();
            try {
                Thread.currentThread().setContextClassLoader(getEmsBean().getClass().getClassLoader());

                String className = this.resourceContext.getPluginConfiguration().getSimple(CLASS_NAME).getStringValue();
                EmsBean emsBean = getEmsBean();

                if (className.equals(emsBean.getClassTypeName())) {
                    return AvailabilityType.UP;
                }
            } catch (Exception e) {
                log.info(e);
                return AvailabilityType.DOWN;
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

                    bean += name.substring(0, pos);
                }
                String attr = name.substring(pos + 1);

                EmsConnection conn = parentServer.getEmsConnection();
                EmsBean eBean = conn.getBean(bean);
                if (eBean != null) {
                    List<String> attrs = new ArrayList<String>();
                    eBean.refreshAttributes(attrs); // only refresh selecte attrs, as there might be non-serializable ones
                    EmsAttribute eAttr = eBean.getAttribute(attr);
                    if (metric.getDataType() == DataType.MEASUREMENT) {
                        Double val = ((Number) (eAttr.getValue())).doubleValue();

                        MeasurementDataNumeric ret = new MeasurementDataNumeric(metric, val);
                        report.addData(ret);
View Full Code Here

Examples of org.mc4j.ems.connection.bean.EmsBean

     * @see org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent#discoverResources(org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext)
     */
    public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent<?>> context) {
        String jvmRoute = this.getJvmRoute(context);

        EmsBean configBean = context.getParentResourceComponent().getEmsBean();
        String rawProxyInfo = JBossHelper.getRawProxyInfo(configBean);

        ProxyInfo proxyInfo = new ProxyInfo(rawProxyInfo);
        Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();

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.