|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.guiclient.remote.ServerConnection
public final class ServerConnection
The server manager manages the connection to the OpenBP server. It is especially used to lookup services of the server. The services are cached in a local table, so lookup of a retrieved service is fast.
| Field Summary | |
|---|---|
static boolean |
disableTimersForDebug
Debug flag: Disable the continously running timer (useful for profiling and memory leak detection) |
| Method Summary | |
|---|---|
void |
connect(boolean throwError)
Tries to connect to the server. |
void |
disconnect()
Disconnects from the server. |
ClientConnectionInfo |
getConnectionInfo()
Gets the connection info to the OpenBP server. |
static ServerConnection |
getInstance()
Gets the singleton instance of this class. |
ClientLoginInfo |
getLoginInfo()
Gets the login info for the client session. |
ClientSession |
getSession()
This method returns the session this model is maintaining, or null, if no session has been created yet. |
boolean |
isConnected()
Checks if we are connected to the server. |
java.lang.Object |
lookupOptionalService(java.lang.Class serviceCls)
Looks up a service of the server, ignoring errors silently. |
java.lang.Object |
lookupService(java.lang.Class serviceCls)
Looks up a service of the server, throwing an exception on error. |
java.lang.Object |
obtainService(java.lang.Class serviceCls,
boolean throwError)
Looks up a service of the server. |
void |
setConnectionInfo(ClientConnectionInfo connectionInfo)
Sets the connection info to the OpenBP server. |
void |
setLoginInfo(ClientLoginInfo loginInfo)
Sets the login info for the client session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean disableTimersForDebug
| Method Detail |
|---|
public static ServerConnection getInstance()
public ClientSession getSession()
public ClientConnectionInfo getConnectionInfo()
public void setConnectionInfo(ClientConnectionInfo connectionInfo)
public ClientLoginInfo getLoginInfo()
public void setLoginInfo(ClientLoginInfo loginInfo)
public void connect(boolean throwError)
throwError - true Throws an exception in case of error.OpenBPException - On errorpublic void disconnect()
public boolean isConnected()
public java.lang.Object lookupService(java.lang.Class serviceCls)
serviceCls - Class of the service to lookup
OpenBPException - If the service cannot be found on the serverpublic java.lang.Object lookupOptionalService(java.lang.Class serviceCls)
serviceCls - Class of the service to lookup
public java.lang.Object obtainService(java.lang.Class serviceCls,
boolean throwError)
serviceCls - Service classthrowError - true Throws an exception in case of error.OpenBPException - If the service cannot be found on the server
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||