Examples of NonFunctionalTimerService


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

                    componentDescription.getConfigurators().add(new ComponentConfigurator() {
                        @Override
                        public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException {
                            final EJBComponentDescription ejbComponentDescription = (EJBComponentDescription) description;
                            final ServiceName nonFunctionalTimerServiceName = NonFunctionalTimerService.serviceNameFor(ejbComponentDescription);
                            final NonFunctionalTimerService nonFunctionalTimerService;
                            if (ejbComponentDescription instanceof StatefulComponentDescription) {
                                // for stateful beans, use a different error message that gets thrown from the NonFunctionalTimerService
                                nonFunctionalTimerService = new NonFunctionalTimerService(EjbLogger.ROOT_LOGGER.timerServiceMethodNotAllowedForSFSB(ejbComponentDescription.getComponentName()), timerServiceRegistry);
                            } else {
                                nonFunctionalTimerService = new NonFunctionalTimerService(EjbLogger.ROOT_LOGGER.ejbHasNoTimerMethods(), timerServiceRegistry);
                            }
                            // add the non-functional timer service as a MSC service
                            context.getServiceTarget().addService(nonFunctionalTimerServiceName, nonFunctionalTimerService).install();
                            // set the timer service in the EJB component
                            ejbComponentDescription.setTimerService(nonFunctionalTimerService);
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.