Package com.google.inject

Examples of com.google.inject.ProvisionException


        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


                             {
                                 initialisable.initialise();
                             }
                             catch (Exception e)
                             {
                                 throw new ProvisionException("Failed to invoke initialise(): " + e, e);
                             }
                         }
                     }
                 });
View Full Code Here

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

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

        }
      });
      errors.throwIfNewErrors(0);
      return t;
    } catch (ErrorsException e) {
      throw new ProvisionException(errors.merge(e.getErrors()).getMessages());
    }
  }
View Full Code Here

            }
          });
          errors.throwIfNewErrors(0);
          return t;
        } catch (ErrorsException e) {
          throw new ProvisionException(errors.merge(e.getErrors()).getMessages());
        }
      }

      @Override public String toString() {
        return factory.toString();
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

    RuntimeInstance ri = new RuntimeInstance();
    try {
      ri.init(p);
    } catch (Exception err) {
      throw new ProvisionException("Cannot configure Velocity templates", err);
    }
    return ri;
  }
View Full Code Here

  @Override
  public Database<ReviewDb> get() {
    try {
      return new Database<ReviewDb>(datasource, ReviewDb.class);
    } catch (OrmException e) {
      throw new ProvisionException("Cannot create ReviewDb", e);
    }
  }
View Full Code Here

        if (password != null) {
          p.setProperty("password", password);
        }
        return new SimpleDataSource(p);
      } catch (SQLException se) {
        throw new ProvisionException("Database unavailable", se);
      }
    }
  }
View Full Code Here

public class Schema_52 extends SchemaVersion {
  @Inject
  Schema_52() {
    super(new Provider<SchemaVersion>() {
      public SchemaVersion get() {
        throw new ProvisionException("Cannot upgrade from 51");
      }
    });
  }
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.