public Lifecycle getLifecycle() throws PortletException
{
if (lifecycle != null) { return lifecycle; }
try
{
LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder
.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
if (log.isTraceEnabled())
{
log.trace("Retrieved lifecycleFactory " + lifecycleFactory);
}
String lifecycleId = portletConfig.getPortletContext()
.getInitParameter(LIFECYCLE_ID_ATTR);
if (log.isDebugEnabled())
{
log.debug("lifecycleId " + lifecycleId);
}
if (lifecycleId == null)
{
lifecycleId = LifecycleFactory.DEFAULT_LIFECYCLE;
}
lifecycle = lifecycleFactory.getLifecycle(lifecycleId);
if (log.isTraceEnabled())
{
log.trace("Retrieved lifecycle from lifecycleFactory "
+ lifecycle);
}