use of org.apache.cxf.service.factory.SimpleMethodDispatcher in project cxf by apache.
the class AegisDatabinding method getMethod.
private Method getMethod(Service s, OperationInfo op) {
Method m = op.getProperty(Method.class.getName(), Method.class);
if (m != null) {
return m;
}
MethodDispatcher md = (MethodDispatcher) s.get(MethodDispatcher.class.getName());
// dependency as long as this null check is here.
if (md == null) {
return null;
}
SimpleMethodDispatcher smd = (SimpleMethodDispatcher) md;
return smd.getPrimaryMethod(op);
}
use of org.apache.cxf.service.factory.SimpleMethodDispatcher in project cxf by apache.
the class MessageUtilsTest method getTargetMethodFromBindingOperationInfo.
@Test
public void getTargetMethodFromBindingOperationInfo() throws Exception {
Method method = MessageUtilsTest.class.getMethod("getTargetMethodFromBindingOperationInfo");
Message message = new MessageImpl();
Exchange exchange = new ExchangeImpl();
message.setExchange(exchange);
OperationInfo oi = new OperationInfo();
oi.setName(QName.valueOf("getTargetMethod_fromBindingOperationInfo"));
BindingOperationInfo boi = new BindingOperationInfo(null, oi);
ServiceImpl serviceImpl = new ServiceImpl();
MethodDispatcher md = new SimpleMethodDispatcher();
md.bind(oi, method);
serviceImpl.put(MethodDispatcher.class.getName(), md);
exchange.put(Service.class, serviceImpl);
exchange.put(BindingOperationInfo.class, boi);
Optional<Method> optMethod = MessageUtils.getTargetMethod(message);
assertTrue(optMethod.isPresent());
assertEquals(method, optMethod.get());
}
Aggregations