Java 8 ServiceConfigurationError - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ServiceConfigurationError class.

This code example shows how to use the following methods:
     * @tests serialization/deserialization. 
     */ 
    @SuppressWarnings("nls") 
    public void testSerializationSelf() throws Exception { 
        SerializationTest.verifySelf(new ServiceConfigurationError("fixture"));
        SerializationTest.verifySelf(new ServiceConfigurationError("fixture",
                new IllegalArgumentException("info in the IAE")));
    } 
 
    /** 
     * @throws Exception 
     * @tests serialization/deserialization compatibility with RI. 
     */ 
    @SuppressWarnings("nls") 
    public void testSerializationCompatibility() throws Exception { 
        ServiceConfigurationError e = new ServiceConfigurationError("fixture",
                new IllegalArgumentException("info in the IAE"));
        SerializationTest.verifyGolden(this, e);
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
    this.clazz = clazz;
    try { 
      final String fullName = META_INF_SERVICES + clazz.getName();
      this.profilesEnum = (loader == null) ? ClassLoader.getSystemResources(fullName) : loader.getResources(fullName);
    } catch (IOException ioe) {
      throw new ServiceConfigurationError("Error loading SPI profiles for type " + clazz.getName() + " from classpath", ioe);
    } 
    this.loader = (loader == null) ? ClassLoader.getSystemClassLoader() : loader;
    this.linesIterator = Collections.<String>emptySet().iterator();
  } 
   
  private boolean loadNextProfile() { 
    ArrayList<String> lines = null;
    while (profilesEnum.hasMoreElements()) {
      if (lines != null) {
        lines.clear();
      } else { 
        lines = new ArrayList<>();
      } 
      final URL url = profilesEnum.nextElement();
5
CodeRank
This code example shows how to use the following methods:getMessage
                } 
            } 
        } 
        catch (ServiceConfigurationError e)
        { 
            LOG.error("Configuration Error will searching for service:" + e.getMessage(), e);
            throw new FailJobException("exception occured while trying to find a service for " 
                                       + serviceType, e);
        } 
 
        if (service == null)
        { 
            LOG.error("no service can be found for " + serviceType);
            logMissingService(service);
 
            throw new FailJobException("no service can be found for " + serviceType);
        } 
        return service;
    } 
 
5
CodeRank
This code example shows how to use the following methods:
    this.clazz = clazz;
    try { 
      final String fullName = META_INF_SERVICES + clazz.getName();
      this.profilesEnum = (loader == null) ? ClassLoader.getSystemResources(fullName) : loader.getResources(fullName);
    } catch (IOException ioe) {
      throw new ServiceConfigurationError("Error loading SPI profiles for type " + clazz.getName() + " from classpath", ioe);
    } 
    this.loader = (loader == null) ? ClassLoader.getSystemClassLoader() : loader;
    this.linesIterator = Collections.<String>emptySet().iterator();
  } 
   
  private boolean loadNextProfile() { 
    ArrayList<String> lines = null;
    while (profilesEnum.hasMoreElements()) {
      if (lines != null) {
        lines.clear();
      } else { 
        lines = new ArrayList<String>();
      } 
      final URL url = profilesEnum.nextElement();
4
CodeRank
This code example shows how to use the following methods:
         * providers. In this case, we simply return an iterator that 
         * does not return anything (no providers installed). 
         */ 
        log(Level.WARNING, "cannot access {0}", resourceName, ioex);
        if (error)
          throw new ServiceConfigurationError("Failed to access + " +
                                              resourceName, ioex);
        else 
          { 
            List<P> empty = Collections.emptyList();
            return empty.iterator();
          } 
      } 
 
    return new ServiceIterator<P>(spi, urls, loader, error,
                                  AccessController.getContext());
  } 
 
 
  /** 
3
CodeRank
This code example shows how to use the following methods:
         * providers. In this case, we simply return an iterator that 
         * does not return anything (no providers installed). 
         */ 
        log(Level.WARNING, "cannot access {0}", resourceName, ioex);
	if (error)
	  throw new ServiceConfigurationError("Failed to access + " +
					      resourceName, ioex);
	else 
	  { 
	    List<P> empty = Collections.emptyList();
	    return empty.iterator();
	  } 
      } 
 
    return new ServiceIterator<P>(spi, urls, loader, error,
				  AccessController.getContext());
  } 
 
 
  /** 
3
CodeRank
This code example shows how to use the following methods:
    this.clazz = clazz;
    this.loader = loader;
    try { 
      this.profilesEnum = loader.getResources(META_INF_SERVICES + clazz.getName());
    } catch (IOException ioe) {
      throw new ServiceConfigurationError("Error loading SPI profiles for type " + clazz.getName() + " from classpath", ioe);
    } 
    this.linesIterator = Collections.<String>emptySet().iterator();
  } 
   
  private boolean loadNextProfile() { 
    ArrayList<String> lines = null;
    while (profilesEnum.hasMoreElements()) {
      if (lines != null) {
        lines.clear();
      } else { 
        lines = new ArrayList<String>();
      } 
      final URL url = profilesEnum.nextElement();
      try { 
4
CodeRank

Related Java 8 ServiceConfigurationError Questions & Answers:

See Code Examples for Java 8 ServiceConfigurationError Methods: