Package org.mc4j.ems.connection.bean.operation

Examples of org.mc4j.ems.connection.bean.operation.EmsOperation.invoke()


    public void compact(String keyspace, String... columnFamilies) {
        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN);
        EmsOperation operation = emsBean.getOperation(COMPACT_OPERATION, String.class, String[].class);

        operation.invoke(keyspace, columnFamilies);
    }

    public void takeSnapshot(String keyspace, String snapshotName) {
        takeSnapshot(new String[]{keyspace}, snapshotName);
    }
View Full Code Here


    }

    public void takeSnapshot(String[] keySpaces, String snapshotName) {
        EmsBean emsBean = loadBean(STORAGE_SERVICE_BEAN);
        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");
View Full Code Here

        String snapshotName = parameters.getSimpleValue("snapshotName");
        if (snapshotName == null || snapshotName.trim().isEmpty()) {
            snapshotName = System.currentTimeMillis() + "";
        }

        operation.invoke(snapshotName, new String[] {});

        return new OperationResult();
    }

    private OperationResult setLog4jLevel(Configuration parameters) {
View Full Code Here

        EmsOperation operation = emsBean.getOperation("setLog4jLevel", String.class, String.class);

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

        operation.invoke(classQualifier, level);

        return new OperationResult();
    }

    @Override
View Full Code Here

        OperationResult result = null;
        if ("resetStatistics".equals(name)) {
            for (EmsBean bean : interceptors) {
                EmsOperation ops = bean.getOperation("resetStatistics");
                if (ops != null) // base bean has no resetStatistics
                    ops.invoke(new Object[] {});
            }
            result = null; // no result

        } else if ("listAssociatedMBeans".equals(name)) {
            StringBuilder sb = new StringBuilder();
View Full Code Here

    }

    @Override
    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
        EmsOperation operation = getEmsBean().getOperation("getEntityStatistics");
        Object entityStatistics = operation.invoke(getResourceContext().getResourceKey());

        for (MeasurementScheduleRequest request : requests) {
            Object val = super.lookupAttributeProperty(entityStatistics, request.getName());

            report.addData(new MeasurementDataNumeric(request, ((Number) val).doubleValue()));
View Full Code Here

                + this.jbossWebMBean.getBeanName() + "]");
        }

        // NOTE: None of the supported operations have any parameters or return values, which makes our job easier.
        Object[] paramValues = new Object[0];
        mbeanOperation.invoke(paramValues);
        int state = (Integer) this.jbossWebMBean.getAttribute("state").refresh();
        int expectedState = getExpectedPostExecutionState(operation);

        // regardless of the new state, the avail may have changed, request an avail check
        getResourceContext().getAvailabilityContext().requestAvailabilityCheck();
View Full Code Here

            throw new IllegalStateException("Operation [" + name + "] not found on bean ["
                + this.webModuleMBean.getBeanName() + "]");
        }

        Object[] paramValues = new Object[0];
        mbeanOperation.invoke(paramValues);

        if (!WarOperation.DESTROY.equals(operation)) {
            String state = null;
            try {
                // check to see if the mbean is truly active
View Full Code Here

        if (connection == null) {
            throw new RuntimeException("Can not connect to the server");
        }
        EmsBean bean = connection.getBean(SERVER_MBEAN_NAME);
        EmsOperation operation = bean.getOperation("storeConfig");
        operation.invoke(new Object[0]);

        return ("Tomcat configuration updated.");
    }

    private static void applyEnvironmentVars(PropertyList environment, ProcessExecution processExecution) {
View Full Code Here

         */
        try {
            List<EmsParameter> params = operation.getParameters();
            int count = params.size();
            if (count == 0)
                operation.invoke(new Object[0]);
            else { // overloaded operation
                operation.invoke(new Object[] { 0 }); // return code of 0
            }
        } catch (RuntimeException e) {
            throw new ExecutionFailedException("Shutting down the server using JMX failed: " + e.getMessage(), e);
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.