Package org.hibernate.validator.util

Examples of org.hibernate.validator.util.GetClassLoader.run()


  }

  private Schema getMappingSchema() {
    boolean isSecured = System.getSecurityManager() != null;
    GetClassLoader action = GetClassLoader.fromClass( XmlMappingParser.class );
    ClassLoader loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
    URL schemaUrl = loader.getResource( VALIDATION_MAPPING_XSD );
    SchemaFactory sf = SchemaFactory.newInstance( javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI );
    Schema schema = null;
    try {
      schema = sf.newSchema( schemaUrl );
View Full Code Here


    boolean isSecured = System.getSecurityManager() != null;
    boolean isContextCL = true;
    // try the context class loader first
    GetClassLoader action = GetClassLoader.fromContext();
    ClassLoader loader = isSecured ? AccessController.doPrivileged( action ) : action.run();

    if ( loader == null ) {
      log.debug( "No default context class loader, fall back to Bean Validation's loader" );
      action = GetClassLoader.fromClass( ValidationXmlParser.class );
      loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
View Full Code Here

    ClassLoader loader = isSecured ? AccessController.doPrivileged( action ) : action.run();

    if ( loader == null ) {
      log.debug( "No default context class loader, fall back to Bean Validation's loader" );
      action = GetClassLoader.fromClass( ValidationXmlParser.class );
      loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
      isContextCL = false;
    }
    InputStream inputStream = loader.getResourceAsStream( path );

    // try the current class loader
View Full Code Here

    InputStream inputStream = loader.getResourceAsStream( path );

    // try the current class loader
    if ( isContextCL && inputStream == null ) {
      action = GetClassLoader.fromClass( ValidationXmlParser.class );
      loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
      inputStream = loader.getResourceAsStream( path );
    }
    return inputStream;
  }
View Full Code Here

  }

  private Schema getValidationConfigurationSchema() {
    boolean isSecured = System.getSecurityManager() != null;
    GetClassLoader action = GetClassLoader.fromClass( ValidationXmlParser.class );
    ClassLoader loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
    URL schemaUrl = loader.getResource( VALIDATION_CONFIGURATION_XSD );
    SchemaFactory sf = SchemaFactory.newInstance( javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI );
    Schema schema = null;
    try {
      schema = sf.newSchema( schemaUrl );
View Full Code Here

   */
  private ResourceBundle getFileBasedResourceBundle(Locale locale) {
    ResourceBundle rb = null;
    boolean isSecured = System.getSecurityManager() != null;
    GetClassLoader action = GetClassLoader.fromContext();
    ClassLoader classLoader = isSecured ? AccessController.doPrivileged( action ) : action.run();

    if ( classLoader != null ) {
      rb = loadBundle( classLoader, locale, USER_VALIDATION_MESSAGES + " not found by thread local classloader" );
    }
    if ( rb == null ) {
View Full Code Here

  @SuppressWarnings("unchecked")
  public static <T extends Annotation> T create(AnnotationDescriptor<T> descriptor) {
    boolean isSecured = System.getSecurityManager() != null;
    GetClassLoader action = GetClassLoader.fromContext();
    ClassLoader classLoader = isSecured ? AccessController.doPrivileged( action ) : action.run();
        //TODO round 34ms to generate the proxy, hug! is Javassist Faster?
        Class<T> proxyClass = (Class<T>) Proxy.getProxyClass( classLoader, descriptor.type() );
    InvocationHandler handler = new AnnotationProxy( descriptor );
    try {
      return getProxyInstance( proxyClass, handler );
View Full Code Here

    if ( classLoader != null ) {
      rb = loadBundle( classLoader, locale, USER_VALIDATION_MESSAGES + " not found by thread local classloader" );
    }
    if ( rb == null ) {
      action = GetClassLoader.fromClass( ResourceBundleMessageInterpolator.class );
      classLoader = isSecured ? AccessController.doPrivileged( action ) : action.run();
      rb = loadBundle(
          classLoader,
          locale,
          USER_VALIDATION_MESSAGES + " not found by validator classloader"
      );
View Full Code Here

  @SuppressWarnings("unchecked")
  public static <T extends Annotation> T create(AnnotationDescriptor<T> descriptor) {
    boolean isSecured = System.getSecurityManager() != null;
    GetClassLoader action = GetClassLoader.fromContext();
    ClassLoader classLoader = isSecured ? AccessController.doPrivileged( action ) : action.run();
        //TODO round 34ms to generate the proxy, hug! is Javassist Faster?
        Class<T> proxyClass = (Class<T>) Proxy.getProxyClass( classLoader, descriptor.type() );
    InvocationHandler handler = new AnnotationProxy( descriptor );
    try {
      return getProxyInstance( proxyClass, handler );
View Full Code Here

  }

  private Schema getMappingSchema() {
    boolean isSecured = System.getSecurityManager() != null;
    GetClassLoader action = GetClassLoader.fromClass( XmlMappingParser.class );
    ClassLoader loader = isSecured ? AccessController.doPrivileged( action ) : action.run();
    URL schemaUrl = loader.getResource( VALIDATION_MAPPING_XSD );
    SchemaFactory sf = SchemaFactory.newInstance( javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI );
    Schema schema = null;
    try {
      schema = sf.newSchema( schemaUrl );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.