protected void resumeSession ( AuthRequest req , PresentsConnection conn ) { // check to see if we've already got a connection object, in which case it's probably stale Connection oldconn = getConnection ( ) ; if ( oldconn != null && ! oldconn . isClosed ( ) ) { log . info ( "Closing stale connection" , "old" , oldconn , "new" , conn ) ; // close the old connection (which results in everything being properly unregistered) oldconn . close ( ) ; } // note our new auth request (so that we can deliver the proper bootstrap services) _areq = req ; // start using the new connection setConnection ( conn ) ; // if a client connects, drops the connection and reconnects within the span of a very // short period of time, we'll find ourselves in resumeSession() before their client object // was resolved from the initial connection; in such a case, we can simply bail out here // and let the original session establishment code take care of initializing this resumed // session if ( _clobj == null ) { log . info ( "Rapid-fire reconnect caused us to arrive in resumeSession() before the " + "original session resolved its client object " + this + "." ) ; return ; } // we need to get onto the dobj thread so that we can finalize resumption of the session _omgr . postRunnable ( new Runnable ( ) { public void run ( ) { // now that we're on the dobjmgr thread we can resume our session resumption finishResumeSession ( ) ; } } ) ; }
Called by the client manager when a new connection arrives that authenticates as this already established client . This must only be called from the congmr thread .