Class WebServiceRegistryAutoConfiguration

  • All Implemented Interfaces:
    java.util.EventListener, org.springframework.context.ApplicationListener<io.microsphere.spring.web.event.WebEndpointMappingsReadyEvent>
    Direct Known Subclasses:
    WebFluxServiceRegistryAutoConfiguration, WebMvcServiceRegistryAutoConfiguration

    @Configuration(proxyBeanMethods=false)
    @ConditionalOnClass(name={"io.microsphere.spring.web.metadata.WebEndpointMapping","io.microsphere.spring.web.event.WebEndpointMappingsReadyEvent"})
    @ConditionalOnBean(org.springframework.cloud.client.serviceregistry.Registration.class)
    @ConditionalOnAutoServiceRegistrationEnabled
    @AutoConfigureAfter(ServiceRegistryAutoConfiguration.class)
    public abstract class WebServiceRegistryAutoConfiguration
    extends java.lang.Object
    implements org.springframework.context.ApplicationListener<io.microsphere.spring.web.event.WebEndpointMappingsReadyEvent>
    Auto-Configuration class for ServiceRegistry on the Spring WebMVC Application
    Since:
    1.0.0
    Author:
    Mercy
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String actuatorBasePath  
      protected io.microsphere.logging.Logger logger  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract java.lang.String getContextPath()
      Get the context path of the Spring Web Application
      protected boolean isActuatorWebEndpointMapping​(io.microsphere.spring.web.metadata.WebEndpointMapping mapping, java.lang.String[] patterns)
      Is actuator WebEndpointMapping
      protected abstract boolean isExcludedMapping​(io.microsphere.spring.web.metadata.WebEndpointMapping mapping, java.lang.String[] patterns)
      Is excluded mapping
      void onApplicationEvent​(io.microsphere.spring.web.event.WebEndpointMappingsReadyEvent event)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected final io.microsphere.logging.Logger logger
      • actuatorBasePath

        @Value("${management.endpoints.web.base-path:/actuator}")
        protected java.lang.String actuatorBasePath
    • Constructor Detail

      • WebServiceRegistryAutoConfiguration

        public WebServiceRegistryAutoConfiguration()
    • Method Detail

      • onApplicationEvent

        public final void onApplicationEvent​(io.microsphere.spring.web.event.WebEndpointMappingsReadyEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<io.microsphere.spring.web.event.WebEndpointMappingsReadyEvent>
      • getContextPath

        protected abstract java.lang.String getContextPath()
        Get the context path of the Spring Web Application
        Returns:
        context path
      • isExcludedMapping

        protected abstract boolean isExcludedMapping​(io.microsphere.spring.web.metadata.WebEndpointMapping mapping,
                                                     java.lang.String[] patterns)
        Is excluded mapping
        Parameters:
        mapping - WebEndpointMapping
        patterns - patterns
        Returns:
        if excluded mapping, return true, or false
      • isActuatorWebEndpointMapping

        protected boolean isActuatorWebEndpointMapping​(io.microsphere.spring.web.metadata.WebEndpointMapping mapping,
                                                       java.lang.String[] patterns)
        Is actuator WebEndpointMapping
        Parameters:
        mapping - WebEndpointMapping
        patterns - patterns
        Returns:
        if actuator WebEndpointMapping, return true, or false