class 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 = createWrapper(addressBean);
			try {
				if (wrapper!=null && prepareStreamSource( streamSource,wrapper.getOutputFormat(),wrapper)) 
					break;
				else
					if (wrapper!=null){
						wrapper.releaseResources();
					}
					wrapper=null;
			} catch (Exception e) {
				if (wrapper!=null){
					try{
					    wrapper.releaseResources();
					}catch(SQLException sql){
						logger.error(sql.getMessage(),sql);
					}
				}
				logger.error("Preparation of the stream source failed : "+streamSource.getAlias()+ " from the input stream : "+inputStream.getInputStreamName()+". " + e.getMessage(),e);
			}
		}
		return (wrapper!=null);
	}

	public  VSensorLoader();
	public  VSensorLoader( String pluginsPath );

}