Package com.google.inject

Examples of com.google.inject.ProvisionException


  @Override
  public GerritConfig get() {
    try {
      return create();
    } catch (MalformedURLException e) {
      throw new ProvisionException("Cannot create GerritConfig instance", e);
    }
  }
View Full Code Here


            if (!b) field.setAccessible(true);
            field.set(injectee,
                LoggerFactory.getLogger(type.getRawType()));
            if (!b) field.setAccessible(false);
          } catch (IllegalAccessException e) {
            throw new ProvisionException(
                "Unable to inject SLF4J logger", e);
          }
        }
      });
    }
View Full Code Here

  public void throwProvisionExceptionIfErrorsExist() {
    if (!hasErrors()) {
      return;
    }

    throw new ProvisionException(getMessages());
  }
View Full Code Here

          dbi.registerMapper(resultSetMapper);
        }

        return dbi;
      } catch (ClassNotFoundException e) {
        throw new ProvisionException("while instantiating DBI", e);
      }
    }
View Full Code Here

                //Feed the empty properties to get the code work
                JndiBindings.bindInjectorAndBindings(context, injector, new Properties());
            }
            return context;
        } catch (Exception e) {
            throw new ProvisionException("Failed to create JNDI bindings. Reason: " + e, e);
        }
    }
View Full Code Here

        if (routeBuilders != null) {
            for (RoutesBuilder builder : routeBuilders) {
                try {
                    camelContext.addRoutes(builder);
                } catch (Exception e) {
                    throw new ProvisionException("Failed to add the router. Reason: " + e, e);
                }
            }
        }
        updateRegistry(camelContext);       
        return camelContext;
View Full Code Here

        }
        T t;
        try {
            t = constructor.newInstance(params);
        } catch (Exception e) {
            throw new ProvisionException("Could not instantiate " + key + "", e);
        }
        injector.injectMembers(t);
        return postProcess(t);
    }
View Full Code Here

        {
            return bindProperties( propertiesResource.toURL() );
        }
        catch ( MalformedURLException e )
        {
            throw new ProvisionException( format( "URI '%s' not supported: %s", propertiesResource, e.getMessage() ) );
        }
    }
View Full Code Here

        public void afterInjection(I injectee) {
            try {
                field.setAccessible(true);
                field.set(injectee, logger);
            } catch (IllegalAccessException e) {
                throw new ProvisionException(e.getMessage(), e);
            }
        }
View Full Code Here

  public void throwProvisionExceptionIfErrorsExist() {
    if (!hasErrors()) {
      return;
    }

    throw new ProvisionException(getMessages());
  }
View Full Code Here

TOP

Related Classes of com.google.inject.ProvisionException

Copyright © 2018 www.massapicom. 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.