/**
* Asserts that we have been properly configured
*/
@PostConstruct public void validateConfiguration(){
Assert.notNull(elementType,"Element type must be set, either explicitly or by setting the model");
Assert.notNull(source,"Source must be set");
if (elementStopPattern != null) {
Assert.notNull(elementStartPattern,"elementStopPattern can only be used if an elementStartPattern is also set");
}
}

Example 12

From project camelpe, under directory /examples/loan-broker-jboss7/src/main/java/net/camelpe/examples/jboss7/loanbroker/queue/.

/**
* Create the Service and wait until it is started.<br/> Will log a message if the service will not start in 10sec.
*/
@PostConstruct protected void startup(){
LOGGER.info("StartupSingleton will be initialized!");
HATimerService service=new HATimerService();
SingletonService<String> singleton=new SingletonService<String>(service,HATimerService.SINGLETON_SERVICE_NAME);
ServiceController<String> controller=singleton.build(CurrentServiceContainer.getServiceContainer()).addDependency(ServerEnvironmentService.SERVICE_NAME,ServerEnvironment.class,service.env).install();
controller.setMode(ServiceController.Mode.ACTIVE);
try {
wait(controller,EnumSet.of(ServiceController.State.DOWN,ServiceController.State.STARTING),ServiceController.State.UP);
LOGGER.info("StartupSingleton has started the Service");
}
catch ( IllegalStateException e) {
LOGGER.warn("Singleton Service {} not started, are you sure to start in a cluster (HA) environment?",HATimerService.SINGLETON_SERVICE_NAME);
}
}

Example 44

From project jboss-ejb3-singleton, under directory /testsuite/src/test/java/org/jboss/ejb3/singleton/integration/test/dependson/somejar/.

From project myfaces-extcdi, under directory /alternative-modules/alternative-configuration-modules/core-alternative-configuration-module/src/main/java/org/apache/myfaces/extensions/cdi/core/alternative/config/.