Examples of TimerEntity


Examples of org.camunda.bpm.engine.impl.persistence.entity.TimerEntity

  @SuppressWarnings("unchecked")
  protected void addTimerDeclarations(ProcessDefinitionEntity processDefinition) {
    List<TimerDeclarationImpl> timerDeclarations = (List<TimerDeclarationImpl>) processDefinition.getProperty(BpmnParse.PROPERTYNAME_START_TIMER);
    if (timerDeclarations!=null) {
      for (TimerDeclarationImpl timerDeclaration : timerDeclarations) {
        TimerEntity timer = timerDeclaration.createTimerInstance(null);
        timer.setDeploymentId(processDefinition.getDeploymentId());
      }
    }
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.persistence.entity.TimerEntity

    JobExecutor jobExecutor = processEngineConfiguration.getJobExecutor();

    String jobId = commandExecutor.execute(new Command<String>() {

      public String execute(CommandContext commandContext) {
        TimerEntity timer = createTweetTimer("i'm coding a test", new Date(SOME_TIME + (10 * SECOND)));
        commandContext.getJobManager().schedule(timer);
        return timer.getId();
      }
    });

    AcquiredJobs acquiredJobs = commandExecutor.execute(new AcquireJobsCmd(jobExecutor));
    List<List<String>> jobIdsList = acquiredJobs.getJobIdBatches();
View Full Code Here

Examples of org.camunda.bpm.engine.impl.persistence.entity.TimerEntity

    return null;
  }

  protected void scheduleSuspensionStateUpdate(CommandContext commandContext) {
    TimerEntity timer = new TimerEntity();

    timer.setDuedate(executionDate);
    timer.setJobHandlerType(getDelayedExecutionJobHandlerType());

    String jobConfiguration = null;

    if (processDefinitionId != null) {
      jobConfiguration = TimerChangeProcessDefinitionSuspensionStateJobHandler
          .createJobHandlerConfigurationByProcessDefinitionId(processDefinitionId, includeProcessInstances);
    } else

    if (processDefinitionKey != null) {
      jobConfiguration = TimerChangeProcessDefinitionSuspensionStateJobHandler
          .createJobHandlerConfigurationByProcessDefinitionKey(processDefinitionKey, includeProcessInstances);
    }

    timer.setJobHandlerConfiguration(jobConfiguration);

    commandContext.getJobManager().schedule(timer);
  }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.persistence.TimerEntity

                        nonPersistentTimers.remove(timer.getId());
                    }
            }
        } else {
            // get the persistent entity from the timer
            final TimerEntity timerEntity = timer.getPersistentState();
            try {
                if (timerPersistence == null) {
                    ROOT_LOGGER.timerPersistenceNotEnable();
                    return;
                }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.persistence.TimerEntity

        String timedObjectId = timerHandle.getTimedObjectId();
        if (timerPersistence == null) {
            return null;
        }

        final TimerEntity timerEntity = timerPersistence.getValue().loadTimer(id, timedObjectId);
        if (timerEntity == null) {
            throw MESSAGES.timerNotFound(id);
        }
        if (timerEntity.isCalendarTimer()) {
            return new CalendarTimer((CalendarTimerEntity) timerEntity, this);
        }
        return new TimerImpl(timerEntity, this);

    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.persistence.TimerEntity

    public TimerEntity loadTimer(final String id, final String timedObjectId) {
        final Lock lock = getLock(timedObjectId);
        try {
            lock.lock();
            final Map<String, TimerEntity> timers = getTimers(timedObjectId);
            final TimerEntity timer = timers.get(id);
            if (timer == null) {
                return null;
            }
            return mostRecentEntityVersion(timer);
        } finally {
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.persistence.TimerEntity

            if (status == Status.STATUS_UNKNOWN ||
                    status == Status.STATUS_NO_TRANSACTION) {
                return timerEntity;
            }
            final String key = timerTransactionKey(timerEntity);
            TimerEntity existing = (TimerEntity) transactionSynchronizationRegistry.getValue().getResource(key);
            return existing != null ? existing : timerEntity;
        } catch (SystemException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.persistence.TimerEntity

            for (File timerFile : file.listFiles()) {
                FileInputStream in = null;
                try {
                    in = new FileInputStream(timerFile);
                    unmarshaller.start(new InputStreamByteInput(in));
                    final TimerEntity entity = unmarshaller.readObject(TimerEntity.class);
                    timers.put(entity.getId(), entity);
                    unmarshaller.finish();
                } catch (Exception e) {
                    ROOT_LOGGER.failToRestoreTimersFromFile(timerFile, e);
                } finally {
                    if (in != null) {
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.persistence.TimerEntity

     * Creates and returns a new persistent state of this timer
     *
     * @return
     */
    protected TimerEntity createPersistentState() {
        return new TimerEntity(this);
    }
View Full Code Here

Examples of org.jboss.as.ejb3.timerservice.persistence.TimerEntity

     * Creates and returns a new persistent state of this timer
     *
     * @return
     */
    protected TimerEntity createPersistentState() {
        return new TimerEntity(this);
    }
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.