| // |
| // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.5-b01-fcs |
| // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> |
| // Any modifications to this file will be lost upon recompilation of the source schema. |
| // Generated on: 2008.07.15 at 04:13:34 PM PDT |
| // |
| |
| |
| package org.apache.geronimo.components.jaspi.model; |
| |
| import java.io.Serializable; |
| import java.security.PrivilegedExceptionAction; |
| import java.security.PrivilegedActionException; |
| import java.lang.reflect.InvocationTargetException; |
| import java.lang.reflect.Constructor; |
| |
| import javax.xml.bind.annotation.XmlAccessType; |
| import javax.xml.bind.annotation.XmlAccessorType; |
| import javax.xml.bind.annotation.XmlElement; |
| import javax.xml.bind.annotation.XmlType; |
| import javax.security.auth.message.MessagePolicy; |
| import javax.security.auth.message.AuthException; |
| |
| |
| /** |
| * <p>Java class for protectionPolicyType complex type. |
| * |
| * <p>The following schema fragment specifies the expected content contained within this class. |
| * |
| * <pre> |
| * <complexType name="protectionPolicyType"> |
| * <complexContent> |
| * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> |
| * <sequence> |
| * <element name="className" type="{http://www.w3.org/2001/XMLSchema}string"/> |
| * </sequence> |
| * </restriction> |
| * </complexContent> |
| * </complexType> |
| * </pre> |
| * |
| * |
| */ |
| @XmlAccessorType(XmlAccessType.FIELD) |
| @XmlType(name = "protectionPolicyType", propOrder = { |
| "className" |
| }) |
| public class ProtectionPolicyType |
| implements Serializable |
| { |
| |
| private final static long serialVersionUID = 12343L; |
| @XmlElement(required = true) |
| protected String className; |
| |
| /** |
| * Gets the value of the className property. |
| * |
| * @return |
| * possible object is |
| * {@link String } |
| * |
| */ |
| public String getClassName() { |
| return className; |
| } |
| |
| /** |
| * Sets the value of the className property. |
| * |
| * @param value |
| * allowed object is |
| * {@link String } |
| * |
| */ |
| public void setClassName(String value) { |
| this.className = value; |
| } |
| |
| public MessagePolicy.ProtectionPolicy newProtectionPolicy(final ClassLoader classLoader) throws AuthException { |
| try { |
| return java.security.AccessController |
| .doPrivileged(new PrivilegedExceptionAction<MessagePolicy.ProtectionPolicy>() { |
| public MessagePolicy.ProtectionPolicy run() throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { |
| Class<? extends MessagePolicy.ProtectionPolicy> cl = (Class<? extends MessagePolicy.ProtectionPolicy>) Class.forName(className, true, classLoader); |
| Constructor<? extends MessagePolicy.ProtectionPolicy> cnst = cl.getConstructor(); |
| MessagePolicy.ProtectionPolicy target = cnst.newInstance(); |
| return target; |
| } |
| }); |
| } catch (PrivilegedActionException e) { |
| Exception inner = e.getException(); |
| if (inner instanceof InstantiationException) { |
| throw (AuthException) new AuthException("AuthConfigFactory error:" |
| + inner.getCause().getMessage()).initCause(inner.getCause()); |
| } else { |
| throw (AuthException) new AuthException("AuthConfigFactory error: " + inner).initCause(inner); |
| } |
| } catch (Exception e) { |
| throw (AuthException) new AuthException("AuthConfigFactory error: " + e).initCause(e); |
| } |
| } |
| } |