use of org.vcell.db.KeyFactory in project vcell by virtualcell.
the class StochtestCompareService method main.
public static void main(String[] args) {
try {
if (args.length != 1) {
System.out.println("Usage: StochtestService baseDirectory");
System.exit(-1);
}
File baseDir = new File(args[0]);
if (!baseDir.exists()) {
throw new RuntimeException("base directory " + baseDir.getPath() + " not found");
}
PropertyLoader.loadProperties();
DatabasePolicySQL.bAllowAdministrativeAccess = true;
String driverName = PropertyLoader.getRequiredProperty(PropertyLoader.dbDriverName);
String connectURL = PropertyLoader.getRequiredProperty(PropertyLoader.dbConnectURL);
String dbSchemaUser = PropertyLoader.getRequiredProperty(PropertyLoader.dbUserid);
String dbPassword = PropertyLoader.getSecretValue(PropertyLoader.dbPasswordValue, PropertyLoader.dbPasswordFile);
//
// get appropriate database factory objects
//
ConnectionFactory conFactory = DatabaseService.getInstance().createConnectionFactory(driverName, connectURL, dbSchemaUser, dbPassword);
KeyFactory keyFactory = conFactory.getKeyFactory();
StochtestCompareService stochtestService = new StochtestCompareService(baseDir, conFactory, keyFactory);
while (true) {
stochtestService.compareOne();
}
} catch (Throwable e) {
e.printStackTrace(System.out);
}
System.exit(0);
}
use of org.vcell.db.KeyFactory in project vcell by virtualcell.
the class FunctionFileCrawler method main.
/**
* Insert the method's description here.
* Creation date: (6/27/2006 1:33:58 PM)
* @param args java.lang.String[]
*/
public static void main(String[] args) {
ConnectionFactory conFactory = null;
try {
String username = null;
String outputdir = ".";
int count = 0;
boolean SCAN_SINGLE = false;
while (count < args.length) {
if (args[count].equals("-h")) {
printUsage();
System.exit(0);
} else if (args[count].equals("-u")) {
count++;
username = args[count];
SCAN_SINGLE = true;
} else if (args[count].equals("-o")) {
count++;
outputdir = args[count];
} else {
System.out.println("Wrong arguments, see usage below.");
printUsage();
System.exit(1);
}
count++;
}
PropertyLoader.loadProperties();
conFactory = DatabaseService.getInstance().createConnectionFactory();
KeyFactory keyFactory = conFactory.getKeyFactory();
AdminDatabaseServer adminDbServer = new LocalAdminDbServer(conFactory, keyFactory);
FunctionFileCrawler crawler = new FunctionFileCrawler(adminDbServer, outputdir);
if (SCAN_SINGLE) {
crawler.scanAUser(username);
} else {
crawler.scanAllUsers();
}
System.exit(0);
} catch (Exception ex) {
ex.printStackTrace(System.out);
} finally {
try {
if (conFactory != null) {
conFactory.close();
}
} catch (Throwable ex) {
ex.printStackTrace();
}
System.exit(0);
}
}
use of org.vcell.db.KeyFactory in project vcell by virtualcell.
the class SimulationDispatcher method main.
/**
* Starts the application.
* @param args an array of command-line arguments
*/
public static void main(java.lang.String[] args) {
OperatingSystemInfo.getInstance();
if (args.length != 3 && args.length != 0) {
System.out.println("Missing arguments: " + VCellServices.class.getName() + " [sshHost sshUser sshKeyFile] ");
System.exit(1);
}
try {
PropertyLoader.loadProperties(REQUIRED_SERVICE_PROPERTIES);
HtcProxy htcProxy = SlurmProxy.creatCommandService(args);
int serviceOrdinal = 99;
VCMongoMessage.serviceStartup(ServiceName.dispatch, new Integer(serviceOrdinal), args);
// //
// // JMX registration
// //
// MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
// mbs.registerMBean(new VCellServiceMXBeanImpl(), new ObjectName(VCellServiceMXBean.jmxObjectName));
ServiceInstanceStatus serviceInstanceStatus = new ServiceInstanceStatus(VCellServerID.getSystemServerID(), ServiceType.DISPATCH, serviceOrdinal, ManageUtils.getHostName(), new Date(), true);
ConnectionFactory conFactory = DatabaseService.getInstance().createConnectionFactory();
KeyFactory keyFactory = conFactory.getKeyFactory();
DatabaseServerImpl databaseServerImpl = new DatabaseServerImpl(conFactory, keyFactory);
AdminDBTopLevel adminDbTopLevel = new AdminDBTopLevel(conFactory);
SimulationDatabase simulationDatabase = new SimulationDatabaseDirect(adminDbTopLevel, databaseServerImpl, true);
VCMessagingService vcMessagingService_int = new VCMessagingServiceActiveMQ();
String jmshost_int = PropertyLoader.getRequiredProperty(PropertyLoader.jmsIntHostInternal);
int jmsport_int = Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.jmsIntPortInternal));
vcMessagingService_int.setConfiguration(new ServerMessagingDelegate(), jmshost_int, jmsport_int);
VCMessagingService vcMessagingService_sim = new VCMessagingServiceActiveMQ();
String jmshost_sim = PropertyLoader.getRequiredProperty(PropertyLoader.jmsSimHostInternal);
int jmsport_sim = Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.jmsSimPortInternal));
vcMessagingService_sim.setConfiguration(new ServerMessagingDelegate(), jmshost_sim, jmsport_sim);
SimulationDispatcher simulationDispatcher = new SimulationDispatcher(htcProxy, vcMessagingService_int, vcMessagingService_sim, serviceInstanceStatus, simulationDatabase, false);
simulationDispatcher.init();
} catch (Throwable e) {
lg.error("uncaught exception initializing SimulationDispatcher: " + e.getLocalizedMessage(), e);
System.exit(1);
}
}
use of org.vcell.db.KeyFactory in project vcell by virtualcell.
the class VCellServices method main.
/**
* Starts the application.
* @param args an array of command-line arguments
*/
public static void main(java.lang.String[] args) {
OperatingSystemInfo.getInstance();
if (args.length != 3 && args.length != 0) {
System.out.println("Missing arguments: " + VCellServices.class.getName() + " [sshHost sshUser sshKeyFile] ");
System.exit(1);
}
try {
PropertyLoader.loadProperties(REQUIRED_SERVICE_PROPERTIES);
ResourceUtil.setNativeLibraryDirectory();
new LibraryLoaderThread(false).start();
PythonSupport.verifyInstallation(new PythonPackage[] { PythonPackage.VTK, PythonPackage.THRIFT });
HtcProxy htcProxy = SlurmProxy.creatCommandService(args);
int serviceOrdinal = 0;
VCMongoMessage.serviceStartup(ServiceName.dispatch, new Integer(serviceOrdinal), args);
// //
// // JMX registration
// //
// MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
// mbs.registerMBean(new VCellServiceMXBeanImpl(), new ObjectName(VCellServiceMXBean.jmxObjectName));
ServiceInstanceStatus serviceInstanceStatus = new ServiceInstanceStatus(VCellServerID.getSystemServerID(), ServiceType.MASTER, serviceOrdinal, ManageUtils.getHostName(), new Date(), true);
ConnectionFactory conFactory = DatabaseService.getInstance().createConnectionFactory();
KeyFactory keyFactory = conFactory.getKeyFactory();
DatabaseServerImpl databaseServerImpl = new DatabaseServerImpl(conFactory, keyFactory);
AdminDBTopLevel adminDbTopLevel = new AdminDBTopLevel(conFactory);
SimulationDatabase simulationDatabase = new SimulationDatabaseDirect(adminDbTopLevel, databaseServerImpl, true);
String cacheSize = PropertyLoader.getRequiredProperty(PropertyLoader.simdataCacheSizeProperty);
long maxMemSize = Long.parseLong(cacheSize);
Cachetable cacheTable = new Cachetable(MessageConstants.MINUTE_IN_MS * 20, maxMemSize);
DataSetControllerImpl dataSetControllerImpl = new DataSetControllerImpl(cacheTable, new File(PropertyLoader.getRequiredProperty(PropertyLoader.primarySimDataDirInternalProperty)), new File(PropertyLoader.getProperty(PropertyLoader.secondarySimDataDirInternalProperty, PropertyLoader.getRequiredProperty(PropertyLoader.primarySimDataDirInternalProperty))));
ExportServiceImpl exportServiceImpl = new ExportServiceImpl();
// add dataJobListener
DataServerImpl dataServerImpl = new DataServerImpl(dataSetControllerImpl, exportServiceImpl);
VCMessagingService vcMessagingService_int = new VCMessagingServiceActiveMQ();
String jmshost_int = PropertyLoader.getRequiredProperty(PropertyLoader.jmsIntHostInternal);
int jmsport_int = Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.jmsIntPortInternal));
vcMessagingService_int.setConfiguration(new ServerMessagingDelegate(), jmshost_int, jmsport_int);
VCMessagingService vcMessagingService_sim = new VCMessagingServiceActiveMQ();
String jmshost_sim = PropertyLoader.getRequiredProperty(PropertyLoader.jmsSimHostInternal);
int jmsport_sim = Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.jmsSimPortInternal));
vcMessagingService_sim.setConfiguration(new ServerMessagingDelegate(), jmshost_sim, jmsport_sim);
VCellServices vcellServices = new VCellServices(htcProxy, vcMessagingService_int, vcMessagingService_sim, serviceInstanceStatus, databaseServerImpl, dataServerImpl, simulationDatabase);
dataSetControllerImpl.addDataJobListener(vcellServices);
exportServiceImpl.addExportListener(vcellServices);
vcellServices.init();
} catch (Throwable e) {
e.printStackTrace(System.out);
}
}
use of org.vcell.db.KeyFactory in project vcell by virtualcell.
the class DatabaseServer method main.
/**
* Starts the application.
* @param args an array of command-line arguments
*/
public static void main(java.lang.String[] args) {
OperatingSystemInfo.getInstance();
if (args.length != 0) {
System.out.println("Unexpected arguments: " + DatabaseServer.class.getName());
System.exit(1);
}
try {
PropertyLoader.loadProperties(REQUIRED_SERVICE_PROPERTIES);
int serviceOrdinal = 99;
VCMongoMessage.serviceStartup(ServiceName.database, new Integer(serviceOrdinal), args);
//
// JMX registration
//
// MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
// mbs.registerMBean(new VCellServiceMXBeanImpl(), new ObjectName(VCellServiceMXBean.jmxObjectName));
ServiceInstanceStatus serviceInstanceStatus = new ServiceInstanceStatus(VCellServerID.getSystemServerID(), ServiceType.DB, serviceOrdinal, ManageUtils.getHostName(), new Date(), true);
ConnectionFactory conFactory = DatabaseService.getInstance().createConnectionFactory();
KeyFactory keyFactory = conFactory.getKeyFactory();
DatabaseServerImpl databaseServerImpl = new DatabaseServerImpl(conFactory, keyFactory);
VCMessagingService vcMessagingService = VCellServiceHelper.getInstance().loadService(VCMessagingService.class);
String jmshost = PropertyLoader.getRequiredProperty(PropertyLoader.jmsIntHostInternal);
int jmsport = Integer.parseInt(PropertyLoader.getRequiredProperty(PropertyLoader.jmsIntPortInternal));
vcMessagingService.setConfiguration(new ServerMessagingDelegate(), jmshost, jmsport);
DatabaseServer databaseServer = new DatabaseServer(serviceInstanceStatus, databaseServerImpl, vcMessagingService, false);
databaseServer.init();
} catch (Throwable e) {
e.printStackTrace(System.out);
}
}
Aggregations