// if the EJB is packaged in a .war, then we need to bind the java:comp/TimerService only once for the entire module
if (componentDescription.getNamingMode() != ComponentNamingMode.CREATE) {
// get the module description
final EEModuleDescription moduleDescription = componentDescription.getModuleDescription();
// create a configurator which binds at the module level
moduleDescription.getConfigurators().add(new EEModuleConfigurator() {
@Override
public void configure(DeploymentPhaseContext context, EEModuleDescription description, EEModuleConfiguration configuration) throws DeploymentUnitProcessingException {
// the java:module/TimerService binding configuration
// Note that we bind to java:module/TimerService since it's a .war. End users can still lookup java:comp/TimerService
// and that will internally get translated to java:module/TimerService for .war, since java:comp == java:module in