-
Notifications
You must be signed in to change notification settings - Fork 30
io microsphere spring cloud openfeign components DecoratedFeignComponent
Type: Class | Module: microsphere-spring-cloud-openfeign | Package: io.microsphere.spring.cloud.openfeign.components | Since: 0.0.1
DecoratedFeignComponent is a class in the io.microsphere.spring.cloud.openfeign.components package of the microsphere-spring-cloud-openfeign module.
public abstract class DecoratedFeignComponent<T> implements RefreshableAuthor: 韩超
-
Introduced in:
0.0.1 -
Current Project Version:
0.2.18-SNAPSHOT
This component is tested and compatible with the following Java versions:
| Java Version | Status |
|---|---|
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |
// Typically invoked via a subclass constructor
super(contextId, contextFactory, clientProperties, delegate);T component = decoratedFeignComponent.delegate();Decoder decoder = decoratedFeignComponent.loadInstanceFromContextFactory("my-client", Decoder.class);String id = decoratedFeignComponent.contextId();decoratedFeignComponent.refresh();Class<? extends T> type = decoratedFeignComponent.componentType();FeignClientConfiguration defaultConfig = decoratedFeignComponent.getDefaultConfiguration();FeignClientConfiguration currentConfig = decoratedFeignComponent.getCurrentConfiguration();Add the following dependency to your pom.xml:
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-cloud-openfeign</artifactId>
<version>${microsphere-spring-cloud.version}</version>
</dependency>Tip: Use the BOM (
microsphere-spring-cloud-dependencies) for consistent version management. See the Getting Started guide.
import io.microsphere.spring.cloud.openfeign.components.DecoratedFeignComponent;| Method | Description |
|---|---|
delegate |
Constructs a DecoratedFeignComponent wrapping the given delegate. |
loadInstanceFromContextFactory |
Loads a component instance of the given type from the NamedContextFactory, |
contextId |
Returns the Feign client context ID associated with this decorated component. |
refresh |
Refreshes this component by clearing the delegate, causing the next call to |
getDefaultConfiguration |
Returns the Feign component type class used to resolve the delegate implementation. |
getCurrentConfiguration |
Returns the FeignClientConfiguration for the current Feign client context ID. |
public T delegate()Constructs a DecoratedFeignComponent wrapping the given delegate.
Example Usage:
`// Typically invoked via a subclass constructor super(contextId, contextFactory, clientProperties, delegate); `
public <T> T loadInstanceFromContextFactory(String contextId, Class<T> componentType)Loads a component instance of the given type from the NamedContextFactory,
falling back to direct instantiation if the bean is not available.
Example Usage:
`Decoder decoder = decoratedFeignComponent.loadInstanceFromContextFactory("my-client", Decoder.class);
`
public String contextId()Returns the Feign client context ID associated with this decorated component.
Example Usage:
`String id = decoratedFeignComponent.contextId(); `
public void refresh()Refreshes this component by clearing the delegate, causing the next call to
#delegate() to reload the instance from the context factory.
Example Usage:
`decoratedFeignComponent.refresh(); `
public FeignClientConfiguration getDefaultConfiguration()Returns the Feign component type class used to resolve the delegate implementation. Subclasses must implement this to return the appropriate configuration class.
Example Usage:
`Class type = decoratedFeignComponent.componentType(); `
public FeignClientConfiguration getCurrentConfiguration()Returns the FeignClientConfiguration for the current Feign client context ID.
Example Usage:
`FeignClientConfiguration currentConfig = decoratedFeignComponent.getCurrentConfiguration(); `
This documentation was auto-generated from the source code of microsphere-spring-cloud.
spring-cloud-commons
- AbstractServiceRegistrationEndpoint
- CommonsPropertyConstants
- ConditionalOnAutoServiceRegistrationAvailable
- ConditionalOnAutoServiceRegistrationEnabled
- ConditionalOnBlockingDiscoveryAvailable
- ConditionalOnFeaturesAvailable
- ConditionalOnFeaturesEnabled
- ConditionalOnLoadBalancerEnabled
- ConditionalOnMultipleRegistrationEnabled
- ConditionalOnReactiveDiscoveryAvailable
- ConditionalOnUtilEnabled
- ConfigurationPropertyHasFeaturesAutoConfiguration
- DefaultRegistration
- DiscoveryClientAutoConfiguration
- DiscoveryClientConstants
- DiscoveryUtils
- EventPublishingRegistrationAspect
- FaultTolerancePropertyConstants
- InMemoryServiceRegistry
- InstanceConstants
- LoadBalancerUtils
- MultipleAutoServiceRegistration
- MultipleRegistration
- MultipleServiceRegistry
- ReactiveDiscoveryClientAdapter
- ReactiveDiscoveryClientAutoConfiguration
- RegistrationCustomizer
- RegistrationDeregisteredEvent
- RegistrationEvent
- RegistrationMetaData
- RegistrationPreDeregisteredEvent
- RegistrationPreRegisteredEvent
- RegistrationRegisteredEvent
- ServiceDeregistrationEndpoint
- ServiceInstanceUtils
- ServiceInstancesChangedEvent
- ServiceRegistrationEndpoint
- ServiceRegistrationEndpointAutoConfiguration
- ServiceRegistryAutoConfiguration
- SimpleAutoServiceRegistration
- SimpleAutoServiceRegistrationAutoConfiguration
- SimpleServiceRegistry
- SpecificationAutoConfiguration
- SpecificationBeanPostProcessor
- SpecificationCustomizer
- SpringCloudPropertyConstants
- TomcatDynamicConfigurationListener
- TomcatFaultToleranceAutoConfiguration
- UnionDiscoveryClient
- WebFluxServiceRegistryAutoConfiguration
- WebMvcServiceRegistryAutoConfiguration
- WebServiceRegistryAutoConfiguration
- WeightedRoundRobin
spring-cloud-openfeign
- AutoRefreshCapability
- AutoRefreshCapabilityCustomizer
- CompositedRequestInterceptor
- DecoratedContract
- DecoratedDecoder
- DecoratedEncoder
- DecoratedErrorDecoder
- DecoratedFeignComponent
- DecoratedQueryMapEncoder
- DecoratedRetryer
- EnableFeignAutoRefresh
- FeignAutoConfiguration
- FeignClientAutoRefreshAutoConfiguration
- FeignClientConfigurationChangedListener
- FeignComponentRegistry
- NoOpRequestInterceptor
- Refreshable