X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aaf%2Fauthz.git;a=blobdiff_plain;f=cadi%2Faaf%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fcadi%2Fregister%2FRegistrar.java;h=4ae1b97ffbcf8c9c0bd30ed9897312a47ef89563;hp=32ff8109af3062d1cf72937b4e1869cbe6098e87;hb=7e966914050e66219689001ff4ab601a49eef0ac;hpb=ead32f193586e39b59bb366bddf70e665173a52d diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java index 32ff8109..4ae1b97f 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/register/Registrar.java @@ -45,7 +45,7 @@ public class Registrar { timer = new Timer(REGISTRAR,true); timer.schedule(new RegistrationTimerTask(env), START, INTERVAL); - if(shutdownHook) { + if (shutdownHook) { Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { close(env); @@ -61,18 +61,18 @@ public class Registrar { } @Override public void run() { - for(Iterator> iter = registrants.iterator(); iter.hasNext();) { + for (Iterator> iter = registrants.iterator(); iter.hasNext();) { Registrant reg = iter.next(); Result rv = reg.update(env); synchronized(LOCK) { - if(rv.isOK()) { - if(erroringTimer!=null) { + if (rv.isOK()) { + if (erroringTimer!=null) { erroringTimer.cancel(); erroringTimer = null; } } else { // Account for different Registrations not being to same place - if(erroringTimer==null) { + if (erroringTimer==null) { erroringTimer = new Timer(REGISTRAR + " error re-check ",true); erroringTimer.schedule(new RegistrationTimerTask(env),20000,20000); } @@ -94,7 +94,7 @@ public class Registrar { timer.cancel(); Registrant r; - while(registrants.peek()!=null) { + while (registrants.peek()!=null) { r = registrants.pop(); r.cancel(env); }