Package org.apache.cxf.service.invoker

Examples of org.apache.cxf.service.invoker.MethodDispatcher


        }
        return null;
    }

    private Method getMethod(Message message, BindingOperationInfo operation) {       
        MethodDispatcher md = (MethodDispatcher) message.getExchange().
            get(Service.class).get(MethodDispatcher.class.getName());
        return md.getMethod(operation);
    }
View Full Code Here


    public void setUp() throws Exception {
        method = TestService.class.getMethod("echo", new Class[]{});
        Exchange ex = setUpExchange();
        Service service = EasyMock.createMock(Service.class);
        ex.put(Service.class, service);
        MethodDispatcher md = EasyMock.createMock(MethodDispatcher.class);
        service.get(MethodDispatcher.class.getName());
        EasyMock.expectLastCall().andReturn(md);
       
        BindingOperationInfo boi = EasyMock.createMock(BindingOperationInfo.class);
        ex.put(BindingOperationInfo.class, boi);
        md.getMethod(boi);
        EasyMock.expectLastCall().andReturn(method);
        EasyMock.replay(service, md);
    }
View Full Code Here

    }
   
    protected Method getTargetMethod(Message m) {
        BindingOperationInfo bop = m.getExchange().get(BindingOperationInfo.class);
        if (bop != null) {
            MethodDispatcher md = (MethodDispatcher)
                m.getExchange().get(Service.class).get(MethodDispatcher.class.getName());
            return md.getMethod(bop);
        }
        Method method = (Method)m.get("org.apache.cxf.resource.method");
        if (method != null) {
            return method;
        }
View Full Code Here

            throw new IllegalStateException("The client has been closed.");
        }

        Endpoint endpoint = getClient().getEndpoint();
        String address = endpoint.getEndpointInfo().getAddress();
        MethodDispatcher dispatcher = (MethodDispatcher)endpoint.getService().get(
                                                                                  MethodDispatcher.class
                                                                                      .getName());
        Object[] params = args;
        if (null == params) {
            params = new Object[0];
        }       
       
        BindingOperationInfo oi = dispatcher.getBindingOperation(method, endpoint);
        if (oi == null) {
            // check for method on BindingProvider and Object
            if (method.getDeclaringClass().equals(BindingProvider.class)
                || method.getDeclaringClass().equals(Object.class)
                || method.getDeclaringClass().equals(Closeable.class)) {
View Full Code Here

        Message inMessage = message.getExchange().getInMessage();
        Method method = (Method)inMessage.get("org.apache.cxf.resource.method");
        if (method == null) {
            BindingOperationInfo bop = inMessage.getExchange().get(BindingOperationInfo.class);
            if (bop != null) {
                MethodDispatcher md = (MethodDispatcher)
                    inMessage.getExchange().get(Service.class).get(MethodDispatcher.class.getName());
                method = md.getMethod(bop);
            }
        }
        return method;
    }
View Full Code Here

            return method.invoke(this);
        } else if (method.getDeclaringClass().isInstance(client)) {
            return method.invoke(client, args);
        }
       
        MethodDispatcher dispatcher = (MethodDispatcher)endpoint.getService().get(MethodDispatcher.class
                                                                                      .getName());
        BindingOperationInfo oi = dispatcher.getBindingOperation(method, endpoint);
        if (oi == null) {
            throw new Fault(new Message("NO_OPERATION_INFO", LOG, method.getName()));
        }

        Object[] params = args;
View Full Code Here

            throw new IllegalStateException("The client has been closed.");
        }

        Endpoint endpoint = getClient().getEndpoint();
        String address = endpoint.getEndpointInfo().getAddress();
        MethodDispatcher dispatcher = (MethodDispatcher)endpoint.getService().get(
                                                                                  MethodDispatcher.class
                                                                                      .getName());
        Object[] params = args;
        if (null == params) {
            params = new Object[0];
        }       
       
       
        try {
            if (method.getDeclaringClass().equals(BindingProvider.class)
                || method.getDeclaringClass().equals(Object.class)
                || method.getDeclaringClass().equals(Closeable.class)) {
                return method.invoke(this, params);
            } else if (method.getDeclaringClass().isInstance(client)) {
                return method.invoke(client, params);
            }
        } catch (InvocationTargetException e) {
            throw e.getCause();
        }
       
        BindingOperationInfo oi = dispatcher.getBindingOperation(method, endpoint);
        if (oi == null) {
            Message msg = new Message("NO_BINDING_OPERATION_INFO", LOG, method.getName());
            throw new WebServiceException(msg.toString());
        }
View Full Code Here

            throw new IllegalStateException("The client has been closed.");
        }

        Endpoint endpoint = getClient().getEndpoint();
        String address = endpoint.getEndpointInfo().getAddress();
        MethodDispatcher dispatcher = (MethodDispatcher)endpoint.getService().get(
                                                                                  MethodDispatcher.class
                                                                                      .getName());
        Object[] params = args;
        if (null == params) {
            params = new Object[0];
        }       
       
        BindingOperationInfo oi = dispatcher.getBindingOperation(method, endpoint);
        if (oi == null) {
            // check for method on BindingProvider and Object
            if (method.getDeclaringClass().equals(BindingProvider.class)
                || method.getDeclaringClass().equals(Object.class)
                || method.getDeclaringClass().equals(Closeable.class)) {
View Full Code Here

            c.setServiceFactory(this);
        }
    }

    protected void setServiceProperties() {
        MethodDispatcher md = getMethodDispatcher();
        getService().put(MethodDispatcher.class.getName(), md);
        for (Class<?> c : md.getClass().getInterfaces()) {
            getService().put(c.getName(), md);
        }
        if (properties != null) {
            getService().putAll(properties);
        }
View Full Code Here

    }
   
    @Deprecated
    protected void setOldMethodDispatcherProperty() {
        //Try adding the MethodDispatcher using the old interface
        MethodDispatcher md = getMethodDispatcher();
        if (getService().get("org.apache.cxf.frontend.MethodDispatcher") == null) {
            try {
                Class<?> cls = ClassLoaderUtils.loadClass("org.apache.cxf.frontend.MethodDispatcher",
                                                          getClass());
                Object o = Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
View Full Code Here

TOP

Related Classes of org.apache.cxf.service.invoker.MethodDispatcher

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.