[JBoss JIRA] Created: (JBIDE-3136) New decorator from existing Web Bean
by Dan Allen (JIRA)
New decorator from existing Web Bean
------------------------------------
Key: JBIDE-3136
URL: https://jira.jboss.org/jira/browse/JBIDE-3136
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Components: webbeans
Reporter: Dan Allen
Fix For: LATER
Suppose we have an interface that represents accounts:
public interface Account {
public BigDecimal getBalance();
public User getOwner();
public void withdraw(BigDecimal amount);
public void deposit(BigDecimal amount);
}
A decorator is a simple Web Bean that implements the type it decorates and is annotated @Decorator.
@Decorator
public abstract class LargeTransactionDecorator
implements Account {
@Decorates Account account;
@PersistenceContext EntityManager em;
public void withdraw(BigDecimal amount) {
account.withdraw(amount);
if ( amount.compareTo(LARGE_AMOUNT)>0 ) {
em.persist( new LoggedWithdrawl(amount) );
}
}
public void deposit(BigDecimal amount);
account.deposit(amount);
if ( amount.compareTo(LARGE_AMOUNT)>0 ) {
em.persist( new LoggedDeposit(amount) );
}
}
}
The tooling would not only help you create the class that acts as the decorator, but make sure that it implements the same interfaces as the Web Beans and injects the Web Bean into a @Decorate field.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 7 months
[JBoss JIRA] Created: (JBIDE-6728) Provide built-in bean for field injection points with type Event<X>
by Viacheslav Kabanovich (JIRA)
Provide built-in bean for field injection points with type Event<X>
-------------------------------------------------------------------
Key: JBIDE-6728
URL: https://jira.jboss.org/browse/JBIDE-6728
Project: Tools (JBoss Tools)
Issue Type: Feature Request
Components: cdi (jsr-299)
Reporter: Viacheslav Kabanovich
Assignee: Viacheslav Kabanovich
Fix For: 3.2.0.M2
JSR-299:
10.3.2. The built-in Event
The container must provide a built-in bean with:
• in its set of bean types, for every Java type X that does not contain a type variable,
Event<X>
• every event qualifier type in its set of qualifier types,
• scope @Dependent,
• no bean EL name, and
• an implementation provided automatically by the container.
For example, this injection field
@Inject @Any @Tame @Role("Master") Event<TamingCommand> tamingEvent;
should not be marked by CDI validator as having no bean for injection.
Test ObserverMethodResolutionTest.testEventBean() should pass.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 7 months