Skip to content

io microsphere spring cloud client service registry event RegistrationEvent

github-actions[bot] edited this page Jun 21, 2026 · 6 revisions

RegistrationEvent

Type: Class | Module: microsphere-spring-cloud-commons | Package: io.microsphere.spring.cloud.client.service.registry.event | Since: 1.0.0

Source: microsphere-spring-cloud-commons/src/main/java/io/microsphere/spring/cloud/client/service/registry/event/RegistrationEvent.java

Overview

The Spring event for ServiceRegistry

Declaration

public abstract class RegistrationEvent extends ApplicationEvent

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.20-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

Method Examples

getSource

ServiceRegistry<Registration> registry = ...;
Registration registration = ...;
// Typically used through a subclass such as RegistrationRegisteredEvent
RegistrationRegisteredEvent event = new RegistrationRegisteredEvent(registry, registration);

Usage

Maven Dependency

Add 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

import io.microsphere.spring.cloud.client.service.registry.event.RegistrationEvent;

API Reference

Public Methods

Method Description
getSource Create a new RegistrationEvent with the given ServiceRegistry and Registration.
getRegistration Get the registration
getRegistry Get the ServiceRegistry
isPreRegistered Current event is raised before the #getRegistration() registration is
isRegistered Current event is raised after the #getRegistration() registration is
isPreDeregistered Current event is raised before the #getRegistration() registration is
isDeregistered Current event is raised after the #getRegistration() registration is

Method Details

getSource

public Registration getSource()

Create a new RegistrationEvent with the given ServiceRegistry and Registration.

Example Usage:

`ServiceRegistry registry = ...;
Registration registration = ...;
// Typically used through a subclass such as RegistrationRegisteredEvent
RegistrationRegisteredEvent event = new RegistrationRegisteredEvent(registry, registration);
`

isPreRegistered

public final boolean isPreRegistered()

Current event is raised before the #getRegistration() registration is ServiceRegistry#register(Registration) registered.

isRegistered

public final boolean isRegistered()

Current event is raised after the #getRegistration() registration is ServiceRegistry#register(Registration) registered.

isPreDeregistered

public final boolean isPreDeregistered()

Current event is raised before the #getRegistration() registration is ServiceRegistry#deregister(Registration) deregistered.

isDeregistered

public final boolean isDeregistered()

Current event is raised after the #getRegistration() registration is ServiceRegistry#deregister(Registration) deregistered.

See Also

  • RegistrationPreRegisteredEvent
  • RegistrationRegisteredEvent
  • RegistrationPreDeregisteredEvent
  • RegistrationDeregisteredEvent
  • ServiceRegistry

This documentation was auto-generated from the source code of microsphere-spring-cloud.

Home

spring-cloud-commons

spring-cloud-openfeign

Clone this wiki locally