class VSensorLoader extends Thread {

	public AbstractWrapper createWrapper(AddressBean addressBean) throws InstantiationException, IllegalAccessException {

			if ( Main.getWrapperClass ( addressBean.getWrapper ( ) ) == null ) {
				logger.error ( "The wrapper >" + addressBean.getWrapper ( ) + "< is not defined in the >" + WrappersUtil.DEFAULT_WRAPPER_PROPERTIES_FILE + "< file." );
				return null;
			}
			AbstractWrapper wrapper = ( AbstractWrapper ) Main.getWrapperClass ( addressBean.getWrapper ( ) ).newInstance ( );
			wrapper.setActiveAddressBean ( addressBean );
			boolean initializationResult = wrapper.initialize_wrapper (  );
			if ( initializationResult == false )
				return null;
			try {
				logger.debug("Wrapper name: "+wrapper.getWrapperName()+ " -- view name "+ wrapper.getDBAliasInStr());
				if (!Main.getWindowStorage().tableExists(wrapper.getDBAliasInStr(),wrapper.getOutputFormat()))
					Main.getWindowStorage().executeCreateTable ( wrapper.getDBAliasInStr ( ) , wrapper.getOutputFormat ( ),wrapper.isTimeStampUnique() );
			} catch ( Exception e ) {
				try{
				wrapper.releaseResources();  //releasing resources
				}catch (SQLException sql){
					logger.error ( sql.getMessage ( ) , sql );
				}
				logger.error ( e.getMessage ( ) , e );
				return null;
			}
			return wrapper;
	}

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

}