@Override public boolean equals(Object o) { if (!(o instanceof Named)) { return false; } Named other = (Named) o; return value.equals(other.value()); }
private static String findName(final AnnotatedElement elem) { Named named = elem.getAnnotation(Named.class); if (named == null) { com.google.inject.name.Named gnamed = elem .getAnnotation(com.google.inject.name.Named.class); if (gnamed == null) { Header header = elem.getAnnotation(Header.class); if (header == null) { return null; } return Strings.emptyToNull(header.value()); } return gnamed.value(); } return Strings.emptyToNull(named.value()); }
@Inject public void inject(Injector injector) { final List<Binding<Emitter>> emitterBindings = injector.findBindingsByType(new TypeLiteral<Emitter>(){}); emitter = findEmitter(emitterType, emitterBindings); if (emitter == null) { emitter = findEmitter(NoopEmitterModule.EMITTER_TYPE, emitterBindings); } if (emitter == null) { List<String> knownTypes = new ArrayList<>(); for (Binding<Emitter> binding : emitterBindings) { final Annotation annotation = binding.getKey().getAnnotation(); if (annotation != null) { knownTypes.add(((Named) annotation).value()); } } throw new ISE("Unknown emitter type[%s]=[%s], known types[%s]", EMITTER_PROPERTY, emitterType, knownTypes); } }
Key key = ((Binding) e).getKey(); if (Named.class.isAssignableFrom(key.getAnnotation().annotationType()) && "configureInterceptors".equals(((Named) key.getAnnotation()).value()) && key.getTypeLiteral().getRawType().equals(Object.class)) { calledCustom = true; && "configureDefaultInterceptors".equals(((Named) key.getAnnotation()).value()) && key.getTypeLiteral().getRawType().equals(Object.class)) { calledDefault = true;
@Override public boolean equals(Object o) { if (!(o instanceof Named)) { return false; } Named other = (Named) o; return value.equals(other.value()); }
public static String getName(Annotation annotation) { if (annotation instanceof Named) { return ((Named) annotation).value(); } else if (annotation instanceof javax.inject.Named) { return ((javax.inject.Named) annotation).value(); } return ""; } }
public boolean equals(Object o) { if (!(o instanceof Named)) { return false; } Named other = (Named) o; return value.equals(other.value()); }
@Override public boolean equals(Object o) { if (!(o instanceof Named)) { return false; } Named other = (Named) o; return value.equals(other.value()); }
public static String getName(Annotation annotation){ if(annotation instanceof Named){ return ((Named)annotation).value(); }else if(annotation instanceof javax.inject.Named){ return ((javax.inject.Named)annotation).value(); } return ""; } }
/** * Turns a {@link Guice} {@link com.google.inject.name.Named} into a * JSR-330's {@link javax.inject.Named} instance. */ public static javax.inject.Named toThreeThirtyNamed(com.google.inject.name.Named qualifier) { return new NamedImpl(qualifier.value()); }
@Override public String apply(Binding<String> input) { Annotation annotation = input.getKey().getAnnotation(); return (annotation instanceof javax.inject.Named) ? javax.inject.Named.class.cast(annotation) .value() : com.google.inject.name.Named.class.cast(annotation).value(); }
@Override public String apply(Binding<String> input) { Annotation annotation = input.getKey().getAnnotation(); return (annotation instanceof javax.inject.Named) ? javax.inject.Named.class.cast(annotation) .value() : com.google.inject.name.Named.class.cast(annotation).value(); }
@Override public String apply(Binding<String> input) { Annotation annotation = input.getKey().getAnnotation(); return (annotation instanceof javax.inject.Named) ? javax.inject.Named.class.cast(annotation) .value() : com.google.inject.name.Named.class.cast(annotation).value(); }
@Override public String apply(Binding<String> input) { Annotation annotation = input.getKey().getAnnotation(); return (annotation instanceof javax.inject.Named) ? javax.inject.Named.class.cast(annotation) .value() : com.google.inject.name.Named.class.cast(annotation).value(); }
@PreDestroy public void shutdown() throws InterruptedException { if (server != null) { logger.info("Starting WebSockets server {} on port {}...", nameAnnotation.value(), server.getServerPort()); server.shutdown(); } }
@PreDestroy public void shutdown() throws InterruptedException { if (server != null) { logger.info("Starting WebSockets server {} on port {}...", nameAnnotation.value(), server.getServerPort()); server.shutdown(); } }
@Override protected void configure() { configureServer(); bind(serverConfigKey).toInstance(serverConfigBuilder.build()); MapBinder.newMapBinder(binder(), String.class, RxServer.class).addBinding(nameAnnotation.value()).toProvider( new TcpRxServerProvider<I, O, RxServer<I, O>>(nameAnnotation.value(), iType, oType) ).asEagerSingleton(); }
@Override protected void configure() { configureServer(); bind(serverConfigKey).toInstance(serverConfigBuilder.build()); MapBinder.newMapBinder(binder(), String.class, RxServer.class).addBinding(nameAnnotation.value()).toProvider( new TcpRxServerProvider<I, O, RxServer<I, O>>(nameAnnotation.value(), iType, oType) ).asEagerSingleton(); }
@Override protected void configure() { configureServer(); bind(serverConfigKey).toInstance(serverConfigBuilder.build()); MapBinder.newMapBinder(binder(), String.class, RxServer.class).addBinding(nameAnnotation.value()).toProvider( new WebSocketsRxServerProvider<I, O, RxServer<I, O>>(nameAnnotation.value(), iType, oType) ).asEagerSingleton(); }
@Override protected void configure() { configureServer(); bind(serverConfigKey).toInstance(serverConfigBuilder.build()); bind(interceptorSupportKey).toInstance(interceptorSupportInstance); MapBinder.newMapBinder(binder(), String.class, RxServer.class).addBinding(nameAnnotation.value()).toProvider( new HttpRxServerProvider<I, O, HttpServer<I, O>>(nameAnnotation.value(), iType, oType) ).asEagerSingleton(); }