Package org.jboss.as.ejb3.timerservice

Examples of org.jboss.as.ejb3.timerservice.TimerImpl


            return;
        }
        final EJBClientContext ejbClientContext = this.getEJBClientContext(phaseContext);
        final ServiceController<TCCLEJBClientContextSelectorService> tcclEJBClientContextSelectorServiceController = (ServiceController<TCCLEJBClientContextSelectorService>) phaseContext.getServiceRegistry().getService(TCCLEJBClientContextSelectorService.TCCL_BASED_EJB_CLIENT_CONTEXT_SELECTOR_SERVICE_NAME);
        if (tcclEJBClientContextSelectorServiceController != null) {
            final TCCLEJBClientContextSelectorService tcclBasedEJBClientContextSelector = tcclEJBClientContextSelectorServiceController.getValue();
            // associate the EJB client context with the deployment classloader
            logger.debug("Registering EJB client context " + ejbClientContext + " for classloader " + module.getClassLoader());
            tcclBasedEJBClientContextSelector.registerEJBClientContext(ejbClientContext, module.getClassLoader());
        }
        final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
        if(moduleDescription == null) {
            return;
        }
View Full Code Here


    }

    @Override
    public EJBBoundResourceAdapterBindingMetaData parse(XMLStreamReader reader, final PropertyReplacer propertyReplacer) throws XMLStreamException {
        EJBBoundResourceAdapterBindingMetaData metaData = new EJBBoundResourceAdapterBindingMetaData();
        processElements(metaData, reader, propertyReplacer);
        return metaData;
    }
View Full Code Here

        });
    }

    protected void setupSecurityInterceptors(final ViewDescription view) {
        // setup security interceptor for the component
        view.getConfigurators().add(new EJBSecurityViewConfigurator());
    }
View Full Code Here

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

     */
    public void removeAllTimers() {
        //cancel all timers for this entity
        for (final Timer timer : getComponent().getTimerService().getTimers()) {
            if (timer instanceof TimerImpl) {
                TimerImpl timerImpl = (TimerImpl) timer;
                if (timerImpl.getPrimaryKey() != null && timerImpl.getPrimaryKey().equals(getPrimaryKey())) {
                    timer.cancel();
                }
            }
        }
    }
View Full Code Here

            statement.setString(2, partition);
            resultSet = statement.executeQuery();
            final List<TimerImpl> timers = new ArrayList<TimerImpl>();
            while (resultSet.next()) {
                try {
                    final TimerImpl timerImpl = timerFromResult(resultSet, timerService);
                    if (timerImpl != null) {
                        timers.add(timerImpl);
                    }
                } catch (Exception e) {
                    EjbLogger.ROOT_LOGGER.timerReinstatementFailed(resultSet.getString(2), resultSet.getString(1), e);
View Full Code Here

                                    String id = resultSet.getString(1);
                                    if (!existing.remove(id)) {
                                        synchronized (DatabaseTimerPersistence.this) {
                                            knownTimerIds.get(timedObjectId).add(id);
                                        }
                                        final TimerImpl timerImpl = timerFromResult(resultSet, listener.getTimerService());
                                        listener.timerAdded(timerImpl);
                                    }
                                } catch (Exception e) {
                                    EjbLogger.ROOT_LOGGER.timerReinstatementFailed(resultSet.getString(2), resultSet.getString(1), e);
                                }
View Full Code Here

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

        super.registerOperations(resourceRegistration);
        resourceRegistration.registerOperationHandler(SUSPEND, new AbstractTimerHandler() {

            @Override
            void executeRuntime(OperationContext context, ModelNode operation) throws OperationFailedException {
                final TimerImpl timer = getTimer(context, operation);
                timer.suspend();
                context.completeStep(new OperationContext.RollbackHandler() {

                    @Override
                    public void handleRollback(OperationContext context, ModelNode operation) {
                        timer.scheduleTimeout(true);
                    }
                });
            }
        });

        resourceRegistration.registerOperationHandler(ACTIVATE, new AbstractTimerHandler() {

            @Override
            void executeRuntime(OperationContext context, ModelNode operation) throws OperationFailedException {
                final TimerImpl timer = getTimer(context, operation);
                if (!timer.isActive()) {
                    timer.scheduleTimeout(true);
                    context.completeStep(new OperationContext.RollbackHandler() {

                        @Override
                        public void handleRollback(OperationContext context, ModelNode operation) {
                            timer.suspend();
                        }
                    });
                } else {
                    throw EjbLogger.ROOT_LOGGER.timerIsActive(timer);
                }
            }
        });

        resourceRegistration.registerOperationHandler(CANCEL, new AbstractTimerHandler() {

            @Override
            void executeRuntime(OperationContext context, ModelNode operation) throws OperationFailedException {
                final TimerImpl timer = getTimer(context, operation);
                // this is TX aware
                timer.cancel();
                context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
            }
        });

        resourceRegistration.registerOperationHandler(TRIGGER, new AbstractTimerHandler() {

            @Override
            void executeRuntime(OperationContext context, ModelNode operation) throws OperationFailedException {
                // This will invoke timer in 'management-handler-thread'
                final TimerImpl timer = getTimer(context, operation);
                timer.invoke();
                context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
            }
        });
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.ejb3.timerservice.TimerImpl

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.