void createMissingPermissions(Container con, BeanMetaData bean) throws ClassNotFoundException,
PolicyContextException
{
String contextID = con.getJaccContextID();
PolicyConfigurationFactory pcFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
PolicyConfiguration pc = pcFactory.getPolicyConfiguration(contextID, false);
Class clazz = con.getHomeClass();
// If there is no security domain mark all methods as unchecked
boolean hasSecurityDomain = con.getSecurityManager() != null;
boolean exclude = hasSecurityDomain ? bean.isExcludeMissingMethods() : false;
if (clazz != null)
{
addMissingMethodPermissions(bean, exclude, clazz, InvocationType.HOME, pc);
}
clazz = con.getLocalHomeClass();
if (clazz != null)
{
addMissingMethodPermissions(bean, exclude, clazz, InvocationType.LOCALHOME, pc);
}
clazz = con.getLocalClass();
if (clazz != null)
{
addMissingMethodPermissions(bean, exclude, clazz, InvocationType.LOCAL, pc);
}
clazz = con.getRemoteClass();
if (clazz != null)
{
addMissingMethodPermissions(bean, exclude, clazz, InvocationType.REMOTE, pc);
}
if (pc.inService() == false)
pc.commit();
// Allow the policy to incorporate the policy configs
Policy.getPolicy().refresh();
}