-
Notifications
You must be signed in to change notification settings - Fork 30
io microsphere spring cloud client service registry endpoint AbstractServiceRegistrationEndpoint
Type: Class | Module: microsphere-spring-cloud-commons | Package: io.microsphere.spring.cloud.client.service.registry.endpoint | Since: 1.0.0
Abstract Endpoint for Service Registration
public abstract class AbstractServiceRegistrationEndpoint implements SmartInitializingSingleton, ApplicationListener<WebServerInitializedEvent>Author: Mercy
-
Introduced in:
1.0.0 -
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 |
// Called automatically by the Spring container after all singletons are instantiated.
// Ensures registration, serviceRegistry, and serviceRegistration fields are populated.// Called automatically when the embedded web server has been initialized.
// After this event, the port and running state are available.boolean running = AbstractServiceRegistrationEndpoint.detectRunning(serviceRegistration);if (endpoint.isRunning()) {
// service is registered and running
}endpoint.setRunning(true); // mark service as running
endpoint.setRunning(false); // mark service as stoppedAdd the following dependency to your pom.xml:
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-cloud-commons</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.client.service.registry.endpoint.AbstractServiceRegistrationEndpoint;| Method | Description |
|---|---|
afterSingletonsInstantiated |
{@inheritDoc} |
onApplicationEvent |
{@inheritDoc} |
setRunning |
Detects whether the given AbstractAutoServiceRegistration is currently running. |
public void afterSingletonsInstantiated(){@inheritDoc}
Initializes the Registration, ServiceRegistry, and
AbstractAutoServiceRegistration from available bean providers.
Example Usage:
`// Called automatically by the Spring container after all singletons are instantiated. // Ensures registration, serviceRegistry, and serviceRegistration fields are populated. `
public void onApplicationEvent(WebServerInitializedEvent event){@inheritDoc}
Captures the web server port and detects the running state of the
AbstractAutoServiceRegistration.
Example Usage:
`// Called automatically when the embedded web server has been initialized. // After this event, the port and running state are available. `
public void setRunning(boolean running)Detects whether the given AbstractAutoServiceRegistration is currently running.
Example Usage:
`boolean running = AbstractServiceRegistrationEndpoint.detectRunning(serviceRegistration); `
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