/** * Cerate a process (for the indicated name). * * <p>Subclasses can control the process using their implementation of: * * <ul> * <li>{@ #method(String)}: must return a non null method * <li>{@link #createProcessBean(Name)}: return a bean to use; or null for static methods * </ul> */ public Process create(Name name) { String methodName = name.getLocalPart(); Method meth = method(methodName); Object process = createProcessBean(name); if (process != null && (lookupInvertGridGeometry(process, meth.getName()) != null || lookupInvertQuery(process, meth.getName()) != null || lookupCustomizeReadParams(process, meth.getName()) != null)) { return new InvokeMethodRenderingProcess(meth, process); } else { return new InvokeMethodProcess(meth, process); } }
@Override public GeneralParameterValue[] customizeReadParams( Map<String, Object> input, GridCoverageReader reader, GeneralParameterValue[] params) { Method customizeReadParamsMethod = lookupCustomizeReadParams(targetObject, this.method.getName()); if (customizeReadParamsMethod == null) { return params; } try { Object[] args = buildProcessArguments(customizeReadParamsMethod, input, null, true); args[args.length - 2] = reader; args[args.length - 1] = params; return (GeneralParameterValue[]) customizeReadParamsMethod.invoke(targetObject, args); } catch (IllegalAccessException e) { throw new ProcessException(e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t instanceof ProcessException) { throw ((ProcessException) t); } else { throw new ProcessException(t); } } } }
public GridGeometry invertGridGeometry(Map<String, Object> input, Query targetQuery, GridGeometry targetGridGeometry) throws ProcessException { Method invertGridGeometryMethod = lookupInvertGridGeometry(targetObject, this.method.getName() ); if (invertGridGeometryMethod == null) { return targetGridGeometry; } try { Object[] args = buildProcessArguments(invertGridGeometryMethod, input, null, true); args[args.length - 2] = targetQuery; args[args.length - 1] = targetGridGeometry; return (GridGeometry) invertGridGeometryMethod.invoke(targetObject, args); } catch (IllegalAccessException e) { throw new ProcessException(e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t instanceof ProcessException) { throw ((ProcessException) t); } else { throw new ProcessException(t); } } }
public Query invertQuery(Map<String, Object> input, Query targetQuery, GridGeometry targetGridGeometry) throws ProcessException { Method invertQueryMethod = lookupInvertQuery(targetObject, method.getName() ); if (invertQueryMethod == null) { return targetQuery; } try { Object[] args = buildProcessArguments(invertQueryMethod, input, null, true); args[args.length - 2] = targetQuery; args[args.length - 1] = targetGridGeometry; return (Query) invertQueryMethod.invoke(targetObject, args); } catch (IllegalAccessException e) { throw new ProcessException(e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t instanceof ProcessException) { throw ((ProcessException) t); } else { throw new ProcessException(t); } } }
/** * Cerate a process (for the indicated name). * <p> * Subclasses can control the process using their implementation of: * <ul> * <li>{@ #method(String)}: must return a non null method</li> * <li>{@link #createProcessBean(Name)}: return a bean to use; or null for static methods</li> * </ul> */ public Process create(Name name) { String methodName = name.getLocalPart(); Method meth = method(methodName); Object process = createProcessBean(name); if (process != null && (lookupInvertGridGeometry(process, meth.getName()) != null || lookupInvertQuery(process, meth.getName()) != null)) { return new InvokeMethodRenderingProcess(meth, process); } else { return new InvokeMethodProcess(meth, process); } }
public Query invertQuery( Map<String, Object> input, Query targetQuery, GridGeometry targetGridGeometry) throws ProcessException { Method invertQueryMethod = lookupInvertQuery(targetObject, method.getName()); if (invertQueryMethod == null) { return targetQuery; } try { Object[] args = buildProcessArguments(invertQueryMethod, input, null, true); args[args.length - 2] = targetQuery; args[args.length - 1] = targetGridGeometry; return (Query) invertQueryMethod.invoke(targetObject, args); } catch (IllegalAccessException e) { throw new ProcessException(e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t instanceof ProcessException) { throw ((ProcessException) t); } else { throw new ProcessException(t); } } }
public GridGeometry invertGridGeometry( Map<String, Object> input, Query targetQuery, GridGeometry targetGridGeometry) throws ProcessException { Method invertGridGeometryMethod = lookupInvertGridGeometry(targetObject, this.method.getName()); if (invertGridGeometryMethod == null) { return targetGridGeometry; } try { Object[] args = buildProcessArguments(invertGridGeometryMethod, input, null, true); args[args.length - 2] = targetQuery; args[args.length - 1] = targetGridGeometry; return (GridGeometry) invertGridGeometryMethod.invoke(targetObject, args); } catch (IllegalAccessException e) { throw new ProcessException(e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); if (t instanceof ProcessException) { throw ((ProcessException) t); } else { throw new ProcessException(t); } } }