public String toString() { return "principal-name " + principalName + "; className " + getClassName(); } }
public String toString() { return "principal-name " + principalName + "; className " + getClassName(); } }
public Principal getPrincipal() { try { if (cLoader == null) { cLoader = Thread.currentThread().getContextClassLoader(); } Class clazz = Class.forName(getClassName(), true, cLoader); Constructor constructor = clazz.getConstructor(new Class[]{String.class}); Object o = constructor.newInstance(new Object[]{principalName}); return (Principal) o; } catch(Exception ex) { RuntimeException e = new RuntimeException(); e.initCause(ex); throw e; } }
public Principal getPrincipal() { try { if (cLoader == null) { cLoader = Thread.currentThread().getContextClassLoader(); } Class clazz = Class.forName(getClassName(), true, cLoader); Constructor constructor = clazz.getConstructor(new Class[]{String.class}); Object o = constructor.newInstance(new Object[]{principalName}); return (Principal) o; } catch(Exception ex) { RuntimeException e = new RuntimeException(); e.initCause(ex); throw e; } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name for * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor( Node parent, String nodeName, PrincipalNameDescriptor descriptor) { //principal-name Element principal = (Element) appendTextChild( parent, RuntimeTagNames.PRINCIPAL_NAME, descriptor.getName()); // class-name setAttribute(principal, RuntimeTagNames.CLASS_NAME, descriptor.getClassName()); return principal; } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node for the DOM tree * @param node name for * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor( Node parent, String nodeName, PrincipalNameDescriptor descriptor) { //principal-name Element principal = (Element) appendTextChild( parent, RuntimeTagNames.PRINCIPAL_NAME, descriptor.getName()); // class-name setAttribute(principal, RuntimeTagNames.CLASS_NAME, descriptor.getClassName()); return principal; } }