Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-beta-1
-
Fix Version/s: 1.0-beta-1
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Number of attachments :
Description
Jon Tirsen:
I think we are ready to support multiple implementations now.
I'm suggesting something along the lines of:
SomeContainer container = new SomeContainer();
container.registerComponent("impl1", Service.class, ServiceImpl.class);
container.registerComponent("impl2", Service.class, ServiceImpl.class);
// register component
container.registerComponent(Component.class, Component.class,
new Parameter[]
);
// access component
container.getComponent("impl1");
Ie. implementations are optionally keyed (type: Object?), a
ComponentParameter optionally takes a key as an argument and wires in
the implementation based on that key.
James Strachan:
I want to refactor the Messenger project so that all the JMS
Connections & JMS Destinations are managed in a Pico container (and
in this particular case, constructed from an XML config file).
http://jakarta.apache.org/commons/sandbox/messenger/
Then I want to create a bunch of Consumer objects which use the JMS
Connections and Destinations, which are just pico components using
type-3 constructors. Again I want to use an XML config file to define
the consumers, their component class and the connection & destination
names & bind the named connections & destinations to the Consumers.
Then I want the whole lot managed via a single root PicoContainer for
lifecycles etc.
i.e. I need a container of components which all implement the same
interface (Consumer, Destination, Connection).
plus lengthy discussion on mailing list.
Activity
Field | Original Value | New Value |
---|---|---|
Description |
James Strachan: I want to refactor the Messenger project so that all the JMS Connections & JMS Destinations are managed in a Pico container (and in this particular case, constructed from an XML config file). http://jakarta.apache.org/commons/sandbox/messenger/ Then I want to create a bunch of Consumer objects which use the JMS Connections and Destinations, which are just pico components using type-3 constructors. Again I want to use an XML config file to define the consumers, their component class and the connection & destination names & bind the named connections & destinations to the Consumers. Then I want the whole lot managed via a single root PicoContainer for lifecycles etc. i.e. I need a container of components which all implement the same interface (Consumer, Destination, Connection). plus lengthy discussion on mailing list. |
Jon Tirsen: I think we are ready to support multiple implementations now. I'm suggesting something along the lines of: SomeContainer container = new SomeContainer(); container.registerComponent("impl1", Service.class, ServiceImpl.class); container.registerComponent("impl2", Service.class, ServiceImpl.class); // register component container.registerComponent(Component.class, Component.class, new Parameter[] { new ComponentParameter("impl1"), new ComponentParameter("impl2") }); // access component container.getComponent("impl1"); Ie. implementations are optionally keyed (type: Object?), a ComponentParameter optionally takes a key as an argument and wires in the implementation based on that key. James Strachan: I want to refactor the Messenger project so that all the JMS Connections & JMS Destinations are managed in a Pico container (and in this particular case, constructed from an XML config file). http://jakarta.apache.org/commons/sandbox/messenger/ Then I want to create a bunch of Consumer objects which use the JMS Connections and Destinations, which are just pico components using type-3 constructors. Again I want to use an XML config file to define the consumers, their component class and the connection & destination names & bind the named connections & destinations to the Consumers. Then I want the whole lot managed via a single root PicoContainer for lifecycles etc. i.e. I need a container of components which all implement the same interface (Consumer, Destination, Connection). plus lengthy discussion on mailing list. |
Affects Version/s | 1.0-beta-1 [ 10144 ] | |
Component/s | Core [ 10191 ] | |
Fix Version/s | 1.0-beta-1 [ 10144 ] |
Status | Unassigned [ 1 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] |
Scheduling for 1.0-beta-1