Daniel Dekany wrote:

As far as I see, be default a component uses transient lifestyle. Also,
a component defined in block.xml uses activation="startup" be default.


The activation policy defaults to startup IF the component is declared in the block.xml. All non declared components default to on-demand.


So the result is that the transient component is instantiated at
startup. How could it be useful to instantiate a transient components at
startup?



The only impact is the side effect. For example - a transient component could iniate some action that changes the state of the system. Aside from that it isn't terribly useful. Generally speaking about 80% of the components I deal with a singleton - the trnansient style is occassionally useful. However - the container cannot assume singleton (i.e. thread safe) behaviour and as such has to default to the reliable scenario.


If I call ServiceManager.lookup, I always get a new instance,
so I can't get the instance created at startup anyway.


Correct - unless you declare an alternative startup policy in your component declaration.


Stephen.

--

Stephen J. McConnell
mailto:[EMAIL PROTECTED]

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/                               |
|------------------------------------------------|





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to