use of cbit.vcell.resource.PropertyLoader in project vcell by virtualcell.
the class ClientServerManager method connectToServer.
/**
* Insert the method's description here.
* Creation date: (5/12/2004 4:48:13 PM)
*/
private VCellConnection connectToServer(InteractiveContext requester) {
VCellThreadChecker.checkRemoteInvocation();
VCellConnection newVCellConnection = null;
VCellConnectionFactory vcConnFactory = null;
String badConnStr = "";
try {
switch(getClientServerInfo().getServerType()) {
case SERVER_REMOTE:
{
String apihost = getClientServerInfo().getApihost();
Integer apiport = getClientServerInfo().getApiport();
try {
badConnStr += apihost + ":" + apiport;
vcConnFactory = new RemoteProxyVCellConnectionFactory(apihost, apiport, getClientServerInfo().getUserLoginInfo());
setConnectionStatus(new ClientConnectionStatus(getClientServerInfo().getUsername(), apihost, apiport, ConnectionStatus.INITIALIZING));
newVCellConnection = vcConnFactory.createVCellConnection();
} catch (AuthenticationException ex) {
throw ex;
}
break;
}
case SERVER_LOCAL:
{
new PropertyLoader();
LocalVCellConnectionService localVCellConnectionService = VCellServiceHelper.getInstance().loadService(LocalVCellConnectionService.class);
vcConnFactory = localVCellConnectionService.getLocalVCellConnectionFactory(getClientServerInfo().getUserLoginInfo());
setConnectionStatus(new ClientConnectionStatus(getClientServerInfo().getUsername(), null, null, ConnectionStatus.INITIALIZING));
newVCellConnection = vcConnFactory.createVCellConnection();
break;
}
}
requester.clearConnectWarning();
reconnectStat = ReconnectStatus.NOT;
} catch (AuthenticationException aexc) {
aexc.printStackTrace(System.out);
requester.showErrorDialog(aexc.getMessage());
} catch (ConnectionException cexc) {
String msg = badConnectMessage(badConnStr) + "\n" + cexc.getMessage();
cexc.printStackTrace(System.out);
ErrorUtils.sendRemoteLogMessage(getClientServerInfo().getUserLoginInfo(), msg);
if (reconnectStat != ReconnectStatus.SUBSEQUENT) {
requester.showConnectWarning(msg);
}
} catch (Exception exc) {
exc.printStackTrace(System.out);
String msg = badConnectMessage(badConnStr) + "\nException:\n" + exc.getMessage();
ErrorUtils.sendRemoteLogMessage(getClientServerInfo().getUserLoginInfo(), msg);
requester.showErrorDialog(msg);
}
return newVCellConnection;
}
use of cbit.vcell.resource.PropertyLoader in project vcell by virtualcell.
the class VCDatabaseScanner method createDatabaseScanner.
/**
* create database scanner with specified log
* @param log
* @return new scanner
* @throws Exception
*/
public static VCDatabaseScanner createDatabaseScanner() throws Exception {
new PropertyLoader();
DatabasePolicySQL.lg.setLevel(Level.WARN);
DatabasePolicySQL.bAllowAdministrativeAccess = true;
ConnectionFactory conFactory = DatabaseService.getInstance().createConnectionFactory();
KeyFactory keyFactory = conFactory.getKeyFactory();
VCDatabaseScanner databaseScanner = new VCDatabaseScanner(conFactory, keyFactory);
return databaseScanner;
}
Aggregations