Examples of ProvisionException


Examples of com.alu.e3.prov.ProvisionException

    if (LOG.isDebugEnabled())
      LOG.debug("Update API ID: {}", apiId);

    // check API ID same in Pay-load/URL
    if (api == null || api.getId() == null)
      throw new WebApplicationException(new ProvisionException(ApplicationCodeConstants.API_ID_NOT_PROVIDED, "API ID missing in the body for Update operation"));

    if (!api.getId().equals(apiId))
      throw new WebApplicationException(new ProvisionException(ApplicationCodeConstants.API_ID_MISMATCH, "API ID not the same in URL vs Body for Update operation: +" + apiId + "/" + apiId));

    Action action = new Action() {
      protected Object doAction(Object... params) {
        try {
          apiService.update(api);
View Full Code Here

Examples of com.google.inject.ProvisionException

        @Override
        public CommandLine get() {
            try {
                return parser.parse(options, arguments);
            } catch (ParseException e) {
                throw new ProvisionException("Error parsing command line arguments", e);
            }
        }
View Full Code Here

Examples of com.google.inject.ProvisionException

       
        for (Class<? extends PostInjectorAction> action : config.actions()) {
            try {
                binder.bindPostInjectorAction().to(action);
            } catch (Exception e) {
                throw new ProvisionException("Error creating postInjectorAction '" + action.getName() + "'", e);
            }
        }
       
        for (Class<? extends ModuleTransformer> transformer : config.transformers()) {
            try {
                binder.bindModuleTransformer().to(transformer);
            } catch (Exception e) {
                throw new ProvisionException("Error creating postInjectorAction '" + transformer.getName() + "'", e);
            }
        }   
    }
View Full Code Here

Examples of com.google.inject.ProvisionException

                        System.out.println("Adding binding for service : " + service.getClass().getName());
                        ServiceProvider<S> provider = new ServiceProvider<S>(service);
                        binding.addBinding().toProvider(provider).in(Scopes.SINGLETON);
                    }
                } catch (Exception e) {
                    throw new ProvisionException("Failed to load services for '" + type + "'", e);
                }
            }
            else {
                @SuppressWarnings("unchecked")
                TypeLiteral<Set<S>> typeLiteral = (TypeLiteral<Set<S>>) TypeLiteral.get(Types.setOf(type));
View Full Code Here

Examples of com.google.inject.ProvisionException

                for (S obj : loader.call()) {
                    injector.injectMembers(obj);
                    services.add(obj);
                }
            } catch (Exception e) {
                throw new ProvisionException("Failed to laod services", e);
            }
            return services;
        }
View Full Code Here

Examples of com.google.inject.ProvisionException

                                }

                                Object providedOrSentinel = (provided == null) ? NULL : provided;
                                if ( (instance != null) && (instance != providedOrSentinel) )
                                {
                                    throw new ProvisionException("Provider was reentrant while creating a singleton");
                                }

                                instance = providedOrSentinel;
                            }
                        }
View Full Code Here

Examples of com.google.inject.ProvisionException

                protected void configure() {
                    bind(Arguments.class).toInstance(new Arguments(args));
                }
            });
        } catch (Exception e) {
            throw new ProvisionException("Error instantiating main class", e);
        }
    }
View Full Code Here

Examples of com.google.inject.ProvisionException

                protected void configure() {
                    bind(String[].class).annotatedWith(Main.class).toInstance(args);
                }
            });
        } catch (Exception e) {
            throw new ProvisionException("Error instantiating main class", e);
        }
    }
View Full Code Here

Examples of com.google.inject.ProvisionException

                    }
                    injector.injectMembers(instance);
                    return instance;
                }
                catch (Exception e) {
                    throw new ProvisionException("Failed to create module '" + type.getName() + "'", e);
                }
            }
            finally {
                if (instance != null) {
                    registerModule(instance);
View Full Code Here

Examples of com.google.inject.ProvisionException

        // The main class is added last so it can override any bindings from the BootstrapModule's and LifecycleInjectorBuilderSuite's
        if (Module.class.isAssignableFrom(main)) {
            try {
                builder.withAdditionalModuleClasses(main);
            } catch (Exception e) {
                throw new ProvisionException(String.format("Failed to create module for main class '%s'", main.getName()), e);
            }
        }
       
        // Finally, create and return the injector
        return builder.build().createInjector();
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.