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.
| Online: | 15 Members of 9400 |
Ideas for the JSR-299 portable extensions package.
Allow the bean-level annotations to be specified by the constructor, and allow this for multiple constructors:
class Settings {
@Constructs @ApplicationScoped @Default Settings() { ... }
@Constructs @Custom Settings(@Default Settings defaults) { ... }
}
This feature is scheduled for inclusion in the JSR-299 maintenance release.
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.
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").
Marking an injection point as accepting a null value when there is no matching bean.
The transient modifier is used to mark a field as accepting a non-passivation-capable dependency. The @Transient annotation would do the same for a method parameter.
Each bean has an implicit qualifier @Exact(BeanClass.class), allowing the injection point to specify the exact implementation required.
@Inject @Exact FooBean foo;
@Inject @Exact(FooBean.class) Foo foo;
Support the introduction
of new bean types to an existing bean. This bean would have bean types Foo and Bar:
class Foo {
@Introduces Bar getBar() { return ...; }
}
or
class Foo {
@Introduces Bar bar = new Bar();
}
The class must be proxyable, so that invocations of the introduced interface can be delegated to the object that implements the introduced interface.
Allow a package-level annotation to specify the qualifier for names of beans in the package.
@NameQualifier("org.jboss") package org.jboss;
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.
A custom scope for the JTA transaction.
class Jms {
@Resource(name="java:global/env/jms/PaymentQueue")
@ConnectionFactory(@Resource(name="java:global/env/jms/ConnectionFactory"))
@Produces @PaymentProcessor Queue paymentQueue;
}
@ConnectionFactory(@Resource(name="java:global/env/jms/ConnectionFactory"))
class Jms {
@Resource(name="java:global/env/jms/Prices")
@Produces @Prices Topic pricesTopic;
@Resource(name="java:global/env/jms/PaymentQueue")
@Produces @PaymentProcessor Queue paymentQueue;
}
Support specification of a scope with persistence context declarations:
@Produces @ConversationScoped @PersistenceContext(type=EXTENDED) EntityManager em;
@Produces @TransactionScoped @PersistenceContext EntityManager em;
Support injection of SLF4J Logger objects:
@Inject Logger log;
Support injection of values from a properties file:
@Inject @Resource("/path/file") Properties properties;
Support direct injection of the following objects:
Map the events defined by the servlet specification to the 299 event bus:
The ability to map event types to distribution via a JMS topic:
void distributedDeleteCustomer(@Observes CustomerEvent, @Events Topic topic, ConnectionFactory cf);
An enhanced conversation scope with support for natural ids.
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.
Implement the typesafe XML-based configuration format that was defined in earlier revisions of the specification.
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.
Nested conversations? Or are they considered bad practice?
If a man speaks in the forest and there is no woman around to hear him, is he still wrong?
Not sure. There is always going to be some uncertainty about what belongs in this package and what belongs in Seam. Also, some of the features I've listed here may really belong in their own packages (e.g. the XML configuration stuff).
Learn more about Weld...
Looks promising! Apparently @Exact is not the same as @Typed?
If a man speaks in the forest and there is no woman around to hear him, is he still wrong?
No, @Exact is a qualifier that you use at injection points, it's not a way to restrict the bean types at the level of the bean. However, they can be used to resolve some of the same ambiguities.
Learn more about Weld...
Definitely looking forward to more injectables, especially the servlet contexts. I think it would make sense to add HttpServletResponse to the list to round things out.
When can we look forward to this or JSR 299 MR1?
skechers shape ups shoes skechers shape ups shoes shape ups shoes shape ups shoes shape up shoes shape up shoes MLB jerseys MLB jerseys cheap MLB jerseys cheap MLB jerseys MLB jersey MLB jersey wholesale mlb jerseys wholesale mlb jerseys discount mlb jerseys discount mlb jerseys replica mlb jerseys replica mlb jerseys GHD GHD GHD Hair Straighteners GHD Hair Straighteners GHD Straighteners GHD Straighteners MBT shoes MBT shoes MBT mbt discount mbt shoes discount mbt shoes ghd hair straighteners wholesale GHD hair straighteners wholesale cheap ghd straighteners cheap GHD straighteners Buy Cheap GHD MK4 buy cheap ghd MK4 chi chi chi hair straightener chi hair straightener chi flat iron chi flat iron shape ups shoes wholesale shape ups shoes wholesale cheap skechers shape ups shoes cheap skechers shape ups shoes discount shape up shoes discount shape up shoes wholesale mbt shoes wholesale mbt shoes mbt shoes mbt shoes cheap mbt shoes cheap mbt shoes reebok easytone reebok easytone reebok easytone shoes reebok easytone shoes reebok easy tone Reebok easy tone reebok wholesale reebok wholesale reebok easytone wholesale reebok easytone wholesale wholesale reebok shoes wholesale reebok shoes tory burch tory burch tory burch shoes tory burch shoes vibram five fingers vibram five fingers vibram five finger shoes vibram five finger shoes five finger shoes five finger shoes nfl jerseys nfl jerseys nfl jerseys wholesale nfl jerseys wholesale cheap nfl jerseys cheap nfl jerseys christian louboutin christian louboutin christian louboutin shoes christian louboutin shoes christian louboutin boots christian louboutin boots ed hardy Ed Hardy ed hardy clothing ed hardy clothing ed hardy shoes ed hardy shoes ed hardy ED Hardy ed hardy bikini ed hardy bikini ed hardy t-shirts ed hardy t-shirts mlb trade rumors mlb trade rumors skechers develops skechers develops reebok careers reebok careers cheap car insurance cheap car insurance home loans home loans world cup jerseys world cup jerseys 2010 world cup soccer jersey 2010 world cup soccer jersey football jerseys football jerseys world cup jerseys world cup jerseys 2010 world cup jerseys 2010 world cup jerseys soccer jersey soccer jersey wholesale mlb jerseys wholesale mlb jerseys wholesale mlb jersey wholesale mlb jersey mlb jerseys made in china mlb jerseys made in china ugg boots ugg boots cheap ugg boots cheap ugg boots discount ugg boots discount ugg boots wholesale Vibram five fingers shoes Wholesale Vibram five fingers shoes wholesale Vibram five fingers Wholesale Vibram five fingers discount vibram five fingers discount vibram five fingers mbt shoes mbt shoes mbt shoes cheap mbt shoes cheap discount mbt shoes discount mbt shoes cheap mlb jerseys cheap mlb jerseys mlb jerseys mlb jerseys mlb jersey mlb jersey shape ups shoes shape ups shoes shape up shoes shape up shoes skechers skechers ghd wholesale ghd wholesale ghd hair straighteners wholesale ghd hair straighteners wholesale wholesale chi wholesale chi wholesale ghd wholesale ghd wholesale ghd hair straighteners wholesale ghd hair straighteners wholesale ghd suppliers wholesale ghd suppliers ugg boots ugg boots discount ugg boots discount ugg boots cheap ugg boots cheap ugg boots ugg boots ugg boots uggs uggs cheap ugg boots cheap ugg boots