public void subscribe ( DObjectManager omgr ) { if ( _active ) { log . warning ( "Active safesub asked to resubscribe " + this + "." , new Exception ( ) ) ; return ; } // note that we are now again in the "wishing to be subscribed" state _active = true ; // make sure we dont have an object reference (which should be // logically impossible) if ( _object != null ) { log . warning ( "Incroyable! A safesub has an object and was " + "non-active!? " + this + "." , new Exception ( ) ) ; // make do in the face of insanity _subscriber . objectAvailable ( _object ) ; return ; } if ( _pending ) { // we were previously asked to subscribe, then they asked to // unsubscribe and now they've asked to subscribe again, all // before the original subscription even completed; we need do // nothing here except as the original subscription request // will eventually come through and all will be well return ; } // we're not pending and we just became active, that means we need // to request to subscribe to our object _pending = true ; omgr . subscribeToObject ( _oid , this ) ; }
Initiates the subscription process .