VSensorLoader extends Thread { public boolean createInputStreams ( VirtualSensor pool ) throws InstantiationException, IllegalAccessException { logger.debug ( new StringBuilder ( ).append ( "Preparing input streams for: " ).append ( pool.getConfig().getName ( ) ).toString ( ) ); if ( pool.getConfig().getInputStreams ( ).size ( ) == 0 ) logger.warn ( new StringBuilder ( "There is no input streams defined for *" ).append ( pool.getConfig().getName ( ) ).append ( "*" ).toString ( ) ); ArrayList<StreamSource> sources = new ArrayList<StreamSource>(); ArrayList<InputStream> streams = new ArrayList<InputStream>(); for ( Iterator < InputStream > inputStreamIterator = pool.getConfig().getInputStreams ( ).iterator ( ) ; inputStreamIterator.hasNext ( ) ; ) { InputStream inputStream = inputStreamIterator.next ( ); for ( StreamSource dataSouce : inputStream.getSources ( )) { if ( ! prepareStreamSource( pool.getConfig(),inputStream , dataSouce )){ for (StreamSource ss : sources){ releaseStreamSource(ss); } for (InputStream is : streams){ is.release(); } return false; } sources.add(dataSouce); } streams.add(inputStream); inputStream.setPool (pool ); } return true; } VSensorLoader();  VSensorLoader( String pluginsPath ); void addVSensorStateChangeListener(VSensorStateChangeListener listener); void removeVSensorStateChangeListener(VSensorStateChangeListener listener); boolean fireVSensorLoading(VSensorConfig config); boolean fireVSensorUnLoading(VSensorConfig config); static VSensorLoader getInstance(String path); void startLoading(); void run( ); synchronized void loadVirtualSensor(String vsConfigurationFileContent, String fileName); static String getVSConfigurationFilePath(String fileName); synchronized void loadPlugin(); synchronized boolean loadPlugin(String fileFilterName); boolean isVirtualSensorValid(VSensorConfig configuration); void removeAllVSResources( VirtualSensor pool ); void releaseStreamSource(StreamSource streamSource); static Modifications getUpdateStatus(String virtualSensorsPath); static Modifications getUpdateStatus(String virtualSensorsPath, String filterFileName); boolean createInputStreams( VirtualSensor pool ); AbstractWrapper createWrapper(AddressBean addressBean); boolean prepareStreamSource( VSensorConfig vsensorConfig,InputStream inputStream , StreamSource streamSource  ); boolean prepareStreamSource( StreamSource streamSource ,DataField[] outputformat, AbstractWrapper wrapper ); void stopLoading( ); static final String VSENSOR_POOL; static final String STREAM_SOURCE; static final String INPUT_STREAM; }
@Test public void testCreateInputStreams() { }