Created
March 15, 2013 15:41
-
-
Save mathieuancelin/5170772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void lookup() { | |
while (Thread.currentThread() == m_logTestThread) { | |
ServiceReference logServiceRef = | |
m_context.getServiceReference(LogService.class.getName()); | |
if (logServiceRef != null) { | |
try { | |
LogService logService = | |
(LogService) m_context.getService(logServiceRef); | |
if (logService != null) { | |
logService.log(LogService.LOG_INFO, "ping"); | |
} else { | |
alternativeLog("LogService has gone"); | |
} | |
} catch (RuntimeException re) { | |
alternativeLog("error in LogService " + re); | |
} finally { | |
m_context.ungetService(logServiceRef); | |
} | |
} else { | |
alternativeLog("LogService has gone"); | |
} | |
pauseTestThread(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment