public abstract class AbstractContextRefreshedEventListener<T,A extends java.lang.annotation.Annotation>
extends java.lang.Object
implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
LOG |
protected static java.lang.String |
PATH_SEPARATOR
api path separator.
|
| Constructor and Description |
|---|
AbstractContextRefreshedEventListener(org.apache.shenyu.register.common.config.PropertiesConfig clientConfig,
org.apache.shenyu.register.client.api.ShenyuClientRegisterRepository shenyuClientRegisterRepository)
Instantiates a new context refreshed event listener.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.javatuples.Sextet<java.lang.String[],java.lang.String,java.lang.String,org.apache.shenyu.common.enums.ApiHttpMethodEnum[],org.apache.shenyu.common.enums.RpcTypeEnum,java.lang.String> |
buildApiDocSextet(java.lang.reflect.Method method,
java.lang.annotation.Annotation annotation,
java.util.Map<java.lang.String,T> beans) |
protected abstract java.lang.String |
buildApiPath(java.lang.reflect.Method method,
java.lang.String superPath,
A methodShenyuClient) |
protected abstract java.lang.String |
buildApiSuperPath(java.lang.Class<?> clazz,
A beanShenyuClient) |
protected abstract org.apache.shenyu.register.common.dto.MetaDataRegisterDTO |
buildMetaDataDTO(T bean,
A shenyuClient,
java.lang.String path,
java.lang.Class<?> clazz,
java.lang.reflect.Method method) |
protected abstract org.apache.shenyu.register.common.dto.URIRegisterDTO |
buildURIRegisterDTO(org.springframework.context.ApplicationContext context,
java.util.Map<java.lang.String,T> beans) |
protected org.apache.shenyu.register.common.dto.ApiDocRegisterDTO.ApiExt |
customApiDocExt(org.apache.shenyu.register.common.dto.ApiDocRegisterDTO.ApiExt ext) |
protected abstract java.lang.Class<A> |
getAnnotationType() |
java.lang.String |
getAppName()
Get the app name.
|
protected abstract java.util.Map<java.lang.String,T> |
getBeans(org.springframework.context.ApplicationContext context) |
org.springframework.context.ApplicationContext |
getContext()
Get the context.
|
java.lang.String |
getContextPath()
Get the context path.
|
protected java.lang.Class<?> |
getCorrectedClass(T bean) |
java.lang.String |
getHost()
Get the host.
|
java.lang.String |
getIpAndPort()
Get the ip and port.
|
java.util.Map<java.lang.reflect.Method,org.apache.shenyu.register.common.dto.MetaDataRegisterDTO> |
getMetaDataMap()
Get the metadata map.
|
java.lang.String |
getPort()
Get the port.
|
ShenyuClientRegisterEventPublisher |
getPublisher()
Get the event publisher.
|
protected void |
handle(java.lang.String beanName,
T bean) |
protected void |
handleClass(java.lang.Class<?> clazz,
T bean,
A beanShenyuClient,
java.lang.String superPath) |
protected void |
handleMethod(T bean,
java.lang.Class<?> clazz,
A beanShenyuClient,
java.lang.reflect.Method method,
java.lang.String superPath) |
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
protected java.lang.String |
pathJoin(java.lang.String... path) |
protected static final org.slf4j.Logger LOG
protected static final java.lang.String PATH_SEPARATOR
public AbstractContextRefreshedEventListener(org.apache.shenyu.register.common.config.PropertiesConfig clientConfig,
org.apache.shenyu.register.client.api.ShenyuClientRegisterRepository shenyuClientRegisterRepository)
clientConfig - the shenyu client configshenyuClientRegisterRepository - the shenyuClientRegisterRepositorypublic void onApplicationEvent(@NonNull
org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>protected org.apache.shenyu.register.common.dto.ApiDocRegisterDTO.ApiExt customApiDocExt(org.apache.shenyu.register.common.dto.ApiDocRegisterDTO.ApiExt ext)
protected abstract org.javatuples.Sextet<java.lang.String[],java.lang.String,java.lang.String,org.apache.shenyu.common.enums.ApiHttpMethodEnum[],org.apache.shenyu.common.enums.RpcTypeEnum,java.lang.String> buildApiDocSextet(java.lang.reflect.Method method,
java.lang.annotation.Annotation annotation,
java.util.Map<java.lang.String,T> beans)
protected abstract java.util.Map<java.lang.String,T> getBeans(org.springframework.context.ApplicationContext context)
protected abstract org.apache.shenyu.register.common.dto.URIRegisterDTO buildURIRegisterDTO(org.springframework.context.ApplicationContext context,
java.util.Map<java.lang.String,T> beans)
protected void handle(java.lang.String beanName,
T bean)
protected java.lang.Class<?> getCorrectedClass(T bean)
protected abstract java.lang.String buildApiSuperPath(java.lang.Class<?> clazz,
@Nullable
A beanShenyuClient)
protected void handleClass(java.lang.Class<?> clazz,
T bean,
@NonNull
A beanShenyuClient,
java.lang.String superPath)
protected void handleMethod(T bean, java.lang.Class<?> clazz, @Nullable A beanShenyuClient, java.lang.reflect.Method method, java.lang.String superPath)
protected abstract java.lang.Class<A> getAnnotationType()
protected abstract java.lang.String buildApiPath(java.lang.reflect.Method method,
java.lang.String superPath,
@NonNull
A methodShenyuClient)
protected java.lang.String pathJoin(@NonNull
java.lang.String... path)
protected abstract org.apache.shenyu.register.common.dto.MetaDataRegisterDTO buildMetaDataDTO(T bean, @NonNull A shenyuClient, java.lang.String path, java.lang.Class<?> clazz, java.lang.reflect.Method method)
public ShenyuClientRegisterEventPublisher getPublisher()
public java.util.Map<java.lang.reflect.Method,org.apache.shenyu.register.common.dto.MetaDataRegisterDTO> getMetaDataMap()
public java.lang.String getAppName()
public java.lang.String getContextPath()
public java.lang.String getIpAndPort()
public java.lang.String getHost()
public java.lang.String getPort()
public org.springframework.context.ApplicationContext getContext()
Copyright © 2023 The Apache Software Foundation. All rights reserved.