5050import io .ably .lib .util .EventEmitter ;
5151import io .ably .lib .util .Listeners ;
5252import io .ably .lib .util .Log ;
53- import io .ably .lib .util .NamedTimer ;
53+ import io .ably .lib .util .AblyTimer ;
5454import io .ably .lib .util .ReconnectionStrategy ;
5555import io .ably .lib .util .StringUtils ;
5656import io .ably .lib .util .SystemClock ;
@@ -510,18 +510,18 @@ private void setFailed(ErrorInfo reason) {
510510 }
511511
512512 /* Timer for attach operation */
513- private NamedTimer attachTimer ;
513+ private AblyTimer attachTimer ;
514514
515515 /* Timer for reattaching if attach failed */
516- private NamedTimer reattachTimer ;
516+ private AblyTimer reattachTimer ;
517517
518518 /**
519519 * Cancel attach/reattach timers
520520 */
521521 synchronized private void clearAttachTimers () {
522- NamedTimer [] timers = new NamedTimer []{attachTimer , reattachTimer };
522+ AblyTimer [] timers = new AblyTimer []{attachTimer , reattachTimer };
523523 attachTimer = reattachTimer = null ;
524- for (NamedTimer t : timers ) {
524+ for (AblyTimer t : timers ) {
525525 if (t != null ) {
526526 t .cancel ();
527527 }
@@ -538,7 +538,7 @@ private void attachWithTimeout(final CompletionListener listener) throws AblyExc
538538 */
539539 synchronized private void attachWithTimeout (final boolean forceReattach , final CompletionListener listener , ErrorInfo reattachmentReason ) {
540540 checkChannelIsNotReleased ();
541- NamedTimer currentAttachTimer ;
541+ AblyTimer currentAttachTimer ;
542542 try {
543543 currentAttachTimer = clock .newTimer ("attach-timer" );
544544 } catch (Throwable t ) {
@@ -572,7 +572,7 @@ public void onError(ErrorInfo reason) {
572572 return ;
573573 }
574574
575- final NamedTimer inProgressTimer = currentAttachTimer ;
575+ final AblyTimer inProgressTimer = currentAttachTimer ;
576576 attachTimer .schedule (
577577 new TimerTask () {
578578 @ Override
@@ -602,7 +602,7 @@ private void checkChannelIsNotReleased() {
602602 * try to attach the channel
603603 */
604604 synchronized private void reattachAfterTimeout () {
605- NamedTimer currentReattachTimer ;
605+ AblyTimer currentReattachTimer ;
606606 try {
607607 currentReattachTimer = clock .newTimer ("reattach-timer" );
608608 } catch (Throwable t ) {
@@ -614,7 +614,7 @@ synchronized private void reattachAfterTimeout() {
614614 this .retryAttempt ++;
615615 int retryDelay = ReconnectionStrategy .getRetryTime (ably .options .channelRetryTimeout , retryAttempt );
616616
617- final NamedTimer inProgressTimer = currentReattachTimer ;
617+ final AblyTimer inProgressTimer = currentReattachTimer ;
618618 reattachTimer .schedule (new TimerTask () {
619619 @ Override
620620 public void run () {
@@ -641,7 +641,7 @@ public void run() {
641641 */
642642 synchronized private void detachWithTimeout (final CompletionListener listener ) {
643643 final ChannelState originalState = state ;
644- NamedTimer currentDetachTimer ;
644+ AblyTimer currentDetachTimer ;
645645 try {
646646 currentDetachTimer = released .get () ? null : clock .newTimer ("detach-timer" );
647647 } catch (Throwable t ) {
@@ -677,7 +677,7 @@ public void onError(ErrorInfo reason) {
677677 return ;
678678 }
679679
680- final NamedTimer inProgressTimer = currentDetachTimer ;
680+ final AblyTimer inProgressTimer = currentDetachTimer ;
681681 attachTimer .schedule (new TimerTask () {
682682 @ Override
683683 public void run () {
0 commit comments