Examples of IScheduledJob


Examples of org.red5.server.api.scheduling.IScheduledJob

  /**
   * Schedules new ghost connections cleanup using current cleanup period
   */
  public void scheduleGhostConnectionsCleanup() {
    IScheduledJob job = new IScheduledJob() {
      public void execute(ISchedulingService service) throws CloneNotSupportedException {
        killGhostConnections();
      }
    };

View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

      if (msgIn != null) {
        msgIn.subscribe(this, null);
      }
      if (isLive) {
        if (item.getLength() >= 0) {
          liveJobName = scheduler.addScheduledOnceJob(item.getLength(), new IScheduledJob() {
            public void execute(ISchedulingService service) {
              if (liveJobName == null) {
                return;
              }
              liveJobName = null;
View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

      } else {
        onItemEnd();
      }
    } while (nextRTMPMessage != null || delta < WAIT_THRESHOLD);
    // start the job all over again
    vodJobName = scheduler.addScheduledOnceJob(delta, new IScheduledJob() {
      public void execute(ISchedulingService service) {
        if (vodJobName != null) {
          vodJobName = null;
          if (doPushMessage()) {
            if (state == StreamState.PLAYING) {
View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

    currentItem = item;
    sendResetMessage();
    msgIn.subscribe(this, null);
    if (isLive) {
      if (item.getLength() >= 0) {
        liveJobName = scheduler.addScheduledOnceJob(item.getLength(), new IScheduledJob() {
          /** {@inheritDoc} */
          public void execute(ISchedulingService service) {
            if (liveJobName == null) {
              return;
            }
View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

    if (first) {
      vodStartTS = nextTS;
    }
    long delta = nextTS - vodStartTS - (System.currentTimeMillis() - serverStartTS);

    vodJobName = scheduler.addScheduledOnceJob(delta, new IScheduledJob() {
      /** {@inheritDoc} */
      public void execute(ISchedulingService service) {
        if (vodJobName == null) {
          return;
        }
View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

        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);
              }
View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

  }
 
  public void execute() {
    log.debug("execute");
    ISchedulingService service = null;
    IScheduledJob job = null;
    try {
      service = (ISchedulingService) jobDataMap.get(SCHEDULING_SERVICE);
      job = (IScheduledJob) jobDataMap.get(SCHEDULED_JOB);
      job.execute(service);
    } catch (Throwable e) {
      if (job == null) {
        log.error("Job not found");
      } else {
        log.error("Job {} execution failed", job.toString(), e);
      }
    }   
  }
View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

  /** {@inheritDoc} */
  @Override
  protected void executeInternal(JobExecutionContext executionContext) throws JobExecutionException {
    log.debug("execute: {}", executionContext);
    ISchedulingService service = null;
    IScheduledJob job = null;
    try {
      JobDetail jobDetail = executionContext.getJobDetail();
      JobDataMap dataMap = jobDetail.getJobDataMap();
      service = (ISchedulingService) dataMap.get(SCHEDULING_SERVICE);
      job = (IScheduledJob) dataMap.get(SCHEDULED_JOB);
      job.execute(service);
    } catch (Throwable e) {
      if (job == null) {
        log.error("Job not found");
      } else {
        log.error("Job {} execution failed", job.toString(), e);
      }
    }   
  }
View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

    }
    // check that linger job has be set
    if (lingerJobName == null) {
      // start a job to allow the so to linger for just a few ticks
      QuartzSchedulingService scheduler = (QuartzSchedulingService) getParent().getContext().getBean(QuartzSchedulingService.BEAN_NAME);
      IScheduledJob job = new IScheduledJob() {
        public void execute(ISchedulingService service) {
          if (so != null && !so.isClosed()) {
            so.checkRelease();
          }
        }
View Full Code Here

Examples of org.red5.server.api.scheduling.IScheduledJob

    /** {@inheritDoc} */
    public void execute(JobExecutionContext arg0) throws JobExecutionException {
    ISchedulingService service = (ISchedulingService) arg0.getJobDetail()
        .getJobDataMap().get(SCHEDULING_SERVICE);
    IScheduledJob job = (IScheduledJob) arg0.getJobDetail().getJobDataMap()
        .get(SCHEDULED_JOB);
        try {
            job.execute(service);
        } catch (Throwable e) {
            log.error("Job " + job.toString() + " execution failed: " + e.getMessage());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.