Skip to content

Commit 44daedf

Browse files
author
Stu Arnett
committed
v1.0.2
1 parent d606477 commit 44daedf

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/java/com/emc/rest/smart/PollingDaemon.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* Polling thread that will terminate automatically when the application exits
3434
*/
3535
public class PollingDaemon extends Thread {
36+
public static final String PROPERTY_KEY = "com.emc.rest.smart.pollingDaemon";
37+
3638
private static final Logger l4j = Logger.getLogger(PollingDaemon.class);
3739

3840
private SmartConfig smartConfig;

src/main/java/com/emc/rest/smart/SmartClientFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ public static Client createSmartClient(SmartConfig smartConfig,
5555
PollingDaemon pollingDaemon = new PollingDaemon(smartConfig);
5656
pollingDaemon.start();
5757

58+
// attach the daemon thread to the client so users can stop it when finished with the client
59+
client.getProperties().put(PollingDaemon.PROPERTY_KEY, pollingDaemon);
60+
5861
return client;
5962
}
6063

0 commit comments

Comments
 (0)