Package org.red5.server.api.scheduling

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


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

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

          msgIn.subscribe(this, null);
          isWaiting = true;
          if (type == -1 && item.getLength() >= 0) {
            // Wait given timeout for stream to be published
            waitLiveJob = schedulingService.addScheduledOnceJob(
                item.getLength(), new IScheduledJob() {
                  /** {@inheritDoc} */
                                    public void execute(
                      ISchedulingService service) {
                    waitLiveJob = null;
                    isWaiting = false;
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

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

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

    // ------------------------------------------------------------------------

    private void createPlayStream( IPendingServiceCallback callback ) {

        logger.debug( "create play stream" );
        IPendingServiceCallback wrapper = new CreatePlayStreamCallBack( callback );
        invoke( "createStream", null, wrapper );
    }
View Full Code Here

      if (stream.getStreamListeners() != null) {
       
        for (Iterator<IStreamListener> iter = stream.getStreamListeners().iterator();iter.hasNext();) {
         
          IStreamListener iStreamListener = iter.next();
         
          ListenerAdapter listenerAdapter = (ListenerAdapter) iStreamListener;
         
          log.debug("Stream Closing ?? "+listenerAdapter.getFlvRecordingMetaDataId()+ " " +flvRecordingMetaDataId);
         
View Full Code Here

            if ( !( event instanceof IRTMPEvent ) ) {
                logger.debug( "skipping non rtmp event: " + event );
                return;
            }

            IRTMPEvent rtmpEvent = (IRTMPEvent) event;

            if ( logger.isDebugEnabled() ) {
                // logger.debug("rtmp event: " + rtmpEvent.getHeader() + ", " +
                // rtmpEvent.getClass().getSimpleName());
            }

            if ( !( rtmpEvent instanceof IStreamData ) ) {
                logger.debug( "skipping non stream data" );
                return;
            }

            if ( rtmpEvent.getHeader().getSize() == 0 ) {
                logger.debug( "skipping event where size == 0" );
                return;
            }

            if ( rtmpEvent instanceof VideoData ) {
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.