return applicationBundleMgr;
}
public ResourceBundleManager getBundleManager(PortletMetaData portletMD)
{
ResourceBundleManager bundleMgr = portletBundleMgrs.get(portletMD.getPortletName());
if (bundleMgr == null)
{
ResourceBundleFactory rbf = null;
String rbfName = metaData.getResourceBundleFactoryName();
if (rbfName != null)
{
try
{
Class<?> tmpClass = webApp.getClassLoader().loadClass(rbfName);
if (ResourceBundleFactory.class.isAssignableFrom(tmpClass))
{
Class<? extends ResourceBundleFactory> rbfClass = tmpClass.asSubclass(ResourceBundleFactory.class);
Constructor<? extends ResourceBundleFactory> rbfCtor = rbfClass.getConstructor(ClassLoader.class, String.class);
rbf = rbfCtor.newInstance(webApp.getClassLoader(), portletMD.getResourceBundle());
}
}
catch (Exception e)
{
// Need to log
}
}
//
if (rbf == null)
{
rbf = new SimpleResourceBundleFactory(webApp.getClassLoader(), portletMD.getResourceBundle());
}
//
bundleMgr = new ResourceBundleManager(null, rbf);
portletBundleMgrs.put(portletMD.getPortletName(), bundleMgr);
}
return bundleMgr;
}