Search in sources :

Example 1 with JAXRSInvoker

use of org.apache.cxf.jaxrs.JAXRSInvoker in project cxf by apache.

the class JAXRSUtilsTest method invokeCustomerMethod.

private void invokeCustomerMethod(ClassResourceInfo cri, Customer customer, Server server) throws Exception {
    OperationResourceInfo ori = cri.getMethodDispatcher().getOperationResourceInfo(Customer.class.getMethod("test", new Class[] {}));
    JAXRSInvoker invoker = new JAXRSInvoker();
    Exchange exc = new ExchangeImpl();
    exc.put(Endpoint.class, server.getEndpoint());
    Message inMessage = new MessageImpl();
    exc.setInMessage(inMessage);
    exc.put(OperationResourceInfo.class, ori);
    invoker.invoke(exc, Collections.emptyList(), customer);
}
Also used : Exchange(org.apache.cxf.message.Exchange) Message(org.apache.cxf.message.Message) Customer(org.apache.cxf.jaxrs.Customer) OperationResourceInfo(org.apache.cxf.jaxrs.model.OperationResourceInfo) MessageImpl(org.apache.cxf.message.MessageImpl) JAXRSInvoker(org.apache.cxf.jaxrs.JAXRSInvoker) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Aggregations

Customer (org.apache.cxf.jaxrs.Customer)1 JAXRSInvoker (org.apache.cxf.jaxrs.JAXRSInvoker)1 OperationResourceInfo (org.apache.cxf.jaxrs.model.OperationResourceInfo)1 Exchange (org.apache.cxf.message.Exchange)1 ExchangeImpl (org.apache.cxf.message.ExchangeImpl)1 Message (org.apache.cxf.message.Message)1 MessageImpl (org.apache.cxf.message.MessageImpl)1