Package org.red5.server.api.scheduling

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


        String scopeName = "hibernate";
        if (rcl.getRoom_id() != null) {
          scopeName = rcl.getRoom_id().toString();
        }
        IScope currentScope = ScopeApplicationAdapter.getInstance()
            .getRoomScope(scopeName);
        ScopeApplicationAdapter.getInstance().roomLeaveByScope(rcl,
            currentScope);

        HashMap<Integer, String> messageObj = new HashMap<Integer, String>();
View Full Code Here


         }
         String scopeName = "hibernate";
         if (rcl.getRoom_id() != null) {
           scopeName = rcl.getRoom_id().toString();
         }
         IScope currentScope = this.scopeApplicationAdapter.getRoomScope(scopeName);
         this.scopeApplicationAdapter.roomLeaveByScope(rcl, currentScope);
        
        
         HashMap<Integer,String> messageObj = new HashMap<Integer,String>();
         messageObj.put(0, "kick");
View Full Code Here

          }
          String scopeName = "hibernate";
          if (rcl.getRoom_id() != null) {
            scopeName = rcl.getRoom_id().toString();
          }
          IScope currentScope = this.scopeApplicationAdapter.getRoomScope(scopeName);
         
          HashMap<Integer,String> messageObj = new HashMap<Integer,String>();
          messageObj.put(0, "kick");
         
          this.scopeApplicationAdapter.sendMessageById(messageObj, rcl.getStreamid(), currentScope);
View Full Code Here

  /**
   * 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

      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

      } 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

    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

    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

        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

  }
 
  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

TOP

Related Classes of org.red5.server.api.scheduling.IScheduledJob

Copyright © 2018 www.massapicom. 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.