diff options
author | Matthew Newhook <matthew@zeroc.com> | 2008-08-22 12:07:39 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2008-08-22 12:07:39 -0230 |
commit | ba630ccacc8ee0b1735e263569107a5f309a3a2d (patch) | |
tree | adbf1c264aae37bef60eb42350b203391ad3e2e1 /java/demo/Database/library/SessionI.java | |
parent | Moved to using a dispatch interceptor model. (diff) | |
download | ice-ba630ccacc8ee0b1735e263569107a5f309a3a2d.tar.bz2 ice-ba630ccacc8ee0b1735e263569107a5f309a3a2d.tar.xz ice-ba630ccacc8ee0b1735e263569107a5f309a3a2d.zip |
use a library per session.
Diffstat (limited to 'java/demo/Database/library/SessionI.java')
-rw-r--r-- | java/demo/Database/library/SessionI.java | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/java/demo/Database/library/SessionI.java b/java/demo/Database/library/SessionI.java index bd460271e48..dc328e85369 100644 --- a/java/demo/Database/library/SessionI.java +++ b/java/demo/Database/library/SessionI.java @@ -11,46 +11,6 @@ import Demo.*; class SessionI implements _SessionOperations, _Glacier2SessionOperations { - static class SessionDispatchInterceptorI extends Ice.DispatchInterceptor - { - SessionDispatchInterceptorI(Ice.Logger logger, ConnectionPool pool, Ice.Object servant, SessionI session) - { - _logger = logger; - _pool = pool; - _servant = servant; - _session = session; - } - - public Ice.DispatchStatus - dispatch(Ice.Request request) - { - SessionSQLRequestContext context = new SessionSQLRequestContext(_session, _logger, _pool); - try - { - Ice.DispatchStatus status = _servant.ice_dispatch(request, null); - context.destroyFromDispatch(status == Ice.DispatchStatus.DispatchOK); - return status; - } - catch(JDBCException ex) - { - context.error("dispatch to " + - request.getCurrent().id.category + "/" + request.getCurrent().id.name + - " failed.", ex); - context.destroyFromDispatch(false); - - // Translate the exception to UnknownException. - Ice.UnknownException e = new Ice.UnknownException(); - ex.initCause(e); - throw e; - } - } - - private Ice.Logger _logger; - private ConnectionPool _pool; - private Ice.Object _servant; - private SessionI _session; - } - synchronized public LibraryPrx getLibrary(Ice.Current c) { @@ -164,13 +124,11 @@ class SessionI implements _SessionOperations, _Glacier2SessionOperations } } - SessionI(Ice.Logger logger, ConnectionPool pool, Ice.ObjectAdapter adapter, Ice.Object libraryServant) + SessionI(Ice.Logger logger, Ice.ObjectAdapter adapter) { _logger = logger; _timestamp = System.currentTimeMillis(); - - _library = LibraryPrxHelper.uncheckedCast( - adapter.addWithUUID(new SessionDispatchInterceptorI(logger, pool, libraryServant, this))); + _library = LibraryPrxHelper.uncheckedCast(adapter.addWithUUID(new DispatchInterceptorI(new LibraryI(this)))); } static class QueryProxyPair |