Package com.google.inject.spi

Examples of com.google.inject.spi.Message


  public Void visitScopeAnnotation(Class<? extends Annotation> scopeAnnotation) {
    if (scopeAnnotation == Singleton.class || scopeAnnotation == javax.inject.Singleton.class) {
      bindingsCollection.putScope(targetKey, GinScope.SINGLETON);
    } else {
      messages.add(new Message(PrettyPrinter.format("Unsupported scope annotation: key=%s scope=%s",
          targetKey, scopeAnnotation)));
    }
    return null;
  }
View Full Code Here


          properties.put(key, value.replace(("%contextRoot%"),contextRoot));
        }
      }
    } catch (IOException e) {
      throw new CreationException(Arrays.asList(
          new Message("Unable to load properties: " + propertyFile)));
    } finally {
      IOUtils.closeQuietly(is);
    }
    return properties;
  }
View Full Code Here

      nonExisting.getCachingStrategy();
      fail("Fields annotated with @javax.inject.Inject are required!");
    }
    catch (ConfigurationException cx)
    {
      Message message = cx.getErrorMessages().iterator().next();
      assertThat(message.getMessage(), is(equalTo("No implementation for org.apache.wicket.settings.IResourceSettings was bound.")));
    }
  }
View Full Code Here

      nonExisting.getAfterHandler(null);
      fail("Fields annotated with @javax.inject.Inject are required!");
    }
    catch (ConfigurationException cx)
    {
      Message message = cx.getErrorMessages().iterator().next();
      assertThat(message.getMessage(), is(equalTo("No implementation for org.apache.wicket.ajax.attributes.IAjaxCallListener was bound.")));
    }
  }
View Full Code Here

        String property = "myPropertyValue";

        expect(injector.getInstance(Key.get(SecurityManager.class))).andReturn(securityManager);
        expect(injector.getInstance(Key.get(String.class, Names.named("shiro.myProperty")))).andReturn(property);
        expect(injector.getInstance(Key.get(String.class, Names.named("shiro.unavailableProperty"))))
                .andThrow(new ConfigurationException(Collections.singleton(new Message("Not Available!"))));
        expect((Map)injector.getInstance(BeanTypeListener.MAP_KEY)).andReturn(Collections.EMPTY_MAP).anyTimes();

        control.replay();

        BeanTypeListener underTest = new BeanTypeListener();
View Full Code Here

                            value.replace((CONTEXT_ROOT_PLACEHOLDER), getContextRoot()));
                }
            }
        } catch (IOException e) {
            throw new CreationException(Arrays.asList(
                    new Message("Unable to load properties from location: " + overrideProperty
                            + ". " + e.getMessage())
            ));
        }

        return initProperties;
View Full Code Here

    try {
      is = ResourceLoader.openResource(propertyFile);
      properties.load(is);
    } catch (IOException e) {
      throw new CreationException(Arrays.asList(
          new Message("Unable to load properties: " + propertyFile)));
    } finally {
      IOUtils.closeQuietly( is );
    }

    return properties;
View Full Code Here

    initCause(Errors.getOnlyCause(this.messages));
  }

  public ProvisionException(String message, Throwable cause) {
    super(cause);
    this.messages = ImmutableSet.of(new Message(ImmutableList.of(), message, cause));
  }
View Full Code Here

    super(cause);
    this.messages = ImmutableSet.of(new Message(ImmutableList.of(), message, cause));
  }

  public ProvisionException(String message) {
    this.messages = ImmutableSet.of(new Message(message));
  }
View Full Code Here

  private Message merge(Message message) {
    List<Object> sources = Lists.newArrayList();
    sources.addAll(getSources());
    sources.addAll(message.getSources());
    return new Message(sources, message.getMessage(), message.getCause());
  }
View Full Code Here

TOP

Related Classes of com.google.inject.spi.Message

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.