Java 类org.springframework.boot.actuate.endpoint.Endpoint 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointMBeanExporter.java   
protected void registerEndpoint(String beanName, Endpoint<?> endpoint) {
    @SuppressWarnings("rawtypes")
    Class<? extends Endpoint> type = endpoint.getClass();
    if (AnnotationUtils.findAnnotation(type, ManagedResource.class) != null) {
        // Already managed
        return;
    }
    if (type.isMemberClass()
            && AnnotationUtils.findAnnotation(type.getEnclosingClass(),
                    ManagedResource.class) != null) {
        // Nested class with @ManagedResource in parent
        return;
    }
    try {
        registerBeanNameOrInstance(getEndpointMBean(beanName, endpoint), beanName);
    }
    catch (MBeanExportException ex) {
        logger.error("Could not register MBean for endpoint [" + beanName + "]", ex);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MvcEndpoints.java   
@Override
public void afterPropertiesSet() throws Exception {
    Collection<MvcEndpoint> existing = BeanFactoryUtils
            .beansOfTypeIncludingAncestors(this.applicationContext, MvcEndpoint.class)
            .values();
    this.endpoints.addAll(existing);
    this.customTypes = findEndpointClasses(existing);
    @SuppressWarnings("rawtypes")
    Collection<Endpoint> delegates = BeanFactoryUtils
            .beansOfTypeIncludingAncestors(this.applicationContext, Endpoint.class)
            .values();
    for (Endpoint<?> endpoint : delegates) {
        if (isGenericEndpoint(endpoint.getClass()) && endpoint.isEnabled()) {
            EndpointMvcAdapter adapter = new EndpointMvcAdapter(endpoint);
            String path = determinePath(endpoint,
                    this.applicationContext.getEnvironment());
            if (path != null) {
                adapter.setPath(path);
            }
            this.endpoints.add(adapter);
        }
    }
}
项目:spring-boot-concourse    文件:EndpointMBeanExporter.java   
protected void registerEndpoint(String beanName, Endpoint<?> endpoint) {
    @SuppressWarnings("rawtypes")
    Class<? extends Endpoint> type = endpoint.getClass();
    if (AnnotationUtils.findAnnotation(type, ManagedResource.class) != null) {
        // Already managed
        return;
    }
    if (type.isMemberClass()
            && AnnotationUtils.findAnnotation(type.getEnclosingClass(),
                    ManagedResource.class) != null) {
        // Nested class with @ManagedResource in parent
        return;
    }
    try {
        registerBeanNameOrInstance(getEndpointMBean(beanName, endpoint), beanName);
    }
    catch (MBeanExportException ex) {
        logger.error("Could not register MBean for endpoint [" + beanName + "]", ex);
    }
}
项目:spring-boot-concourse    文件:MvcEndpoints.java   
@Override
public void afterPropertiesSet() throws Exception {
    Collection<MvcEndpoint> existing = BeanFactoryUtils
            .beansOfTypeIncludingAncestors(this.applicationContext, MvcEndpoint.class)
            .values();
    this.endpoints.addAll(existing);
    this.customTypes = findEndpointClasses(existing);
    @SuppressWarnings("rawtypes")
    Collection<Endpoint> delegates = BeanFactoryUtils
            .beansOfTypeIncludingAncestors(this.applicationContext, Endpoint.class)
            .values();
    for (Endpoint<?> endpoint : delegates) {
        if (isGenericEndpoint(endpoint.getClass()) && endpoint.isEnabled()) {
            EndpointMvcAdapter adapter = new EndpointMvcAdapter(endpoint);
            String path = determinePath(endpoint,
                    this.applicationContext.getEnvironment());
            if (path != null) {
                adapter.setPath(path);
            }
            this.endpoints.add(adapter);
        }
    }
}
项目:spring-boot-starter-kit    文件:ActuatorConfiguration.java   
@Bean
public static Endpoint<String> pingEndpoint() {
  return new Endpoint<String>() {
    @Override
    public String getId() {
      return "ping";
    }

    @Override
    public boolean isEnabled() {
      return true;
    }

    @Override
    public boolean isSensitive() {
      return false;
    }

    @Override
    public String invoke() {
      return "OK";
    }
  };
}
项目:contestparser    文件:EndpointMBeanExporter.java   
protected void registerEndpoint(String beanName, Endpoint<?> endpoint) {
    @SuppressWarnings("rawtypes")
    Class<? extends Endpoint> type = endpoint.getClass();
    if (AnnotationUtils.findAnnotation(type, ManagedResource.class) != null) {
        // Already managed
        return;
    }
    if (type.isMemberClass()
            && AnnotationUtils.findAnnotation(type.getEnclosingClass(),
                    ManagedResource.class) != null) {
        // Nested class with @ManagedResource in parent
        return;
    }
    try {
        registerBeanNameOrInstance(getEndpointMBean(beanName, endpoint), beanName);
    }
    catch (MBeanExportException ex) {
        logger.error("Could not register MBean for endpoint [" + beanName + "]", ex);
    }
}
项目:contestparser    文件:MvcEndpoints.java   
@Override
public void afterPropertiesSet() throws Exception {
    Collection<MvcEndpoint> existing = BeanFactoryUtils
            .beansOfTypeIncludingAncestors(this.applicationContext, MvcEndpoint.class)
            .values();
    this.endpoints.addAll(existing);
    this.customTypes = findEndpointClasses(existing);
    @SuppressWarnings("rawtypes")
    Collection<Endpoint> delegates = BeanFactoryUtils
            .beansOfTypeIncludingAncestors(this.applicationContext, Endpoint.class)
            .values();
    for (Endpoint<?> endpoint : delegates) {
        if (isGenericEndpoint(endpoint.getClass()) && endpoint.isEnabled()) {
            EndpointMvcAdapter adapter = new EndpointMvcAdapter(endpoint);
            String path = this.applicationContext.getEnvironment()
                    .getProperty("endpoints." + endpoint.getId() + ".path");
            if (path != null) {
                adapter.setPath(path);
            }
            this.endpoints.add(adapter);
        }
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointMBeanExporter.java   
@SuppressWarnings({ "rawtypes" })
protected void locateAndRegisterEndpoints() {
    Map<String, Endpoint> endpoints = this.beanFactory.getBeansOfType(Endpoint.class);
    for (Map.Entry<String, Endpoint> endpointEntry : endpoints.entrySet()) {
        if (!this.registeredEndpoints.contains(endpointEntry.getValue())
                && endpointEntry.getValue().isEnabled()) {
            registerEndpoint(endpointEntry.getKey(), endpointEntry.getValue());
            this.registeredEndpoints.add(endpointEntry.getValue());
        }
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointMBeanExporter.java   
private boolean parentContextContainsSameBean(ApplicationContext applicationContext,
        String beanKey) {
    if (applicationContext.getParent() != null) {
        try {
            this.applicationContext.getParent().getBean(beanKey, Endpoint.class);
            return true;
        }
        catch (BeansException ex) {
            return parentContextContainsSameBean(applicationContext.getParent(),
                    beanKey);
        }
    }
    return false;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointMBean.java   
/**
 * Create a new {@link EndpointMBean} instance.
 * @param beanName the bean name
 * @param endpoint the endpoint to wrap
 * @param objectMapper the {@link ObjectMapper} used to convert the payload
 */
public EndpointMBean(String beanName, Endpoint<?> endpoint,
        ObjectMapper objectMapper) {
    Assert.notNull(beanName, "BeanName must not be null");
    Assert.notNull(endpoint, "Endpoint must not be null");
    Assert.notNull(objectMapper, "ObjectMapper must not be null");
    this.endpoint = endpoint;
    this.mapper = objectMapper;
    this.listObject = objectMapper.getTypeFactory()
            .constructParametricType(List.class, Object.class);
    this.mapStringObject = objectMapper.getTypeFactory()
            .constructParametricType(Map.class, String.class, Object.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MvcEndpoints.java   
private String determinePath(Endpoint<?> endpoint, Environment environment) {
    ConfigurationProperties configurationProperties = AnnotationUtils
            .findAnnotation(endpoint.getClass(), ConfigurationProperties.class);
    if (configurationProperties != null) {
        return environment.getProperty(configurationProperties.prefix() + ".path");
    }
    return null;
}
项目:spring-boot-concourse    文件:EndpointMBeanExporter.java   
@SuppressWarnings({ "rawtypes" })
protected void locateAndRegisterEndpoints() {
    Map<String, Endpoint> endpoints = this.beanFactory.getBeansOfType(Endpoint.class);
    for (Map.Entry<String, Endpoint> endpointEntry : endpoints.entrySet()) {
        if (!this.registeredEndpoints.contains(endpointEntry.getValue())
                && endpointEntry.getValue().isEnabled()) {
            registerEndpoint(endpointEntry.getKey(), endpointEntry.getValue());
            this.registeredEndpoints.add(endpointEntry.getValue());
        }
    }
}
项目:spring-boot-concourse    文件:EndpointMBeanExporter.java   
private boolean parentContextContainsSameBean(ApplicationContext applicationContext,
        String beanKey) {
    if (applicationContext.getParent() != null) {
        try {
            this.applicationContext.getParent().getBean(beanKey, Endpoint.class);
            return true;
        }
        catch (BeansException ex) {
            return parentContextContainsSameBean(applicationContext.getParent(),
                    beanKey);
        }
    }
    return false;
}
项目:spring-boot-concourse    文件:EndpointMBean.java   
/**
 * Create a new {@link EndpointMBean} instance.
 * @param beanName the bean name
 * @param endpoint the endpoint to wrap
 * @param objectMapper the {@link ObjectMapper} used to convert the payload
 */
public EndpointMBean(String beanName, Endpoint<?> endpoint,
        ObjectMapper objectMapper) {
    Assert.notNull(beanName, "BeanName must not be null");
    Assert.notNull(endpoint, "Endpoint must not be null");
    Assert.notNull(objectMapper, "ObjectMapper must not be null");
    this.endpoint = endpoint;
    this.mapper = objectMapper;
    this.listObject = objectMapper.getTypeFactory()
            .constructParametricType(List.class, Object.class);
    this.mapStringObject = objectMapper.getTypeFactory()
            .constructParametricType(Map.class, String.class, Object.class);
}
项目:spring-boot-concourse    文件:MvcEndpoints.java   
private String determinePath(Endpoint<?> endpoint, Environment environment) {
    ConfigurationProperties configurationProperties = AnnotationUtils
            .findAnnotation(endpoint.getClass(), ConfigurationProperties.class);
    if (configurationProperties != null) {
        String prefix = StringUtils.hasText(configurationProperties.prefix())
                ? configurationProperties.prefix() : configurationProperties.value();
        return environment.getProperty(prefix + ".path");
    }
    return null;
}
项目:contestparser    文件:EndpointMBeanExporter.java   
@SuppressWarnings({ "rawtypes" })
protected void locateAndRegisterEndpoints() {
    Map<String, Endpoint> endpoints = this.beanFactory.getBeansOfType(Endpoint.class);
    for (Map.Entry<String, Endpoint> endpointEntry : endpoints.entrySet()) {
        if (!this.registeredEndpoints.contains(endpointEntry.getValue())
                && endpointEntry.getValue().isEnabled()) {
            registerEndpoint(endpointEntry.getKey(), endpointEntry.getValue());
            this.registeredEndpoints.add(endpointEntry.getValue());
        }
    }
}
项目:contestparser    文件:EndpointMBeanExporter.java   
private boolean parentContextContainsSameBean(ApplicationContext applicationContext,
        String beanKey) {
    if (applicationContext.getParent() != null) {
        try {
            this.applicationContext.getParent().getBean(beanKey, Endpoint.class);
            return true;
        }
        catch (BeansException ex) {
            return parentContextContainsSameBean(applicationContext.getParent(),
                    beanKey);
        }
    }
    return false;
}
项目:contestparser    文件:EndpointMBean.java   
/**
 * Create a new {@link EndpointMBean} instance.
 * @param beanName the bean name
 * @param endpoint the endpoint to wrap
 * @param objectMapper the {@link ObjectMapper} used to convert the payload
 */
public EndpointMBean(String beanName, Endpoint<?> endpoint,
        ObjectMapper objectMapper) {
    Assert.notNull(beanName, "BeanName must not be null");
    Assert.notNull(endpoint, "Endpoint must not be null");
    Assert.notNull(objectMapper, "ObjectMapper must not be null");
    this.endpoint = endpoint;
    this.mapper = objectMapper;
}
项目:taboola-cronyx    文件:SchedulingServiceRestController.java   
@Override
public Class<? extends Endpoint> getEndpointType() {
    return null;
}
项目:taboola-cronyx    文件:JobServiceRestController.java   
@Override
public Class<? extends Endpoint> getEndpointType() {
    return null;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointMBeanExporter.java   
protected EndpointMBean getEndpointMBean(String beanName, Endpoint<?> endpoint) {
    if (endpoint instanceof ShutdownEndpoint) {
        return new ShutdownEndpointMBean(beanName, endpoint, this.objectMapper);
    }
    return new DataEndpointMBean(beanName, endpoint, this.objectMapper);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointMBean.java   
public Endpoint<?> getEndpoint() {
    return this.endpoint;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AbstractMvcEndpoint.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return null;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AbstractEndpointMvcAdapter.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return this.delegate.getClass();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointWebMvcAutoConfigurationTests.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return Endpoint.class;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointMBeanExportAutoConfigurationTests.java   
@Bean
public Endpoint<Boolean> nested() {
    return new Nested();
}
项目:spring-boot-concourse    文件:EndpointMBeanExporter.java   
protected EndpointMBean getEndpointMBean(String beanName, Endpoint<?> endpoint) {
    if (endpoint instanceof ShutdownEndpoint) {
        return new ShutdownEndpointMBean(beanName, endpoint, this.objectMapper);
    }
    return new DataEndpointMBean(beanName, endpoint, this.objectMapper);
}
项目:spring-boot-concourse    文件:EndpointMBean.java   
public Endpoint<?> getEndpoint() {
    return this.endpoint;
}
项目:spring-boot-concourse    文件:JolokiaMvcEndpoint.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return null;
}
项目:spring-boot-concourse    文件:AbstractEndpointMvcAdapter.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return this.delegate.getClass();
}
项目:spring-boot-concourse    文件:DocsMvcEndpoint.java   
@Override
public Class<? extends Endpoint<?>> getEndpointType() {
    return null;
}
项目:spring-boot-concourse    文件:HalJsonMvcEndpoint.java   
@Override
public Class<? extends Endpoint<?>> getEndpointType() {
    return null;
}
项目:spring-boot-concourse    文件:LogFileMvcEndpoint.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return null;
}
项目:spring-boot-concourse    文件:EndpointWebMvcAutoConfigurationTests.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return Endpoint.class;
}
项目:spring-boot-concourse    文件:EndpointMBeanExportAutoConfigurationTests.java   
@Bean
public Endpoint<Boolean> nested() {
    return new Nested();
}
项目:contestparser    文件:EndpointMBeanExporter.java   
protected EndpointMBean getEndpointMBean(String beanName, Endpoint<?> endpoint) {
    if (endpoint instanceof ShutdownEndpoint) {
        return new ShutdownEndpointMBean(beanName, endpoint, this.objectMapper);
    }
    return new DataEndpointMBean(beanName, endpoint, this.objectMapper);
}
项目:contestparser    文件:EndpointMBean.java   
public Endpoint<?> getEndpoint() {
    return this.endpoint;
}
项目:contestparser    文件:ManagementErrorEndpoint.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return null;
}
项目:contestparser    文件:JolokiaMvcEndpoint.java   
@Override
@SuppressWarnings("rawtypes")
public Class<? extends Endpoint> getEndpointType() {
    return null;
}
项目:contestparser    文件:ActuatorDocsEndpoint.java   
@Override
public Class<? extends Endpoint<?>> getEndpointType() {
    return null;
}