VSensorLoader extends Thread { public boolean prepareStreamSource ( VSensorConfig vsensorConfig,InputStream inputStream , StreamSource streamSource ) throws InstantiationException, IllegalAccessException { streamSource.setInputStream(inputStream); AbstractWrapper wrapper = null; for ( AddressBean addressBean : streamSource.getAddressing ( ) ) { addressBean.setInputStreamName(inputStream.getInputStreamName()); addressBean.setVirtualSensorName(vsensorConfig.getName()); wrapper = findWrapper(addressBean); try { if (wrapper!=null && prepareStreamSource( streamSource,wrapper.getOutputFormat(),wrapper)) break; else wrapper=null; } catch (SQLException e) { logger.error(e.getMessage(),e); logger.error("Preparation of the stream source failed : "+streamSource.getAlias()+ " from the input stream : "+inputStream.getInputStreamName()); } } return (wrapper!=null); } 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( ); 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 findWrapper(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 testPrepareStreamSource() { }