public StyleProcessProvider( String processId, ResourceMetadata<ProcessProvider> metadata ) { this.metadata = metadata; idtoProcess.put( new CodeType( processId ), new GenericWPSProcess( getDescription( processId ), new StyleProcesslet() ) ); }
@Override public void init() { for ( ProcessDefinition processDefinition : processDefs ) { CodeType processId = new CodeType( processDefinition.getIdentifier().getValue(), processDefinition.getIdentifier().getCodeSpace() ); String className = processDefinition.getJavaClass(); try { LOG.info( "Initializing process with id '" + processId + "'" ); LOG.info( "- process class: " + className ); Processlet processlet = (Processlet) Class.forName( className, true, workspace.getModuleClassLoader() ).newInstance(); processlet.init(); ExceptionCustomizer customizer = null; if ( processlet instanceof ExceptionAwareProcesslet ) { customizer = ( (ExceptionAwareProcesslet) processlet ).getExceptionCustomizer(); } WPSProcess process = new GenericWPSProcess( processDefinition, processlet, customizer ); idToProcess.put( processId, process ); } catch ( Exception e ) { String msg = "Could not create process instance. Class name ('" + className + "') was not found on the classpath. " + "Hint: spelling in configuration file might be incorrect."; throw new ResourceInitException( msg, e ); } } }