@Retention(value=RUNTIME)
@Target(value=TYPE)
@Documented
public @interface GrpcStubScan
Either basePackageClasses() or basePackages() may be
specified to define specific packages to scan. If specific packages are not
defined, scanning will occur from the package of the class that declares
this annotation.
If this annotation is missing, auto configuration will fallback on
environment property grpc.client.scanPackages. If the property
is missing as well, auto configuration will finally fall back on
the values in @ComponentScan.
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<?>[] |
basePackageClasses
Type-safe alternative to
basePackages() for specifying the packages
to scan for gRPC stubs. |
java.lang.String[] |
basePackages
Base packages to scan for gRPC stubs
|
java.lang.Class<? extends org.springframework.beans.factory.support.BeanNameGenerator> |
nameGenerator
The
BeanNameGenerator class to be used for naming detected gRPC stubs
within the Spring container. |
java.lang.String |
resourcePattern
Controls the class files eligible for gRPC stubs detection.
|
org.springframework.context.annotation.ScopedProxyMode |
scopedProxy
Indicates whether proxies should be generated for detected gRPC stubs, which may be
necessary when using scopes in a proxy-style fashion.
|
java.lang.Class<? extends org.springframework.context.annotation.ScopeMetadataResolver> |
scopeResolver
The
ScopeMetadataResolver to be used for resolving the scope of detected gRPC stubs. |
java.lang.String[] |
value
Alias for
basePackages(). |
@AliasFor(value="basePackages") public abstract java.lang.String[] value
basePackages().
Allows for more concise annotation declarations if no other attributes
are needed — for example, @GrpcStubScan("org.my.pkg")
instead of @GrpcStubScan(basePackages = "org.my.pkg").
@AliasFor(value="value") public abstract java.lang.String[] basePackages
value() is an alias for (and mutually exclusive with) this
attribute.
Use basePackageClasses() for a type-safe alternative to
String-based package names.
public abstract java.lang.Class<?>[] basePackageClasses
basePackages() for specifying the packages
to scan for gRPC stubs. The package of each class specified will be scanned.
Consider using this type-safe alternative with the generated stubs'
enclosing class. For example
@GrpcStubScan(basePackageClasses = "org.my.pkg.grpc.MyServiceGrpc.class")
public abstract java.lang.Class<? extends org.springframework.beans.factory.support.BeanNameGenerator> nameGenerator
BeanNameGenerator class to be used for naming detected gRPC stubs
within the Spring container.
The default value of the BeanNameGenerator interface itself indicates
that the scanner used to process this @GrpcStubScan annotation should
use its inherited bean name generator, e.g. the default
AnnotationBeanNameGenerator or any custom instance supplied to the
application context at bootstrap time.
AnnotationConfigApplicationContext.setBeanNameGenerator(BeanNameGenerator)public abstract java.lang.Class<? extends org.springframework.context.annotation.ScopeMetadataResolver> scopeResolver
ScopeMetadataResolver to be used for resolving the scope of detected gRPC stubs.public abstract org.springframework.context.annotation.ScopedProxyMode scopedProxy
The default is defer to the default behavior of the gRPC stub scanner used to execute the actual scan.
Note that setting this attribute overrides any value set for scopeResolver().
GrpcStubScanner.setScopedProxyMode(ScopedProxyMode)