/** * Look up an implementation of the named process on the classpath. * * @param name Name of the Process to create * @return created process */ public static synchronized Process createProcess(Name name) { ProcessFactory factory = createProcessFactory(name); if (factory == null) return null; return factory.create(name); }
/** * Look up an implementation of the named process on the classpath and describe the input * parameter required. * * @param name Name of the Process * @return Description of the parameters required */ public static synchronized Map<String, Parameter<?>> getParameterInfo(Name name) { ProcessFactory factory = createProcessFactory(name); if (factory == null) return null; return factory.getParameterInfo(name); }
/** * Look up an implementation of the named process on the classpath and describe the expected * results. * * <p>Note the expected results are generated in part by the input parameters provided; this is * to allow for processes where the output is controlled by the parameters (such as choosing a * greyscale or color raster product; or choosing the version of GML produced etc...). * * @param name Name of the Process * @param parameters * @return Description of the parameters required */ public static synchronized Map<String, Parameter<?>> getResultInfo( Name name, Map<String, Object> parameters) { ProcessFactory factory = createProcessFactory(name); if (factory == null) return null; return factory.getResultInfo(name, parameters); }
/** * Look up an implementation of the named process on the classpath and describe the input * parameter required. * * @param name Name of the Process * @return Description of the parameters required */ public static synchronized Map<String, Parameter<?>> getParameterInfo(Name name){ ProcessFactory factory = createProcessFactory( name ); if( factory == null ) return null; return factory.getParameterInfo(name); }
/** * Look up an implementation of the named process on the classpath. * @param name Name of the Process to create * @return created process */ public static synchronized Process createProcess(Name name){ ProcessFactory factory = createProcessFactory( name ); if( factory == null ) return null; return factory.create(name); }
/** * Look up an implementation of the named process on the classpath and describe the expected * results. * <p> * Note the expected results are generated in part by the input parameters provided; this is to * allow for processes where the output is controlled by the parameters (such as choosing a * greyscale or color raster product; or choosing the version of GML produced etc...). * * @param name Name of the Process * @param parameters * @return Description of the parameters required */ public static synchronized Map<String, Parameter<?>> getResultInfo(Name name, Map<String, Object> parameters){ ProcessFactory factory = createProcessFactory( name ); if( factory == null ) return null; return factory.getResultInfo(name, parameters); }
/** * Look up a Factory by name of a process it supports. * * @param name Name of the Process you wish to work with * @param applyFilters Whether to apply the available {@link ProcessFilter} to the returned * factory, or not (if the code needs to check the original process factory by class name * for example, better not to apply the filters, which often wrap the factories to add extra * functionality) * @return ProcessFactory capable of creating an instanceof the named process */ public static ProcessFactory createProcessFactory(Name name, boolean applyFilters) { ProcessFactory pf = Processors.createProcessFactory(name); if (applyFilters) { pf = applyFilters(pf); } // JD: also check the names, this could be a filtered process factory with only a subset // disabled if (pf != null && !pf.getNames().contains(name)) { pf = null; } return pf; }
boolean hasComplexOutputs() { ProcessFactory pf = Processors.createProcessFactory(request.getProcessName()); Map<String, Parameter<?>> resultInfo = pf.getResultInfo(request.getProcessName(), inputs); for (Parameter<?> param : resultInfo.values()) { List<ProcessParameterIO> ppios = ProcessParameterIO.findAll(param, applicationContext); for (ProcessParameterIO ppio : ppios) { if(ppio instanceof ComplexPPIO) { return true; } } } return false; }
private void processDescription(Name identifier) { if ("all".equalsIgnoreCase(identifier.getLocalPart()) && identifier.getNamespaceURI() == null) { this.processDescriptionAll(); return; } ProcessFactory pf = Processors.createProcessFactory(identifier); if (null == pf) { throw new WPSException("Invalid identifier", "InvalidParameterValue"); } if (false == this.dataTransformer.isTransmutable(pf, identifier)) { throw new WPSException("Invalid identifier", "InvalidParameterValue"); } this.processDescription(pf, identifier); }
@Override public Map<String, Object> submitChained(String executionId, Name processName, Map<String, Object> inputs) throws ProcessException { // straight execution, no thread pooling, we're already running in the parent process thread ProcessListener listener = new ProcessListener(new ExecutionStatus(processName, executionId, ProcessState.RUNNING, 0)); ProcessFactory pf = Processors.createProcessFactory(processName); if (pf == null) { throw new WPSException("No such process: " + processName); } // execute the process in the same thread as the caller Process p = pf.create(processName); Map<String, Object> result = p.execute(inputs, listener); if (listener.exception != null) { throw new ProcessException("Process failed: " + listener.exception.getMessage(), listener.exception); } return result; }
@Override public Map<String, Object> call() throws Exception { resourceManager.setCurrentExecutionId(status.getExecutionId()); status.setPhase(ProcessState.RUNNING); ProcessListener listener = status.listener; Name processName = status.getProcessName(); ProcessFactory pf = Processors.createProcessFactory(processName); if (pf == null) { throw new WPSException("No such process: " + processName); } // execute the process Map<String, Object> result = null; try { Process p = pf.create(processName); result = p.execute(inputs, listener); if (listener.exception != null) { throw new WPSException("Process failed: " + listener.exception.getMessage(), listener.exception); } return result; } finally { // update status unless cancelled if (status.getPhase() == ProcessState.RUNNING) { status.setPhase(ProcessState.COMPLETED); } } }
public void testSPI() throws Exception { NameImpl boundsName = new NameImpl("bean", "Bounds"); ProcessFactory factory = Processors.createProcessFactory(boundsName); assertNotNull(factory); assertTrue(factory instanceof BeanProcessFactory); org.geotools.process.Process buffer = Processors .createProcess(boundsName); assertNotNull(buffer); }
ProcessFactory pf = Processors.createProcessFactory(processName); if(pf == null) { throw new WPSException("Unknown process " + processName);
ProcessFactory pf = Processors.createProcessFactory(processName); if (pf == null) { throw new WPSException("No such process: " + processName);
void processDescription( CodeType id, ProcessDescriptionsType pds ) { Name name = Ows11Util.name(id); ProcessFactory pf = Processors.createProcessFactory(name); if ( pf == null ) { throw new WPSException( "No such process: " + id.getValue() ); } ProcessDescriptionType pd = wpsf.createProcessDescriptionType(); pds.getProcessDescription().add( pd ); pd.setProcessVersion( "1.0.0" ); pd.setIdentifier( Ows11Util.code( id.getValue() ) ); pd.setTitle( Ows11Util.languageString(pf.getTitle(name)) ); pd.setAbstract( Ows11Util.languageString(pf.getDescription(name)) ); pd.setStatusSupported(true); pd.setStoreSupported(true); //data inputs DataInputsType inputs = wpsf.createDataInputsType(); pd.setDataInputs(inputs); dataInputs( inputs, pf, name ); //process outputs ProcessOutputsType outputs = wpsf.createProcessOutputsType(); pd.setProcessOutputs( outputs ); processOutputs( outputs, pf, name ); }
ProcessFactory pf = Processors.createProcessFactory(processName); final ProcessBriefType process = f.createProcessBriefType(); response.setProcess(process);