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

项目:spring-cloud-commons    文件:RestartEndpoint.java   
@WriteOperation
//FIXME: map with "message: Restarting" or couldn't restart
public Boolean restart() {
    try {
        doRestart();
        logger.info("Restarted");
        return true;
    }
    catch (Exception e) {
        if (logger.isDebugEnabled()) {
            logger.info("Could not doRestart", e);
        }
        else {
            logger.info("Could not doRestart: " + e.getMessage());
        }
        return false;
    }
}
项目:sshd-shell-spring-boot    文件:EndpointCommand.java   
@Autowired
EndpointCommand(ApplicationContext appCtx) {
    appCtx.getBeansWithAnnotation(Endpoint.class).entrySet().stream().forEachOrdered(entry -> {
        log.info("{} : {}", entry.getKey(), entry.getValue().getClass().getName());
        for (Method m : entry.getValue().getClass().getDeclaredMethods()) {
            if (m.isAnnotationPresent(ReadOperation.class) || m.isAnnotationPresent(WriteOperation.class)) {
                log.info("\tOp: {}", m.getName());
                for (Parameter p : m.getParameters()) {
                    log.info("\t\tParameter {}, {}", p.getName(), p.getType().getName());
                }
            }
        }
    });
}
项目:spring-cloud-commons    文件:RestartEndpoint.java   
@WriteOperation
public Boolean pause() {
    if (isRunning()) {
        doPause();
        return true;
    }
    return false;
}
项目:spring-cloud-commons    文件:RestartEndpoint.java   
@WriteOperation
public Boolean resume() {
    if (!isRunning()) {
        doResume();
        return true;
    }
    return false;
}
项目:spring-cloud-commons    文件:ServiceRegistryEndpoint.java   
@WriteOperation
public ResponseEntity<?> setStatus(String status) {
    Assert.notNull(status, "status may not by null");

    if (this.registration == null) {
        return ResponseEntity.status(HttpStatus.NOT_FOUND).body("no registration found");
    }

    this.serviceRegistry.setStatus(this.registration, status);
    return ResponseEntity.ok().build();
}
项目:spring-cloud-bus    文件:RefreshBusEndpoint.java   
@WriteOperation
public void busRefreshWithDestination(@Selector String destination) { //TODO: document destination
    publish(new RefreshRemoteApplicationEvent(this, getInstanceId(), destination));
}
项目:spring-cloud-bus    文件:RefreshBusEndpoint.java   
@WriteOperation
public void busRefresh() {
    publish(new RefreshRemoteApplicationEvent(this, getInstanceId(), null));
}
项目:spring-cloud-bus    文件:EnvironmentBusEndpoint.java   
@WriteOperation
public void busEnvWithDestination(String name, String value, @Selector String destination) { //TODO: document params
    Map<String, String> params = Collections.singletonMap(name, value);
    publish(new EnvironmentChangeRemoteApplicationEvent(this, getInstanceId(),
            destination, params));
}
项目:spring-cloud-bus    文件:EnvironmentBusEndpoint.java   
@WriteOperation
public void busEnv(String name, String value) { //TODO: document params
    Map<String, String> params = Collections.singletonMap(name, value);
    publish(new EnvironmentChangeRemoteApplicationEvent(this, getInstanceId(),
            null, params));
}
项目:spring-cloud-commons    文件:EnvironmentWebEndpointExtension.java   
@WriteOperation
public Object write(String name, String value) {
    environment.setProperty(name, value);
    return Collections.singletonMap(name, value);
}
项目:spring-cloud-commons    文件:RefreshEndpoint.java   
@WriteOperation
public Collection<String> refresh() {
    Set<String> keys = contextRefresher.refresh();
    return keys;
}
项目:spring-cloud-netflix    文件:RoutesEndpoint.java   
@WriteOperation
public Object reset() {
    this.publisher.publishEvent(new RoutesRefreshedEvent(this.routes));
    return invoke();
}