Commit 2cfa63ed authored by Jerome Locatelli's avatar Jerome Locatelli
Browse files

add specific login for the tablette without some inits for optimizing loading time

parent 2a50aa83
......@@ -2,9 +2,9 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib64/avalon-framework-4.2.0.jar"/>
<classpathentry kind="lib" path="lib64/jacorb.jar"/>
<classpathentry kind="lib" path="lib64/logkit-2.0.jar"/>
<classpathentry kind="lib" path="lib64/protobuf-2.5.0.jar"/>
<classpathentry kind="lib" path="lib/avalon-framework-4.1.5.jar"/>
<classpathentry kind="lib" path="lib/jacorb.jar"/>
<classpathentry kind="lib" path="lib/logkit-1.2.jar"/>
<classpathentry kind="lib" path="lib/protobuf-java-2.5.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
......@@ -76,7 +76,19 @@ public class LoginManager {
}
public void logintab(String login, String password, boolean standalone, String serverId) throws LoginIncorrectException, ClientAlreadyLaunchedException, ConnectionFailure {
try {
ServerSessionManager.getInstance(serverId).logintab(standalone);
} catch (CorbaSessionManager.ClientAlreadyLaunchedException e) {
throw new ClientAlreadyLaunchedException();
} catch (ServerSessionManager.ConnectionFailure e) {
throw new ConnectionFailure();
} catch (LoadFailure e) {
throw new ConnectionFailure();
}
}
public String getStatusMessage() {
return ServerConnection.getInstance("real").getStatusMessage();
}
......
......@@ -129,6 +129,37 @@ public class ServerSessionManager {
LogSubcriberImpl.getInstance(serverId).subscribe();
}
public void logintab(boolean standAlone) throws CorbaSessionManager.ClientAlreadyLaunchedException, ConnectionFailure, LoadFailure {
CorbaSessionManager.getInstance(serverId).init();
// See if the Server is up and running
if (!CorbaSessionManager.getInstance(serverId).isOk()) {
System.err.println("Failed to connect to server " + serverId);
throw new ConnectionFailure();
}
// initialise DataAccessor
DataAccessor.getInstance(serverId).init();
if (currentSession != null) {
currentSession.logout();
}
currentSession = CorbaSessionManager.getInstance(serverId).login(standAlone);
// The test is for initialising the controller manager and driver manager in the following cases:
// - real server
// - simulated server with no real server logged
// This is because ControllerManager and DriverManager are accessed by getInstance() without any serverId
if (serverId.equals("real") || (!serverId.equals("real") && !getInstance("real").isLogged())) {
ConfigurationManager.initInstance(serverId);
ResourceManager.initInstance(serverId);
ControllerManager.initInstance(serverId);
DriverManager.initInstance(serverId);
}
}
public void logout() {
ServerCommandZoneEventManager.getInstance(serverId).reset();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment