msgIn.subscribe(this, null);
waiting = true;
if (type == -1 && itemLength >= 0) {
log.debug("Creating wait job");
// Wait given timeout for stream to be published
waitLiveJob = schedulingService.addScheduledOnceJob(itemLength, new IScheduledJob() {
public void execute(ISchedulingService service) {
//set the msgIn if its null
if (msgIn == null) {
connectToProvider(itemName);
}
waitLiveJob = null;
waiting = false;
subscriberStream.onChange(StreamState.END);
}
});
} else if (type == -2) {
log.debug("Creating wait job");
// Wait x seconds for the stream to be published
waitLiveJob = schedulingService.addScheduledOnceJob(15000, new IScheduledJob() {
public void execute(ISchedulingService service) {
//set the msgIn if its null
if (msgIn == null) {
connectToProvider(itemName);
}