All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.frameworkset.web.socket.handler.WebSocketToStandardExtensionAdapter Maven / Gradle / Ivy

Go to download

bboss is a j2ee framework include aop/ioc,mvc,persistent,taglib,rpc,event ,bean-xml serializable and so on.http://www.bbossgroups.com

There is a newer version: 6.2.7
Show newest version
package org.frameworkset.web.socket.handler;

import java.util.ArrayList;
import java.util.List;

import javax.websocket.Extension;

import org.frameworkset.web.socket.inf.WebSocketExtension;
/**
 * Adapt an instance of {@link WebSocketExtension} to
 * the {@link javax.websocket.Extension} interface.
 *
 * @author Rossen Stoyanchev
 * @since 4.0
 */
public class WebSocketToStandardExtensionAdapter  implements Extension {

	private final String name;

	private final List parameters = new ArrayList();


	public WebSocketToStandardExtensionAdapter(final WebSocketExtension extension) {
		this.name = extension.getName();
		for (final String paramName : extension.getParameters().keySet()) {
			this.parameters.add(new Parameter() {
				@Override
				public String getName() {
					return paramName;
				}
				@Override
				public String getValue() {
					return extension.getParameters().get(paramName);
				}
			});
		}
	}

	@Override
	public String getName() {
		return this.name;
	}

	@Override
	public List getParameters() {
		return this.parameters;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy