org.apache.karaf.shell.api.action.lifecycle.Service类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中org.apache.karaf.shell.api.action.lifecycle.Service类的一些代码示例,展示了Service类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Service类的具体详情如下:
包路径:org.apache.karaf.shell.api.action.lifecycle.Service
类名称:Service

Service介绍

暂无

代码示例

代码示例来源:origin: apache/cxf

@Service
public class StoppedEndpointCompleter extends EndpointCompleterSupport {

  @Override
  protected boolean acceptsFeature(Server server) {
    return !server.isStarted();
  }

}

代码示例来源:origin: apache/cxf

@Service
public class StartedEndpointCompleter extends EndpointCompleterSupport {

  @Override
  protected boolean acceptsFeature(Server server) {
    return server.isStarted();
  }

}

代码示例来源:origin: OpenNMS/opennms

@Service
public class DaemonNameCompleter implements Completer {

  @Override
  public int complete(Session session, CommandLine commandLine, List<String> candidates) {
    StringsCompleter daemonNames = new StringsCompleter();
    for(DaemonReloadEnum value : DaemonReloadEnum.values()) {
      daemonNames.getStrings().add(value.getDaemonName());
    }
    return daemonNames.complete(session, commandLine, candidates);
  }
}

代码示例来源:origin: apache/karaf

@Service
public class StartedInstanceCompleter extends InstanceCompleter {

  protected boolean acceptsInstance(Instance instance) {
    try {
      return instance.getState().equals(Instance.STARTED);
    } catch (Exception e) {
      return false;
    }
  }
}

代码示例来源:origin: apache/karaf

@Service
public class StoppedInstanceCompleter extends InstanceCompleter {
  
  protected boolean acceptsInstance(Instance instance) {
    try {
      return instance.getState().equals(Instance.STOPPED);
    } catch (Exception e) {
      return false;
    }
  }

}

代码示例来源:origin: apache/karaf

/**
 * {@link org.apache.karaf.shell.api.console.Completer} for features not installed yet.
 */
@Service
public class AvailableFeatureCompleter extends FeatureCompleterSupport {

  @Override
  protected boolean acceptsFeature(Feature feature) {
    return !featuresService.isInstalled(feature) && !feature.isHidden() && !feature.isBlacklisted();
  }

}

代码示例来源:origin: apache/karaf

/**
 * {@link FeatureCompleterSupport} for all available features.
 */
@Service
public class AllFeatureCompleter extends FeatureCompleterSupport {

  @Override
  protected boolean acceptsFeature(Feature feature) {
    return true;
  }

}

代码示例来源:origin: apache/karaf

/**
 * {@link FeatureCompleterSupport} for installed features.
 */
@Service
public class RequiredFeatureCompleter extends FeatureCompleterSupport {

  @Override
  protected boolean acceptsFeature(Feature feature) {
    return featuresService.isRequired(feature);
  }

}

代码示例来源:origin: apache/karaf

@Service
public class SubsystemCompleter extends SubsystemSupport implements Completer {

  @Override
  public int complete(Session session, CommandLine commandLine, List<String> candidates) {
    List<String> strings = new ArrayList<>();
    for (Subsystem ss : getSubsystems()) {
      strings.add(Long.toString(ss.getSubsystemId()));
      strings.add(ss.getSymbolicName() + "/" + ss.getVersion());
    }
    return new StringsCompleter(strings).complete(session, commandLine, candidates);
  }
}

代码示例来源:origin: org.onosproject/onos-cli

/**
 * Start/stop command completer.
 */
@Service
public class StartStopCompleter extends AbstractChoicesCompleter {

  public static final String START = "start";
  public static final String STOP = "stop";

  @Override
  public List<String> choices() {
    return ImmutableList.of(START, STOP);
  }
}

代码示例来源:origin: org.onosproject/onos-cli

/**
 * Application command completer.
 */
@Service
public class ApplicationCommandCompleter extends AbstractChoicesCompleter {
  @Override
  public List<String> choices() {
    return ImmutableList.of(INSTALL, UNINSTALL, ACTIVATE, DEACTIVATE, DOWNLOAD);
  }

}

代码示例来源:origin: org.apache.karaf.cellar/org.apache.karaf.cellar.core

@Service
public class NodeAliasCompleter extends NodeCompleterSupport {

  @Override
  protected boolean acceptsNode(Node node) {
    return true;
  }

  @Override
  protected boolean addId() { return false; }

  @Override
  protected boolean addAlias() { return true; }

}

代码示例来源:origin: org.apache.karaf.features/org.apache.karaf.features.command

/**
 * {@link FeatureCompleterSupport} for installed features.
 */
@Service
public class RequiredFeatureCompleter extends FeatureCompleterSupport {

  @Override
  protected boolean acceptsFeature(Feature feature) {
    return featuresService.isRequired(feature);
  }

}

代码示例来源:origin: org.xipki.shells/shell-base

/**
 * TODO.
 * @author Lijun Liao
 * @since 2.0.0
 */

@Service
public class YesNoCompleter extends AbstractEnumCompleter {

 public YesNoCompleter() {
  setTokens("yes", "no");
 }

}

代码示例来源:origin: org.xipki.shells/shell-base

/**
 * TODO.
 * @author Lijun Liao
 * @since 2.0.0
 */

@Service
public class ClientCrlReasonCompleter extends AbstractEnumCompleter {

 public ClientCrlReasonCompleter() {
  setTokens("unspecified", "keyCompromise", "affiliationChanged", "superseded",
    "cessationOfOperation", "certificateHold", "privilegeWithdrawn");
 }

}

代码示例来源:origin: org.xipki.shells/shell-base

/**
 * TODO.
 * @author Lijun Liao
 * @since 2.0.0
 */

@Service
public class DirCompleter extends FileCompleter {

 @Override
 protected boolean accept(Path path) {
  return path.toFile().isDirectory() && super.accept(path);
 }

}

代码示例来源:origin: org.xipki.tk/shell-base

/**
 * @author Lijun Liao
 * @since 2.0.0
 */

@Service
public class HashAlgCompleter extends AbstractEnumCompleter {

  public HashAlgCompleter() {
    setTokens("SHA1,SHA224,SHA256,SHA384,SHA512,SHA3-224,SHA3-256,SHA3-384,SHA3-512");
  }

}

代码示例来源:origin: org.xipki.tk/shell-base

/**
 * @author Lijun Liao
 * @since 2.0.0
 */

@Service
public class FilePathCompleter extends FileCompleter {

}

代码示例来源:origin: OpenNMS/opennms

@Service
public class AliasCompleter implements Completer {

  @Reference
  public SecureCredentialsVault secureCredentialsVault;

  public int complete(Session session, CommandLine commandLine, List<String> candidates) {
    StringsCompleter delegate = new StringsCompleter();
    // Gather the list of known aliases
    delegate.getStrings().addAll(secureCredentialsVault.getAliases());
    return delegate.complete(session, commandLine, candidates);
  }
}

代码示例来源:origin: apache/karaf

@Command(scope = "bundle", name = "id", description = "Gets the bundle ID.")
@Service
public class Id extends BundleCommand {

  @Override
  protected Object doExecute(Bundle bundle) throws Exception {
    return bundle.getBundleId();
  }

}

相关文章

微信公众号

最新文章

更多

Service类方法