org.frameworkset.web.socket.handler.WebSocketToStandardExtensionAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bboss-websocket Show documentation
Show all versions of bboss-websocket Show documentation
bboss is a j2ee framework include aop/ioc,mvc,persistent,taglib,rpc,event ,bean-xml serializable and so on.http://www.bbossgroups.com
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