X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fhosttracker%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2Finternal%2FHostTrackerCallable.java;h=a1d29dd27fe014696db69b0e08cadff297465d3b;hb=a22e44963c31452b6ea17745b652456b8b991101;hp=0af523aaa9b22dbedd7f54d0da0edf26b6e0aecb;hpb=59cc8f34c24d81a8890a94c11dedd4b21caa0adf;p=controller.git diff --git a/opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTrackerCallable.java b/opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTrackerCallable.java index 0af523aaa9..a1d29dd27f 100644 --- a/opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTrackerCallable.java +++ b/opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTrackerCallable.java @@ -1,4 +1,3 @@ - /* * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. * @@ -15,23 +14,28 @@ package org.opendaylight.controller.hosttracker.internal; /** * This Class provides methods to discover Host through a blocking call - * mechanism. Applications can make use of these methods if they don't - * find a host in HostTracker's database and want to discover the host + * mechanism. Applications can make use of these methods if they don't + * find a host in HostTracker's database and want to discover the host * in the same thread without being called by a callback function. */ -import java.net.InetAddress; import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; +import org.opendaylight.controller.hosttracker.IHostId; import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector; +/** + * + * + */ public class HostTrackerCallable implements Callable { - InetAddress trackedHost; + //host id which could be ip or a combination of ip + mac based on the scheme chosen. + IHostId trackedHost; HostTracker hostTracker; protected CountDownLatch latch; - public HostTrackerCallable(HostTracker tracker, InetAddress inet) { + public HostTrackerCallable(HostTracker tracker, IHostId inet) { trackedHost = inet; hostTracker = tracker; latch = new CountDownLatch(1); @@ -43,7 +47,7 @@ public class HostTrackerCallable implements Callable { if (h != null) return h; hostTracker.setCallableOnPendingARP(trackedHost, this); - latch.await(); + Thread.sleep(2000); // wait 2sec to see if the host responds return hostTracker.hostQuery(trackedHost); }