Ejemplo n.º 1
0
    public void write(JobContext jobCtx, MarshallerWriteContext outputCtx) throws IOException {
      outputCtx.writeShort(PersisterEnums.EXPIRE_TIMER);

      // ExpireJob, no state
      ExpireJobContext ejobCtx = (ExpireJobContext) jobCtx;
      WorkingMemoryReteExpireAction expireAction = ejobCtx.getExpireAction();
      outputCtx.writeInt(expireAction.getFactHandle().getId());
      outputCtx.writeUTF(expireAction.getNode().getEntryPoint().getEntryPointId());

      outputCtx.writeUTF(
          ((ClassObjectType) expireAction.getNode().getObjectType()).getClassType().getName());

      DefaultJobHandle jobHandle = (DefaultJobHandle) ejobCtx.getJobHandle();
      PointInTimeTrigger trigger =
          (PointInTimeTrigger) jobHandle.getTimerJobInstance().getTrigger();
      outputCtx.writeLong(trigger.hasNextFireTime().getTime());
    }