当前位置: 首页>>代码示例>>Java>>正文


Java Extension.Parameter方法代码示例

本文整理汇总了Java中javax.websocket.Extension.Parameter方法的典型用法代码示例。如果您正苦于以下问题:Java Extension.Parameter方法的具体用法?Java Extension.Parameter怎么用?Java Extension.Parameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.websocket.Extension的用法示例。


在下文中一共展示了Extension.Parameter方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateExtensionHeaders

import javax.websocket.Extension; //导入方法依赖的package包/类
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;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:19,代码来源:WsWebSocketContainer.java

示例2: getExtensionResponse

import javax.websocket.Extension; //导入方法依赖的package包/类
@Override
public Extension getExtensionResponse() {
    Extension result = new WsExtension(NAME);

    List<Extension.Parameter> params = result.getParameters();

    if (!serverContextTakeover) {
        params.add(new WsExtensionParameter(SERVER_NO_CONTEXT_TAKEOVER, null));
    }
    if (serverMaxWindowBits != -1) {
        params.add(new WsExtensionParameter(SERVER_MAX_WINDOW_BITS,
                Integer.toString(serverMaxWindowBits)));
    }
    if (!clientContextTakeover) {
        params.add(new WsExtensionParameter(CLIENT_NO_CONTEXT_TAKEOVER, null));
    }
    if (clientMaxWindowBits != -1) {
        params.add(new WsExtensionParameter(CLIENT_MAX_WINDOW_BITS,
                Integer.toString(clientMaxWindowBits)));
    }

    return result;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:24,代码来源:PerMessageDeflate.java

示例3: append

import javax.websocket.Extension; //导入方法依赖的package包/类
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());
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:17,代码来源:UpgradeUtil.java

示例4: generateExtensionHeaders

import javax.websocket.Extension; //导入方法依赖的package包/类
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;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:19,代码来源:WsWebSocketContainer.java

示例5: getExtensionResponse

import javax.websocket.Extension; //导入方法依赖的package包/类
@Override
public Extension getExtensionResponse() {
	Extension result = new WsExtension(NAME);

	List<Extension.Parameter> params = result.getParameters();

	if (!serverContextTakeover) {
		params.add(new WsExtensionParameter(SERVER_NO_CONTEXT_TAKEOVER, null));
	}
	if (serverMaxWindowBits != -1) {
		params.add(new WsExtensionParameter(SERVER_MAX_WINDOW_BITS, Integer.toString(serverMaxWindowBits)));
	}
	if (!clientContextTakeover) {
		params.add(new WsExtensionParameter(CLIENT_NO_CONTEXT_TAKEOVER, null));
	}
	if (clientMaxWindowBits != -1) {
		params.add(new WsExtensionParameter(CLIENT_MAX_WINDOW_BITS, Integer.toString(clientMaxWindowBits)));
	}

	return result;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:22,代码来源:PerMessageDeflate.java

示例6: append

import javax.websocket.Extension; //导入方法依赖的package包/类
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());
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:17,代码来源:UpgradeUtil.java

示例7: generateExtensionHeaders

import javax.websocket.Extension; //导入方法依赖的package包/类
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);
            }
        }
    }
    return result;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:18,代码来源:WsWebSocketContainer.java

示例8: createTransformations

import javax.websocket.Extension; //导入方法依赖的package包/类
private static List<Transformation> createTransformations(
        List<Extension> negotiatedExtensions) {

    TransformationFactory factory = TransformationFactory.getInstance();

    LinkedHashMap<String,List<List<Extension.Parameter>>> extensionPreferences =
            new LinkedHashMap<String,List<List<Extension.Parameter>>>();

    // Result will likely be smaller than this
    List<Transformation> result = new ArrayList<Transformation>(negotiatedExtensions.size());

    for (Extension extension : negotiatedExtensions) {
        List<List<Extension.Parameter>> preferences =
                extensionPreferences.get(extension.getName());

        if (preferences == null) {
            preferences = new ArrayList<List<Extension.Parameter>>();
            extensionPreferences.put(extension.getName(), preferences);
        }

        preferences.add(extension.getParameters());
    }

    for (Map.Entry<String,List<List<Extension.Parameter>>> entry :
        extensionPreferences.entrySet()) {
        Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true);
        if (transformation != null) {
            result.add(transformation);
        }
    }
    return result;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:33,代码来源:UpgradeUtil.java

示例9: create

import javax.websocket.Extension; //导入方法依赖的package包/类
public Transformation create(String name, List<List<Extension.Parameter>> preferences,
        boolean isServer) {
    if (PerMessageDeflate.NAME.equals(name)) {
        return PerMessageDeflate.negotiate(preferences, isServer);
    }
    if (Constants.ALLOW_UNSUPPORTED_EXTENSIONS) {
        return null;
    } else {
        throw new IllegalArgumentException(
                sm.getString("transformerFactory.unsupportedExtension", name));
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:13,代码来源:TransformationFactory.java

示例10: createTransformations

import javax.websocket.Extension; //导入方法依赖的package包/类
private static List<Transformation> createTransformations(List<Extension> negotiatedExtensions) {

		TransformationFactory factory = TransformationFactory.getInstance();

		LinkedHashMap<String, List<List<Extension.Parameter>>> extensionPreferences = new LinkedHashMap<String, List<List<Extension.Parameter>>>();

		// Result will likely be smaller than this
		List<Transformation> result = new ArrayList<Transformation>(negotiatedExtensions.size());

		for (Extension extension : negotiatedExtensions) {
			List<List<Extension.Parameter>> preferences = extensionPreferences.get(extension.getName());

			if (preferences == null) {
				preferences = new ArrayList<List<Extension.Parameter>>();
				extensionPreferences.put(extension.getName(), preferences);
			}

			preferences.add(extension.getParameters());
		}

		for (Map.Entry<String, List<List<Extension.Parameter>>> entry : extensionPreferences.entrySet()) {
			Transformation transformation = factory.create(entry.getKey(), entry.getValue(), true);
			if (transformation != null) {
				result.add(transformation);
			}
		}
		return result;
	}
 
开发者ID:how2j,项目名称:lazycat,代码行数:29,代码来源:UpgradeUtil.java

示例11: create

import javax.websocket.Extension; //导入方法依赖的package包/类
public Transformation create(String name, List<List<Extension.Parameter>> preferences, boolean isServer) {
	if (PerMessageDeflate.NAME.equals(name)) {
		return PerMessageDeflate.negotiate(preferences, isServer);
	}
	if (Constants.ALLOW_UNSUPPORTED_EXTENSIONS) {
		return null;
	} else {
		throw new IllegalArgumentException(sm.getString("transformerFactory.unsupportedExtension", name));
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:11,代码来源:TransformationFactory.java

示例12: initParameters

import javax.websocket.Extension; //导入方法依赖的package包/类
private static Map<String, String> initParameters(Extension extension) {
	List<Extension.Parameter> parameters = extension.getParameters();
	Map<String, String> result = new LinkedCaseInsensitiveMap<String>(parameters.size(), Locale.ENGLISH);
	for (Extension.Parameter parameter : parameters) {
		result.put(parameter.getName(), parameter.getValue());
	}
	return result;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:StandardToWebSocketExtensionAdapter.java

示例13: createTransformations

import javax.websocket.Extension; //导入方法依赖的package包/类
private static List<Transformation> createTransformations(
        List<Extension> negotiatedExtensions) {

    TransformationFactory factory = TransformationFactory.getInstance();

    LinkedHashMap<String,List<List<Extension.Parameter>>> extensionPreferences =
            new LinkedHashMap<String,List<List<Extension.Parameter>>>();

    // Result will likely be smaller than this
    List<Transformation> result = new ArrayList<Transformation>(negotiatedExtensions.size());

    for (Extension extension : negotiatedExtensions) {
        List<List<Extension.Parameter>> preferences =
                extensionPreferences.get(extension.getName());

        if (preferences == null) {
            preferences = new ArrayList<List<Extension.Parameter>>();
            extensionPreferences.put(extension.getName(), preferences);
        }

        preferences.add(extension.getParameters());
    }

    for (Map.Entry<String,List<List<Extension.Parameter>>> entry :
        extensionPreferences.entrySet()) {
        Transformation transformation = factory.create(entry.getKey(), entry.getValue());
        if (transformation != null) {
            result.add(transformation);
        }
    }
    return result;
}
 
开发者ID:sdw2330976,项目名称:apache-tomcat-7.0.57,代码行数:33,代码来源:UpgradeUtil.java

示例14: create

import javax.websocket.Extension; //导入方法依赖的package包/类
public Transformation create(String name, List<List<Extension.Parameter>> preferences) {
    if (PerMessageDeflate.NAME.equals(name)) {
        return PerMessageDeflate.negotiate(preferences);
    }
    throw new IllegalArgumentException(
            sm.getString("transformerFactory.unsupportedExtension", name));
}
 
开发者ID:sdw2330976,项目名称:apache-tomcat-7.0.57,代码行数:8,代码来源:TransformationFactory.java


注:本文中的javax.websocket.Extension.Parameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。