public void stop ( ) { synchronized ( lock ) { Log . i ( DOMAIN , "%s: Replicator is stopping ..." , this ) ; if ( c4repl != null ) { c4repl . stop ( ) ; // this is async; status will change when repl actually stops } else { Log . i ( DOMAIN , "%s: Replicator has been stopped or offlined ..." , this ) ; } if ( c4ReplStatus . getActivityLevel ( ) == C4ReplicatorStatus . ActivityLevel . OFFLINE ) { Log . i ( DOMAIN , "%s: Replicator has been offlined; " + "make the replicator into the stopped state now." , this ) ; final C4ReplicatorStatus c4replStatus = new C4ReplicatorStatus ( ) ; c4replStatus . setActivityLevel ( C4ReplicatorStatus . ActivityLevel . STOPPED ) ; this . c4StatusChanged ( c4replStatus ) ; } if ( reachabilityManager != null ) { reachabilityManager . removeNetworkReachabilityListener ( this ) ; } } }
Stops a running replicator . This method returns immediately ; when the replicator actually stops the replicator will change its status s activity level to kCBLStopped and the replicator change notification will be notified accordingly .