dubbo GetEnabledRouterSnapshot 源码

  • 2022-10-20
  • 浏览 (329)

dubbo GetEnabledRouterSnapshot 代码

文件路径:/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/command/impl/GetEnabledRouterSnapshot.java

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.dubbo.qos.command.impl;

import org.apache.dubbo.qos.command.BaseCommand;
import org.apache.dubbo.qos.command.CommandContext;
import org.apache.dubbo.qos.command.annotation.Cmd;
import org.apache.dubbo.rpc.cluster.router.RouterSnapshotSwitcher;
import org.apache.dubbo.rpc.model.FrameworkModel;

@Cmd(name = "getEnabledRouterSnapshot",
    summary = "Get enabled Dubbo invocation level router snapshot print service list")
public class GetEnabledRouterSnapshot implements BaseCommand {
    private final RouterSnapshotSwitcher routerSnapshotSwitcher;

    public GetEnabledRouterSnapshot(FrameworkModel frameworkModel) {
        this.routerSnapshotSwitcher = frameworkModel.getBeanFactory().getBean(RouterSnapshotSwitcher.class);
    }

    @Override
    public String execute(CommandContext commandContext, String[] args) {
        return String.join("\n", routerSnapshotSwitcher.getEnabledService());
    }
}

相关信息

dubbo 源码目录

相关文章

dubbo BaseOffline 源码

dubbo BaseOnline 源码

dubbo ChangeTelnet 源码

dubbo CountTelnet 源码

dubbo DisableDetailProfiler 源码

dubbo DisableRouterSnapshot 源码

dubbo DisableSimpleProfiler 源码

dubbo EnableDetailProfiler 源码

dubbo EnableRouterSnapshot 源码

dubbo EnableSimpleProfiler 源码

0  赞