FileDocCategorySizeDatePackage
TCPAdapter.javaAPI DocExample7433Tue May 29 16:57:10 BST 2007com.sun.xml.ws.transport.tcp.server

TCPAdapter

public class TCPAdapter extends com.sun.xml.ws.api.server.Adapter
author
Alexey Stashok

Fields Summary
private static final Logger
logger
final String
name
final String
urlPattern
public static final com.sun.xml.ws.transport.http.DeploymentDescriptorParser.AdapterFactory
FACTORY
Constructors Summary
public TCPAdapter(String name, String urlPattern, com.sun.xml.ws.api.server.WSEndpoint endpoint)

    
                 
        super(endpoint);
        this.name = name;
        this.urlPattern = urlPattern;
    
Methods Summary
protected com.sun.xml.ws.transport.tcp.server.TCPAdapter$TCPToolkitcreateToolkit()

        return new TCPToolkit();
    
public java.lang.StringgetValidPath()
Returns the "/abc/def/ghi" portion if the URL pattern is "/abc/def/ghi/*".

        if (urlPattern.endsWith("/*")) {
            return urlPattern.substring(0, urlPattern.length() - 2);
        } else {
            return urlPattern;
        }
    
public voidhandle(com.sun.xml.ws.transport.tcp.util.ChannelContext channelContext)

        final TCPConnectionImpl connection = new TCPConnectionImpl(channelContext);
        
        final TCPToolkit tk = pool.take();
        try {
            tk.handle(connection);
            connection.flush();
        } finally {
            pool.recycle(tk);
            connection.close();
        }
    
public static voidsendErrorResponse(com.sun.xml.ws.transport.tcp.util.ChannelContext channelContext, com.sun.xml.ws.transport.tcp.util.WSTCPError message)

        final TCPConnectionImpl connection = new TCPConnectionImpl(channelContext);
        connection.sendErrorMessage(message);