Package org.jboss.as.ejb3.timerservice.persistence

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


    /**
     * {@inheritDoc}
     */
    @Override
    protected JaccService<AttachmentList<EjbJaccConfig>> createService(String contextId, AttachmentList<EjbJaccConfig> metaData, Boolean standalone) {
        return new EjbJaccService(contextId, metaData, standalone);
    }
View Full Code Here


                    configuration.addTimeoutViewInterceptor(shutDownInterceptorFactory, InterceptorOrder.View.SHUTDOWN_INTERCEPTOR);
                    configuration.addTimeoutViewInterceptor(new ImmediateInterceptorFactory(new TCCLInterceptor(configuration.getModuleClassLoader())), InterceptorOrder.View.TCCL_INTERCEPTOR);
                    configuration.addTimeoutViewInterceptor(configuration.getNamespaceContextInterceptorFactory(), InterceptorOrder.View.JNDI_NAMESPACE_INTERCEPTOR);
                    configuration.addTimeoutViewInterceptor(CurrentInvocationContextInterceptor.FACTORY, InterceptorOrder.View.INVOCATION_CONTEXT_INTERCEPTOR);
                    if (isSecurityEnabled()) {
                        configuration.addTimeoutViewInterceptor(new SecurityContextInterceptorFactory(), InterceptorOrder.View.SECURITY_CONTEXT);
                    }
                    for (final Method method : configuration.getClassIndex().getClassMethods()) {
                        configuration.addTimeoutViewInterceptor(method, new ImmediateInterceptorFactory(new ComponentDispatcherInterceptor(method)), InterceptorOrder.View.COMPONENT_DISPATCHER);
                    }
                }
View Full Code Here

                        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

        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

    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

            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

            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

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

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

                case EXPIRED:
                    nonPersistentTimers.remove(timer.handle);
            }
        } else {
            // get the persistent entity from the timer
            final TimerEntity timerEntity = timer.getPersistentState();
            try {
                persistentWaitingOnTxCompletionTimers.remove(timer.handle);
                //if timer persistence is disabled
                if (timerPersistence == null) {
                    ROOT_LOGGER.timerPersistenceNotEnable();
                    return;
                }
                if (timerEntity.getTimerState() == TimerState.EXPIRED ||
                        timerEntity.getTimerState() == TimerState.CANCELED) {
                    timerPersistence.getValue().removeTimer(timerEntity);
                } else {
                    timerPersistence.getValue().persistTimer(timerEntity);
                }
View Full Code Here

TOP

Related Classes of org.jboss.as.ejb3.timerservice.persistence.TimerEntity

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.