Hello. I'm trying to make my Turbine application to work with Merlin. I'm
retrieving components in actions and screens with the following:
public abstract class AbstractAction extends VelocitySecureAction
{
public void doPerform( RunData data, Context context )
throws Exception
{
ContainmentModel containmentModel =
( ContainmentModel )data.getServletContext().getAttribute(
"urn:composition:root" );
m_serviceResolver = new ServiceResolver( containmentModel );
}
}
public class ServiceResolver
{
private ContainmentModel m_containmentModel;
public ServiceResolver( ContainmentModel model )
{
m_containmentModel = model;
}
private Object lookupService( String serviceClassName )
{
ReferenceDescriptor reference = new ReferenceDescriptor(
serviceClassName );
DeploymentModel model = ( DeploymentModel
)m_containmentModel.getModel( reference );
return model.resolve();
}
}
I have some questions regarding it:
1. Is it the right way to ask container for components?
2. If it is the right way, does the container care about component lifecycle
when I do it, so I don't need to dispose components with lifestyle="thread"
at the end of action?
3. Is the Merlin kernel threadsafe, so I can have one instance of
ServiceResolver per web application?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]