private String extractServiceScope(Method method) { Scope scope = method.getAnnotation(Scope.class); return scope != null ? scope.value() : ScopeConstants.DEFAULT; }
private String extractServiceScope(Method method) { Scope scope = method.getAnnotation(Scope.class); return scope != null ? scope.value() : ScopeConstants.DEFAULT; }
@Override public <T> ServiceBindingOptions bind(Class<T> serviceInterface, Class<? extends T> serviceImplementation) { assert serviceInterface != null; assert serviceImplementation != null; lock.check(); flush(); this.serviceInterface = serviceInterface; this.serviceImplementation = serviceImplementation; // Set defaults for the other properties. eagerLoad = serviceImplementation.getAnnotation(EagerLoad.class) != null; serviceId = InternalUtils.getServiceId(serviceImplementation); if (serviceId == null) { serviceId = serviceInterface.getSimpleName(); } Scope scope = serviceImplementation.getAnnotation(Scope.class); this.scope = scope != null ? scope.value() : ScopeConstants.DEFAULT; Marker marker = serviceImplementation.getAnnotation(Marker.class); if (marker != null) { InternalUtils.validateMarkerAnnotations(marker.value()); markers.addAll(Arrays.asList(marker.value())); } preventDecoration |= serviceImplementation.getAnnotation(PreventServiceDecoration.class) != null; return this; }
@Override public <T> ServiceBindingOptions bind(Class<T> serviceInterface, Class<? extends T> serviceImplementation) { assert serviceInterface != null; assert serviceImplementation != null; lock.check(); flush(); this.serviceInterface = serviceInterface; this.serviceImplementation = serviceImplementation; // Set defaults for the other properties. eagerLoad = serviceImplementation.getAnnotation(EagerLoad.class) != null; serviceId = InternalUtils.getServiceId(serviceImplementation); if (serviceId == null) { serviceId = serviceInterface.getSimpleName(); } Scope scope = serviceImplementation.getAnnotation(Scope.class); this.scope = scope != null ? scope.value() : ScopeConstants.DEFAULT; Marker marker = serviceImplementation.getAnnotation(Marker.class); if (marker != null) { InternalUtils.validateMarkerAnnotations(marker.value()); markers.addAll(Arrays.asList(marker.value())); } preventDecoration |= serviceImplementation.getAnnotation(PreventServiceDecoration.class) != null; return this; }