[
https://issues.jboss.org/browse/CDI-26?page=com.atlassian.jira.plugin.sys...
]
Jozef Hartinger commented on CDI-26:
------------------------------------
An alternative proposal that does not prevent parallel container instances:
{code:java}
public abstract class ControlledCDI<T> extends CDI<T> implements AutoCloseable
{
public static ControlledCDI<Object> initialize() {
// TODO: Use CDIProvider internally to talk to the impl
}
public static ControlledCDI<Object> initialize(Map<String, Object>
properties) {
// TODO: Use CDIProvider internally to talk to the impl
}
public abstract void close();
}
{code}
Usage:
{code:java}
try (ControlledCDI<Object> cdi = ControlledCDI.initialize()) {
Foo foo = cdi.select(Foo.class).get();
System.out.println(foo.computeResult());
}
{code}
Note that this is a preliminary proposal. The class name is subject to change plus
we'll most likely need a builder API instead of the static methods in the end.
Bootstrap API for CDI
---------------------
Key: CDI-26
URL:
https://issues.jboss.org/browse/CDI-26
Project: CDI Specification Issues
Issue Type: Feature Request
Components: Packaging and Deployment
Affects Versions: 1.0, 1.1.PFD, 1.2.Final
Reporter: Pete Muir
Fix For: 2.0 (discussion)
Weld and other CDI impls allow an embedded mode.
See
http://docs.jboss.org/weld/reference/latest/en-US/html/environments.html#... for
example
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)