Object execute(Request req, Operation opDescriptor) throws Throwable { Service serviceDescriptor = opDescriptor.getService(); Object serviceBean = serviceDescriptor.getService(); Object[] parameters = opDescriptor.getParameters(); // step 5: execute Object result = null; try { if (serviceBean instanceof DirectInvocationService) { // invokeDirect expects the operation to be called as declared in the operation // descriptor, although it used to match a method name, lets use the declared // operation name for contract compliance. String operationName = opDescriptor.getId(); result = ((DirectInvocationService) serviceBean) .invokeDirect(operationName, parameters); } else { Method operation = opDescriptor.getMethod(); result = operation.invoke(serviceBean, parameters); } } catch (Exception e) { if (e.getCause() != null) { throw e.getCause(); } throw e; } return fireOperationExecutedCallback(req, opDescriptor, result); }
public Service serviceDispatched(Request request, Service service) { Object s = service.getService();
@Override public Object operationExecuted( Request request, Operation operation, Object result) { Operation op = Dispatcher.REQUEST.get().getOperation(); assertNotNull(op); assertTrue(op.getService().getService() instanceof HelloWorld); assertTrue(op.getParameters()[0] instanceof Message); return result; } });
Object serviceBean = serviceDescriptor.getService(); Method operation = OwsUtils.method(serviceBean.getClass(), req.getRequest());
@Override protected void qualifyRequest( WorkspaceInfo ws, PublishedInfo l, Service service, Request request) { if (WebMapService.class.isInstance(service.getService())) { String layers = (String) request.getRawKvp().get("LAYERS"); if (layers != null) { request.getRawKvp().put("LAYERS", qualifyLayerNamesKVP(layers, ws)); } layers = (String) request.getRawKvp().get("QUERY_LAYERS"); if (layers != null) { request.getRawKvp().put("QUERY_LAYERS", qualifyLayerNamesKVP(layers, ws)); } String layer = (String) request.getRawKvp().get("LAYER"); if (layer != null) { request.getRawKvp().put("LAYER", qualifyName(layer, ws)); } String styles = (String) request.getRawKvp().get("STYLES"); if (styles != null && !styles.trim().isEmpty()) { request.getRawKvp().put("STYLES", qualifyStyleNamesKVP(styles, ws)); } String style = (String) request.getRawKvp().get("STYLE"); if (style != null && !style.trim().isEmpty()) { request.getRawKvp().put("STYLE", qualifyStyleName(style, ws)); } } }