Henning P. Schmiedehausen wrote:
Berin Loritsch <[EMAIL PROTECTED]> writes:
If it is ThreadSafe, it should start up right away. If it is pooled,
there is no way around it.
Hi,
I used
public class TorqueComponent
extends AbstractLogEnabled
implements Component,
Configurable,
Initializable,
Contextualizable,
Startable,
ThreadSafe
{
...
}
No, it does not start immediately. Only when the component is
requested for the first time. At least with ECM.
Then the only thing I can offer you is to suggest upgrading to
Fortress. You can identify the startup strategy more easily
with that.
As to accessing the components via static accessors, you might
want to take advantage of the Factory pattern to aleviate some
of the issues:
public final TorqueComponentFactory
{
private static TorqueComponent m_component;
public static TorqueComponent getTorque()
{
synchronized( TorqueComponent.class )
{
if (null == m_component)
{
ComponentManager manager = ECMFactory.getECM();
m_component = (TorqueComponent)
manager.lookup(TorqueComponent.class.getName());
}
}
return m_component;
}
}
You will have to add the proper try/catch block, but it will ensure you
get the TorqueComponent even with delayed initialization.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]