Thursday, November 24, 2011

Cisco SCA BB API - TimestampController thread not exiting

Today I finally figured out why my programs written with the Cisco SCA BB API wouldn't close themselves. Their lovely programmers decided to start an orphan thread that never exits, and doesn't disappear when you call SCABB.logout!!

The solution:

1) Create a class that looks like this:

public class ShutdownTimestampController implements TimestampController
{
public void terminate()
{
//do nothing
}

public long getCurrentTimeStampInMilli()
{
return new Date().getTime();
}

public void setAccuracy(long l) throws IllegalArgumentException
{
//do nothing
}
}

When you're ready to shut down, call this:
Timestamp.setController(new ShutdownTimestampController());

Problem solved! This was quite painful to find, /angryRachel

No comments:

Post a Comment