diff options
author | Mark Spruiell <mes@zeroc.com> | 2010-05-18 20:06:03 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2010-05-18 20:06:03 -0700 |
commit | b7300a6afcbb409cf959d88cd0914eb95f334bd0 (patch) | |
tree | 80c332b102dd02b61ecf4639b1cf1183b9186bc8 /java/src | |
parent | Another fix for IceSSL to work with VC6 as well as VC10 (diff) | |
download | ice-b7300a6afcbb409cf959d88cd0914eb95f334bd0.tar.bz2 ice-b7300a6afcbb409cf959d88cd0914eb95f334bd0.tar.xz ice-b7300a6afcbb409cf959d88cd0914eb95f334bd0.zip |
adding setConnectContext to Glacier2.SessionFactoryHelper
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Glacier2/SessionFactoryHelper.java | 16 | ||||
-rw-r--r-- | java/src/Glacier2/SessionHelper.java | 11 |
2 files changed, 21 insertions, 6 deletions
diff --git a/java/src/Glacier2/SessionFactoryHelper.java b/java/src/Glacier2/SessionFactoryHelper.java index 046f2c5780e..59c424ab7f7 100644 --- a/java/src/Glacier2/SessionFactoryHelper.java +++ b/java/src/Glacier2/SessionFactoryHelper.java @@ -217,6 +217,17 @@ public class SessionFactoryHelper } /** + * Sets the request context to use while establishing a connection to the Glacier2 router. + * + * @param context The request context. + */ + synchronized public void + setConnectContext(final java.util.Map<String, String> context) + { + _context = context; + } + + /** * Connects to the Glacier2 router using the associated SSL credentials. * * Once the connection is established, {@link SessionCallback#connected} is called on the callback object; @@ -228,7 +239,7 @@ public class SessionFactoryHelper connect() { SessionHelper session = new SessionHelper(_callback, createInitData()); - session.connect(); + session.connect(_context); return session; } @@ -246,7 +257,7 @@ public class SessionFactoryHelper connect(final String username, final String password) { SessionHelper session = new SessionHelper(_callback, createInitData()); - session.connect(username, password); + session.connect(username, password, _context); return session; } @@ -312,6 +323,7 @@ public class SessionFactoryHelper private boolean _secure = true; private int _port = 0; private int _timeout = 10000; + private java.util.Map<String, String> _context; private static final int GLACIER2_SSL_PORT = 4064; private static final int GLACIER2_TCP_PORT = 4063; } diff --git a/java/src/Glacier2/SessionHelper.java b/java/src/Glacier2/SessionHelper.java index 66b15a4ebd8..e4847745666 100644 --- a/java/src/Glacier2/SessionHelper.java +++ b/java/src/Glacier2/SessionHelper.java @@ -272,16 +272,18 @@ public class SessionHelper * * Once the connection is established, {@link SessionCallback#connected} is called on the callback object; * upon failure, {@link SessionCallback#exception} is called with the exception. + * + * @param context The request context to use when creating the session. */ synchronized protected void - connect() + connect(final java.util.Map<String, String> context) { connectImpl(new ConnectStrategy() { public SessionPrx connect(RouterPrx router) throws CannotCreateSessionException, PermissionDeniedException { - return router.createSessionFromSecureConnection(); + return router.createSessionFromSecureConnection(context); } }); } @@ -294,16 +296,17 @@ public class SessionHelper * * @param username The user name. * @param password The password. + * @param context The request context to use when creating the session. */ synchronized protected void - connect(final String username, final String password) + connect(final String username, final String password, final java.util.Map<String, String> context) { connectImpl(new ConnectStrategy() { public SessionPrx connect(RouterPrx router) throws CannotCreateSessionException, PermissionDeniedException { - return router.createSession(username, password); + return router.createSession(username, password, context); } }); } |