/** * Create a new UserDatabaseRealm. * * @param parent MBean Name of the associated parent component * @param resourceName Global JNDI resource name of the associated * UserDatabase * @return the object name of the created realm * * @exception Exception if an MBean cannot be created or registered */ public String createUserDatabaseRealm(String parent, String resourceName) throws Exception { // Create a new UserDatabaseRealm instance UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName); // Add the new instance to its parent component return addRealmToParent(parent, realm); }
/** * Create a new UserDatabaseRealm. * * @param parent MBean Name of the associated parent component * @param resourceName Global JNDI resource name of the associated * UserDatabase * @return the object name of the created realm * * @exception Exception if an MBean cannot be created or registered */ public String createUserDatabaseRealm(String parent, String resourceName) throws Exception { // Create a new UserDatabaseRealm instance UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName); // Add the new instance to its parent component return addRealmToParent(parent, realm); }
UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName);
UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName);
UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName);
/** * Create a new UserDatabaseRealm. * * @param parent MBean Name of the associated parent component * @param resourceName Global JNDI resource name of the associated * UserDatabase * * @exception Exception if an MBean cannot be created or registered */ public String createUserDatabaseRealm(String parent, String resourceName) throws Exception { // Create a new UserDatabaseRealm instance UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); Container container = getParentContainerFromParent(pname); // Add the new instance to its parent component container.setRealm(realm); // Return the corresponding MBean name ObjectName oname = realm.getObjectName(); // FIXME getObjectName() returns null //ObjectName oname = // MBeanUtils.createObjectName(pname.getDomain(), realm); if (oname != null) { return (oname.toString()); } else { return null; } }
UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName);
UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName);
UserDatabaseRealm realm = new UserDatabaseRealm(); realm.setResourceName(resourceName);
ctxRes.setProperty("pathname", tomcatUsersLocation); tomcat.getServer().getGlobalNamingResources().addResource(ctxRes); tomcat.getEngine().setRealm(new org.apache.catalina.realm.UserDatabaseRealm());
ctxRes.setProperty("pathname", tomcatUsersLocation); tomcat.getServer().getGlobalNamingResources().addResource(ctxRes); tomcat.getEngine().setRealm(new org.apache.catalina.realm.UserDatabaseRealm());