Help

Controls

Switch Workspace

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Comparing current revision with historical revision 17.
Document History: Portable Extensions Package
Current revision:
26
Parent:
Weld
Created On:
06. Oct 2009, 02:52 (gavin)
Last Modified On:
22. Mar 2010, 19:57 (dan)
Historical revisions:
25 29. Dec 2009, 22:38 (dan) ShowDiff
24 23. Nov 2009, 23:26 (gavin) ShowDiff
23 18. Nov 2009, 05:52 (gavin) ShowDiff
22 18. Nov 2009, 05:50 (gavin) ShowDiff
21 01. Nov 2009, 23:44 (gavin) ShowDiff
20 13. Oct 2009, 15:59 (gavin) ShowDiff
19 08. Oct 2009, 19:47 (gavin) ShowDiff
18 08. Oct 2009, 19:42 (gavin) ShowDiff
17 06. Oct 2009, 18:00 (gavin) ShowDiff
16 06. Oct 2009, 17:54 (gavin) ShowDiff
15 06. Oct 2009, 17:46 (gavin) ShowDiff
14 06. Oct 2009, 06:46 (gavin) ShowDiff
13 06. Oct 2009, 06:45 (gavin) ShowDiff
12 06. Oct 2009, 06:43 (gavin) ShowDiff
11 06. Oct 2009, 06:38 (gavin) ShowDiff
10 06. Oct 2009, 06:32 (gavin) ShowDiff
9 06. Oct 2009, 06:29 (gavin) ShowDiff
8 06. Oct 2009, 06:28 (gavin) ShowDiff
7 06. Oct 2009, 06:27 (gavin) ShowDiff
6 06. Oct 2009, 06:26 (gavin) ShowDiff
5 06. Oct 2009, 06:25 (gavin) ShowDiff
4 06. Oct 2009, 06:23 (gavin) ShowDiff
3 06. Oct 2009, 06:20 (gavin) ShowDiff
2 06. Oct 2009, 06:15 (gavin) ShowDiff
1 06. Oct 2009, 06:13 (gavin) ShowDiff
0 (Initial Revision) ShowDiff

From line 14 added to lines 14 to 68:
*This feature is scheduled for inclusion in the JSR-299 maintenance release.*

+ Abstract producer methods

Remap qualifiers, EL name and/or scope (or just alias them) using an interface method declaration:

`@Produces @Named("foo") @Foo Baz foo(@Bar Baz bar);`

*This feature is scheduled for inclusion in the JSR-299 maintenance release.*

+ Generic beans

Allow a portable extension to define a set of "generic beans" for a specific "config annotation" like |@MessageBus|. These beans can inject the configuration, and can inject each other.

`@Generic(MessageBus.class)
@ApplicationScoped
class Topic {
@Inject MessageBus config;
}`

`@Generic(MessageBus.class)
@RequestScoped
class Session {
@Inject Topic topic;
@Inject MessageBus config;
}`

You can then add the config annotation to a producer field, together with whatever qualifier annotations you need:

`@Produces
@MessageBus(topic="default")
Topic topic;

@Produces @Prices
@MessageBus(topic="prices")
Topic prices;

@Produces @Deals
@MessageBus(topic="deals")
Topic deals;`

And now, finally, we can inject the "configured objects":

`@Inject Topic topic;
@Inject Session session;

@Inject @Prices Topic topic;
@Inject @Prices Session session;

@Inject @Deals Topic topic;
@Inject @Deals Session session;`

The trick here is that the |@Prices Session| gets the |@Prices Topic| injected, along with |@MessageBus(topic="prices") |, and the |@Deals Session| gets the |@Deals Topic| injected, along with |@MessageBus(topic="deals")|.


From lines 22 to 28 deleted to line 77:
+ |@BeanTypes| annotation

Allows the bean types of a bean to be explicitly specified by the user, instead of discovered by walking the type hierarchy.

`@BeanTypes(SpecialFoo.class)
class SpecialFoo extends Foo { ... }`

From lines 56 to 61 deleted to line 104:
+ Qualifier mappings

Remap qualifiers and name (or just alias them) using an interface method declaration:

`@Produces @Named("foo") @Foo Baz foo(@Bar Baz bar);`

From line 68 added to lines 110 to 126:
+ Guice-style configuration API

An API for registering beans programmatically.

`class MyModule extends Module {

@Override void configure() {
addManagedBean(FooBean.class)
.withQualfiers(Bar.class)
.withBeanTypes(Foo.class, Bar.class)
.withName("foo");
}

}`

Where each |Module| is a 299 |Extension|.

From line 103 changed to line 162:
@PersistenceContext(type=EXTENDED) EntityManager em;`
@PersistenceContext EntityManager em;`
From line 107 changed to line 166:
Support injection of JDK |Logger| objects:
Support injection of [SLF4J=>http://www.slf4j.org/] |Logger| objects:
From line 109 changed to line 168:
`@Inject Logger;`
`@Inject Logger log;`
From line 146 changed to line 205:
A set of annotations for constraining the application of stereotypes, qualifier types, etc, beyond what is possible using |@Target|. For example, the ability to constrain the scope and/or bean types of beans with a certain stereotype.
A set of annotations for constraining the application of stereotypes, qualifier types, etc, beyond what is possible using |@Target|. For example, the ability to constrain the scope and/or bean types of beans with a certain stereotype.
From line 151 added to lines 210 to 213:

+ Integration with Spring, Guice, Seam2

To allow interoperation with the legacy proprietary DI solutions. Note that if/when 330 provides a configuration API, we will probably be able to implement a general-purpose integration layer with extremely minimal dependencies to 299 or proprietary code.