javax.websocket.Extension.getName()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(140)

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

Extension.getName介绍

[英]The name of the extension.
[中]扩展名的名称。

代码示例

代码示例来源:origin: spring-projects/spring-framework

public StandardToWebSocketExtensionAdapter(Extension extension) {
  super(extension.getName(), initParameters(extension));
}

代码示例来源:origin: org.apache.tomcat.embed/tomcat-embed-websocket

@Override
public List<Extension> getNegotiatedExtensions(List<Extension> installed,
    List<Extension> requested) {
  Set<String> installedNames = new HashSet<>();
  for (Extension e : installed) {
    installedNames.add(e.getName());
  }
  List<Extension> result = new ArrayList<>();
  for (Extension request : requested) {
    if (installedNames.contains(request.getName())) {
      result.add(request);
    }
  }
  return result;
}

代码示例来源:origin: org.jboss.web/jbossweb

@Override
public List<Extension> getNegotiatedExtensions(List<Extension> installed,
    List<Extension> requested) {
  Set<String> installedNames = new HashSet<String>();
  for (Extension e : installed) {
    installedNames.add(e.getName());
  }
  List<Extension> result = new ArrayList<Extension>();
  for (Extension request : requested) {
    if (installedNames.contains(request.getName())) {
      result.add(request);
    }
  }
  return result;
}

代码示例来源:origin: org.apache.tomcat/tomcat7-websocket

@Override
public List<Extension> getNegotiatedExtensions(List<Extension> installed,
    List<Extension> requested) {
  Set<String> installedNames = new HashSet<String>();
  for (Extension e : installed) {
    installedNames.add(e.getName());
  }
  List<Extension> result = new ArrayList<Extension>();
  for (Extension request : requested) {
    if (installedNames.contains(request.getName())) {
      result.add(request);
    }
  }
  return result;
}

代码示例来源:origin: org.apache.tomcat/tomcat-websocket

@Override
public List<Extension> getNegotiatedExtensions(List<Extension> installed,
    List<Extension> requested) {
  Set<String> installedNames = new HashSet<>();
  for (Extension e : installed) {
    installedNames.add(e.getName());
  }
  List<Extension> result = new ArrayList<>();
  for (Extension request : requested) {
    if (installedNames.contains(request.getName())) {
      result.add(request);
    }
  }
  return result;
}

代码示例来源:origin: Red5/red5-plugins

@Override
public List<Extension> getNegotiatedExtensions(List<Extension> installed, List<Extension> requested) {
  log.debug("getNegotiatedExtensions - installed: {} requested: {}", installed, requested);
  Set<String> installedNames = new HashSet<>();
  for (Extension e : installed) {
    installedNames.add(e.getName());
  }
  List<Extension> result = new ArrayList<>();
  for (Extension request : requested) {
    if (installedNames.contains(request.getName())) {
      result.add(request);
    }
  }
  return result;
}

代码示例来源:origin: org.cometd.java/cometd-java-websocket-javax-server

@Override
public List<Extension> getNegotiatedExtensions(List<Extension> installed, List<Extension> requested) {
  List<Extension> negotiated = new ArrayList<>();
  for (Extension extension : requested) {
    String name = extension.getName();
    boolean option = getOption(ENABLE_EXTENSION_PREFIX_OPTION + name, true);
    if (option) {
      negotiated.add(extension);
    }
  }
  return negotiated;
}

代码示例来源:origin: org.springframework/spring-websocket

public StandardToWebSocketExtensionAdapter(Extension extension) {
  super(extension.getName(), initParameters(extension));
}

代码示例来源:origin: apache/servicemix-bundles

public StandardToWebSocketExtensionAdapter(Extension extension) {
  super(extension.getName(), initParameters(extension));
}

代码示例来源:origin: org.apache.tomcat.embed/tomcat-embed-websocket

private static void append(StringBuilder sb, Extension extension) {
  if (extension == null || extension.getName() == null || extension.getName().length() == 0) {
    return;
  }
  sb.append(extension.getName());
  for (Extension.Parameter p : extension.getParameters()) {
    sb.append(';');
    sb.append(p.getName());
    if (p.getValue() != null) {
      sb.append('=');
      sb.append(p.getValue());
    }
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat7-websocket

private static void append(StringBuilder sb, Extension extension) {
  if (extension == null || extension.getName() == null || extension.getName().length() == 0) {
    return;
  }
  sb.append(extension.getName());
  for (Extension.Parameter p : extension.getParameters()) {
    sb.append(';');
    sb.append(p.getName());
    if (p.getValue() != null) {
      sb.append('=');
      sb.append(p.getValue());
    }
  }
}

代码示例来源:origin: org.jboss.web/jbossweb

private static void append(StringBuilder sb, Extension extension) {
  if (extension == null || extension.getName() == null || extension.getName().length() == 0) {
    return;
  }
  sb.append(extension.getName());
  for (Extension.Parameter p : extension.getParameters()) {
    sb.append(';');
    sb.append(p.getName());
    if (p.getValue() != null) {
      sb.append('=');
      sb.append(p.getValue());
    }
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat-websocket

private static void append(StringBuilder sb, Extension extension) {
  if (extension == null || extension.getName() == null || extension.getName().length() == 0) {
    return;
  }
  sb.append(extension.getName());
  for (Extension.Parameter p : extension.getParameters()) {
    sb.append(';');
    sb.append(p.getName());
    if (p.getValue() != null) {
      sb.append('=');
      sb.append(p.getValue());
    }
  }
}

代码示例来源:origin: Red5/red5-plugins

private static void append(StringBuilder sb, Extension extension) {
  if (extension == null || extension.getName() == null || extension.getName().length() == 0) {
    return;
  }
  sb.append(extension.getName());
  for (Extension.Parameter p : extension.getParameters()) {
    sb.append(';');
    sb.append(p.getName());
    if (p.getValue() != null) {
      sb.append('=');
      sb.append(p.getValue());
    }
  }
}

代码示例来源:origin: org.apache.tomcat/tomcat7-websocket

private static List<String> generateExtensionHeaders(List<Extension> extensions) {
  List<String> result = new ArrayList<String>(extensions.size());
  for (Extension extension : extensions) {
    StringBuilder header = new StringBuilder();
    header.append(extension.getName());
    for (Extension.Parameter param : extension.getParameters()) {
      header.append(';');
      header.append(param.getName());
      String value = param.getValue();
      if (value != null && value.length() > 0) {
        header.append('=');
        header.append(value);
      }
    }
    result.add(header.toString());
  }
  return result;
}

代码示例来源:origin: org.apache.tomcat.embed/tomcat-embed-websocket

private static List<String> generateExtensionHeaders(List<Extension> extensions) {
  List<String> result = new ArrayList<>(extensions.size());
  for (Extension extension : extensions) {
    StringBuilder header = new StringBuilder();
    header.append(extension.getName());
    for (Extension.Parameter param : extension.getParameters()) {
      header.append(';');
      header.append(param.getName());
      String value = param.getValue();
      if (value != null && value.length() > 0) {
        header.append('=');
        header.append(value);
      }
    }
    result.add(header.toString());
  }
  return result;
}

代码示例来源:origin: org.jboss.web/jbossweb

private List<String> generateExtensionHeaders(List<Extension> extensions) {
  List<String> result = new ArrayList<String>(extensions.size());
  for (Extension extension : extensions) {
    StringBuilder header = new StringBuilder();
    header.append(extension.getName());
    for (Extension.Parameter param : extension.getParameters()) {
      header.append(';');
      header.append(param.getName());
      String value = param.getValue();
      if (value != null && value.length() > 0) {
        header.append('=');
        header.append(value);
      }
    }
    result.add(header.toString());
  }
  return result;
}

代码示例来源:origin: codefollower/Tomcat-Research

private List<String> generateExtensionHeaders(List<Extension> extensions) {
  List<String> result = new ArrayList<>(extensions.size());
  for (Extension extension : extensions) {
    StringBuilder header = new StringBuilder();
    header.append(extension.getName());
    for (Extension.Parameter param : extension.getParameters()) {
      header.append(';');
      header.append(param.getName());
      String value = param.getValue();
      if (value != null && value.length() > 0) {
        header.append('=');
        header.append(value);
      }
    }
  }
  return result;
}

代码示例来源:origin: org.glassfish.tyrus/tyrus-core

private void logExtensionsAndSubprotocol(ProtocolHandler protocolHandler, DebugContext debugContext) {
  StringBuilder sb = new StringBuilder();
  sb.append("Using negotiated extensions: [");
  boolean isFirst = true;
  for (Extension extension : protocolHandler.getExtensions()) {
    if (isFirst) {
      isFirst = false;
    } else {
      sb.append(", ");
    }
    sb.append(extension.getName());
  }
  sb.append("]");
  debugContext.appendLogMessage(LOGGER, Level.FINE, DebugContext.Type.OTHER, "Using negotiated extensions: ", sb);
  debugContext.appendLogMessage(LOGGER, Level.FINE, DebugContext.Type.OTHER, "Using negotiated subprotocol: ",
                 protocolHandler.getSubProtocol());
}

代码示例来源:origin: eclipse-ee4j/tyrus

private void logExtensionsAndSubprotocol(ProtocolHandler protocolHandler, DebugContext debugContext) {
  StringBuilder sb = new StringBuilder();
  sb.append("Using negotiated extensions: [");
  boolean isFirst = true;
  for (Extension extension : protocolHandler.getExtensions()) {
    if (isFirst) {
      isFirst = false;
    } else {
      sb.append(", ");
    }
    sb.append(extension.getName());
  }
  sb.append("]");
  debugContext.appendLogMessage(LOGGER, Level.FINE, DebugContext.Type.OTHER, "Using negotiated extensions: ", sb);
  debugContext.appendLogMessage(LOGGER, Level.FINE, DebugContext.Type.OTHER, "Using negotiated subprotocol: ",
                 protocolHandler.getSubProtocol());
}

相关文章