Skip to content

Commit

Permalink
replace implicit HDF5 lib loading with explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Apr 26, 2024
1 parent e4f983c commit 389bd5d
Showing 1 changed file with 12 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,27 @@

package cbit.vcell.message.server.bootstrap;

import java.io.File;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.vcell.db.ConnectionFactory;
import org.vcell.db.DatabaseService;
import org.vcell.db.KeyFactory;
import org.vcell.util.AuthenticationException;
import org.vcell.util.document.User;
import org.vcell.util.document.UserLoginInfo;

import cbit.vcell.export.server.ExportServiceImpl;
import cbit.vcell.message.server.dispatcher.SimulationDatabaseDirect;
import cbit.vcell.modeldb.AdminDBTopLevel;
import cbit.vcell.modeldb.DatabaseServerImpl;
import cbit.vcell.resource.NativeLib;
import cbit.vcell.resource.PropertyLoader;
import cbit.vcell.server.ConnectionException;
import cbit.vcell.server.VCellConnection;
import cbit.vcell.server.VCellConnectionFactory;
import cbit.vcell.simdata.Cachetable;
import cbit.vcell.simdata.DataSetControllerImpl;
import ncsa.hdf.object.FileFormat;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.vcell.db.ConnectionFactory;
import org.vcell.db.DatabaseService;
import org.vcell.db.KeyFactory;
import org.vcell.util.AuthenticationException;
import org.vcell.util.document.User;
import org.vcell.util.document.UserLoginInfo;

import java.io.File;
/**
* This type was created in VisualAge.
*/
Expand Down Expand Up @@ -67,7 +66,7 @@ public VCellConnection createVCellConnection(UserLoginInfo userLoginInfo) throws
SimulationDatabaseDirect simulationDatabase = new SimulationDatabaseDirect(adminDbTopLevel, databaseServerImpl, bCache);
ExportServiceImpl exportServiceImpl = new ExportServiceImpl();
LocalVCellConnection vcConn = new LocalVCellConnection(userLoginInfo, simulationDatabase, dataSetControllerImpl, exportServiceImpl);
linkHDFLib();
NativeLib.HDF5.load();
return vcConn;
} catch (Throwable exc) {
lg.error(exc.getMessage(), exc);
Expand Down Expand Up @@ -100,18 +99,4 @@ public String getAuth0MappedUser() {
return "";
}

/**
* trigger loading of HDF library when running local
*/
private void linkHDFLib( ) {
try { //lifted from hdf5group website
Class<?> fileclass = Class.forName("ncsa.hdf.object.h5.H5File");
FileFormat fileformat = (FileFormat)fileclass.newInstance();
if (fileformat != null) {
FileFormat.addFileFormat(FileFormat.FILE_TYPE_HDF5, fileformat);
}
} catch(Throwable t) {
lg.error(t);
}
}
}

0 comments on commit 389bd5d

Please sign in to comment.