I like to install a component conditionally. I prefer something that the component is installed when a definition appears in 'components.xml'. The components looks like:
@Name("xService") @Scope(ScopeType.APPLICATION) public class XService { @Logger private static Log log; @Create public void create() { log.debug("create()"); } @Observer(value = TransactionService.EVENT_TRANSACTION_ADDED, create = false) public void event(Transaction transaction) { ... }
The purpose of this component is to process the observed transaction in a particular configuration. So, how to create this component only in particular cases?
Hi,
read the chapter on conditional installation in the Seam documentation. For that task you use the install annotation.
Leo