Testing applications for HA singleton MSC services. Each of the applications will be deployed on all cluster nodes, but the service will be active only on one node at any given time.
The project is structured into 4 main modules with 1 additional module for manual testing:
This is built with Java target 6, because of some internal implementation details.
ServiceAccess, the@Remoteinterface exposed byServiceAccessBean(see below) that provides the functionality of the singleton service
Classes that are shared between the startup-ejb and service-activator modules (see below).
TestingSingletonService, which is an HA singleton service that provides current node name, which is the name of the cluster node where the service is currently runningMyTimerBean, which is a@SingletonEJB that shows how to create a HA singleton EJB timer; it provides two methods:initialize, which creates an EJB timer that logs a message each second; this method is called by theTestingSingletonServiceduring activationstop, which cancels the previously created EJB timer; this method is called by theTestingSingletonServiceduring removal
ServiceAccessBean, which is a@StatelessEJB that exposes theTestingSingletonServiceto EJB clients
An application that activates the singleton service using a @Singleton @Startup EJB and uses a custom, in-place built
singleton policy.
SingletonStartupBean, which is a@Singleton @StartupEJB that installs and activates theTestingSingletonServiceduring@PostConstructand removes it during@PreDestroy
An application that activates the singleton service using ServiceActivator and uses a singleton policy defined
in the singleton subsystem.
SingletonActivator, which is aServiceActivatorthat installs and activates theTestingSingletonService
Main, which is a Java application that uses JBoss EJB Client to invoke theServiceAccessBeanremotely; it is not used for automated tests, but can be easily used for manual testing when required
The standard Maven incantation is everything you need: mvn clean install. Maven 3 is assumed.
Major version number is the generation number of JBoss EAP that is targeted by the applications. Minor version number is specific to this application.