Package org.apache.geronimo.gbean

Examples of org.apache.geronimo.gbean.GOperationSignature


        return invokers;
    }

    private GBeanInvoker createRawGBeanInvoker(RawInvoker rawInvoker, Method method, Map operations, Map attributes) {
        if (operations.containsKey(new GOperationSignature(method))) {
            int methodIndex = ((Integer) operations.get(new GOperationSignature(method))).intValue();
            return new RawOperationInvoker(rawInvoker, methodIndex);
        }

        if (method.getName().startsWith("get")) {
            String attributeName = method.getName().substring(3);
View Full Code Here


        // build operationName->operationInfo map
        MBeanOperationInfo[] operationInfos = info.getOperations();
        Map operations = new HashMap(operationInfos.length);
        for (int i = 0; i < operationInfos.length; i++) {
            MBeanOperationInfo operationInfo = operationInfos[i];
            operations.put(new GOperationSignature(operationInfo), operationInfo);
        }

        // build the method lookup table
        FastClass fastClass = FastClass.create(proxyType);
        GBeanInvoker[] invokers = new GBeanInvoker[fastClass.getMaxIndex() + 1];
View Full Code Here

        return invokers;
    }

    private GBeanInvoker createJMXGBeanInvoker(MBeanServerConnection server, Method method, Map operations, Map attributes) {
        if (operations.containsKey(new GOperationSignature(method))) {
            return new JMXOperationInvoker(server, method);
        }

        String name = method.getName();
        if (name.startsWith("get")) {
View Full Code Here

        // build operationName->operationInfo map
        MBeanOperationInfo[] operationInfos = info.getOperations();
        Map operations = new HashMap(operationInfos.length);
        for (int i = 0; i < operationInfos.length; i++) {
            MBeanOperationInfo operationInfo = operationInfos[i];
            operations.put(new GOperationSignature(operationInfo), operationInfo);
        }

        // build the method lookup table
        Method[] methods = proxyType.getMethods();
        Map invokers = new HashMap(methods.length);
View Full Code Here

        return invokers;
    }

    private GBeanInvoker createJMXGBeanInvoker(MBeanServerConnection server, Method method, Map operations, Map attributes) {
        if (operations.containsKey(new GOperationSignature(method))) {
            return new JMXOperationInvoker(server, method);
        }

        String name = method.getName();
        if (name.startsWith("get")) {
View Full Code Here

        // operations
        Map operationsMap = new HashMap();
        for (Iterator iterator = gbeanInfo.getOperations().iterator(); iterator.hasNext();) {
            GOperationInfo operationInfo = (GOperationInfo) iterator.next();
            GBeanMBeanOperation operation = new GBeanMBeanOperation(this, operationInfo);
            GOperationSignature signature = new GOperationSignature(operation.getName(), operation.getParameterTypes());
            operationsMap.put(signature, operation);
        }
        addManagedObjectOperations(operationsMap);
        operations = new GBeanMBeanOperation[operationsMap.size()];
        int opCounter = 0;
View Full Code Here

     * @param types types of the operation arguemtns
     * @return the result of the operation
     * @throws ReflectionException if a problem occurs while invokeing the operation
     */
    public Object invoke(String operationName, Object[] arguments, String[] types) throws ReflectionException {
        GOperationSignature signature = new GOperationSignature(operationName, types);
        Integer index = (Integer) operationIndex.get(signature);
        if (index == null) {
            throw new ReflectionException(new NoSuchMethodException("Unknown operation " + signature));
        }
        GBeanMBeanOperation operation = operations[index.intValue()];
View Full Code Here

                        },
                        null));
    }

    private void addManagedObjectOperations(Map operationsMap) {
        operationsMap.put(new GOperationSignature("start", Collections.EMPTY_LIST),
                new GBeanMBeanOperation(this,
                "start",
                Collections.EMPTY_LIST,
                Void.TYPE,
                new MethodInvoker() {
                    public Object invoke(Object target, Object[] arguments) throws Exception {
                        start();
                        return null;
                    }
                }));

        operationsMap.put(new GOperationSignature("startRecursive", Collections.EMPTY_LIST),
                new GBeanMBeanOperation(this,
                "startRecursive",
                Collections.EMPTY_LIST,
                Void.TYPE,
                new MethodInvoker() {
                    public Object invoke(Object target, Object[] arguments) throws Exception {
                        startRecursive();
                        return null;
                    }
                }));

        operationsMap.put(new GOperationSignature("stop", Collections.EMPTY_LIST),
                new GBeanMBeanOperation(this,
                "stop",
                Collections.EMPTY_LIST,
                Void.TYPE,
                new MethodInvoker() {
View Full Code Here

        // operations
        Map operationsMap = new HashMap();
        for (Iterator iterator = gbeanInfo.getOperations().iterator(); iterator.hasNext();) {
            GOperationInfo operationInfo = (GOperationInfo) iterator.next();
            GOperationSignature signature = new GOperationSignature(operationInfo.getName(), operationInfo.getParameterList());
            // do not allow overriding of framework operations
            if (!operationsMap.containsKey(signature)) {
                GBeanOperation operation = new GBeanOperation(this, operationInfo);
                operationsMap.put(signature, operation);
            }
View Full Code Here

     * @throws Exception                if a target instance throws and exception
     * @throws NoSuchOperationException if the operation signature is not found in the map
     * @throws IllegalStateException    if the gbean instance has been destroyed
     */
    public Object invoke(String operationName, Object[] arguments, String[] types) throws Exception, NoSuchOperationException {
        GOperationSignature signature = new GOperationSignature(operationName, types);
        Integer index = (Integer) operationIndex.get(signature);
        if (index == null) {
            throw new NoSuchOperationException("Unknown operation " + signature);
        }
        GBeanOperation operation = operations[index.intValue()];
View Full Code Here

TOP

Related Classes of org.apache.geronimo.gbean.GOperationSignature

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.