Java 类org.apache.catalina.realm.DataSourceRealm 实例源码

项目:tomcat7    文件:MBeanFactory.java   
/**
 * Create a new DataSource Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, 
    String roleNameCol, String userCredCol, String userNameCol, 
    String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
项目:lams    文件:MBeanFactory.java   
/**
 * Create a new DataSource Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, 
    String roleNameCol, String userCredCol, String userNameCol, 
    String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
项目:apache-tomcat-7.0.73-with-comment    文件:MBeanFactory.java   
/**
 * Create a new DataSource Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, 
    String roleNameCol, String userCredCol, String userNameCol, 
    String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
项目:lazycat    文件:MBeanFactory.java   
/**
 * Create a new DataSource Realm.
 *
 * @param parent
 *            MBean Name of the associated parent component
 *
 * @exception Exception
 *                if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, String roleNameCol, String userCredCol,
        String userNameCol, String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }

}
项目:class-guard    文件:MBeanFactory.java   
/**
 * Create a new DataSource Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, 
    String roleNameCol, String userCredCol, String userNameCol, 
    String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
项目:apache-tomcat-7.0.57    文件:MBeanFactory.java   
/**
 * Create a new DataSource Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, 
    String roleNameCol, String userCredCol, String userNameCol, 
    String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
项目:apache-tomcat-7.0.57    文件:MBeanFactory.java   
/**
 * Create a new DataSource Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, 
    String roleNameCol, String userCredCol, String userNameCol, 
    String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
项目:WBSAirback    文件:MBeanFactory.java   
/**
 * Create a new DataSource Realm.
 *
 * @param parent MBean Name of the associated parent component
 *
 * @exception Exception if an MBean cannot be created or registered
 */
public String createDataSourceRealm(String parent, String dataSourceName, 
    String roleNameCol, String userCredCol, String userNameCol, 
    String userRoleTable, String userTable) throws Exception {

    // Create a new DataSourceRealm instance
    DataSourceRealm realm = new DataSourceRealm();
    realm.setDataSourceName(dataSourceName);
    realm.setRoleNameCol(roleNameCol);
    realm.setUserCredCol(userCredCol);
    realm.setUserNameCol(userNameCol);
    realm.setUserRoleTable(userRoleTable);
    realm.setUserTable(userTable);

    // Add the new instance to its parent component
    ObjectName pname = new ObjectName(parent);
    ContainerBase containerBase = getParentContainerFromParent(pname);
    // Add the new instance to its parent component
    containerBase.setRealm(realm);
    // Return the corresponding MBean name
    ObjectName oname = realm.getObjectName();
    if (oname != null) {
        return (oname.toString());
    } else {
        return null;
    }   

}
项目:tomee    文件:OpenEJBContextConfig.java   
private URL replaceKnownRealmsByTomEEOnes(final URL contextXml) throws MalformedURLException {
    return new URL(contextXml.getProtocol(), contextXml.getHost(), contextXml.getPort(), contextXml.getFile(), new URLStreamHandler() {
        @Override
        protected URLConnection openConnection(final URL u) throws IOException {
            final URLConnection c = contextXml.openConnection();
            return new URLConnection(u) {
                @Override
                public void connect() throws IOException {
                    c.connect();
                }

                @Override
                public InputStream getInputStream() throws IOException {
                    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                    IO.copy(c.getInputStream(), baos);
                    return new ByteArrayInputStream(new String(baos.toByteArray())
                                    .replace(DataSourceRealm.class.getName(), TomEEDataSourceRealm.class.getName()
                                ).getBytes());
                }

                @Override
                public String toString() {
                    return c.toString();
                }
            };
        }
    });
}