Apache Tomcat 7.0.54

org.apache.tomcat.websocket
Class WsRemoteEndpointImplBase

java.lang.Object
  extended by org.apache.tomcat.websocket.WsRemoteEndpointImplBase
All Implemented Interfaces:
RemoteEndpoint
Direct Known Subclasses:
WsRemoteEndpointImplClient, WsRemoteEndpointImplServer

public abstract class WsRemoteEndpointImplBase
extends Object
implements RemoteEndpoint


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.websocket.RemoteEndpoint
RemoteEndpoint.Async, RemoteEndpoint.Basic
 
Field Summary
static String BLOCKING_SEND_TIMEOUT_PROPERTY
           
 
Constructor Summary
WsRemoteEndpointImplBase()
           
 
Method Summary
 void close()
           
protected abstract  void doClose()
           
protected abstract  void doWrite(SendHandler handler, ByteBuffer... data)
           
 void flushBatch()
          Flush any currently batched messages to the remote endpoint.
 boolean getBatchingAllowed()
          Obtains the current batching status of the endpoint.
 OutputStream getSendStream()
           
 long getSendTimeout()
           
 Writer getSendWriter()
           
protected abstract  boolean isMasked()
           
 void sendBytes(ByteBuffer data)
           
 void sendBytesByCompletion(ByteBuffer data, SendHandler handler)
           
 Future<Void> sendBytesByFuture(ByteBuffer data)
           
 void sendObject(Object obj)
           
 void sendObjectByCompletion(Object obj, SendHandler completion)
           
 Future<Void> sendObjectByFuture(Object obj)
           
 void sendPartialBytes(ByteBuffer partialByte, boolean last)
           
 void sendPartialString(String fragment, boolean isLast)
           
 void sendPing(ByteBuffer applicationData)
          Send a ping message blocking until the message has been sent.
 void sendPong(ByteBuffer applicationData)
          Send a pong message blocking until the message has been sent.
 void sendString(String text)
           
 void sendStringByCompletion(String text, SendHandler handler)
           
 Future<Void> sendStringByFuture(String text)
           
 void setBatchingAllowed(boolean batchingAllowed)
          Enable or disable the batching of outgoing messages for this endpoint.
protected  void setEncoders(EndpointConfig endpointConfig)
           
 void setSendTimeout(long timeout)
           
protected  void setSession(WsSession wsSession)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCKING_SEND_TIMEOUT_PROPERTY

public static final String BLOCKING_SEND_TIMEOUT_PROPERTY
See Also:
Constant Field Values
Constructor Detail

WsRemoteEndpointImplBase

public WsRemoteEndpointImplBase()
Method Detail

getSendTimeout

public long getSendTimeout()

setSendTimeout

public void setSendTimeout(long timeout)

setBatchingAllowed

public void setBatchingAllowed(boolean batchingAllowed)
                        throws IOException
Description copied from interface: javax.websocket.RemoteEndpoint
Enable or disable the batching of outgoing messages for this endpoint. If batching is disabled when it was previously enabled then this method will block until any currently batched messages have been written.

Specified by:
setBatchingAllowed in interface RemoteEndpoint
Parameters:
batchingAllowed - New setting
Throws:
IOException - If changing the value resulted in a call to RemoteEndpoint.flushBatch() and that call threw an IOException.

getBatchingAllowed

public boolean getBatchingAllowed()
Description copied from interface: javax.websocket.RemoteEndpoint
Obtains the current batching status of the endpoint.

Specified by:
getBatchingAllowed in interface RemoteEndpoint

flushBatch

public void flushBatch()
                throws IOException
Description copied from interface: javax.websocket.RemoteEndpoint
Flush any currently batched messages to the remote endpoint. This method will block until the flush completes.

Specified by:
flushBatch in interface RemoteEndpoint
Throws:
IOException

sendBytes

public void sendBytes(ByteBuffer data)
               throws IOException
Throws:
IOException

sendBytesByFuture

public Future<Void> sendBytesByFuture(ByteBuffer data)

sendBytesByCompletion

public void sendBytesByCompletion(ByteBuffer data,
                                  SendHandler handler)

sendPartialBytes

public void sendPartialBytes(ByteBuffer partialByte,
                             boolean last)
                      throws IOException
Throws:
IOException

sendPing

public void sendPing(ByteBuffer applicationData)
              throws IOException,
                     IllegalArgumentException
Description copied from interface: javax.websocket.RemoteEndpoint
Send a ping message blocking until the message has been sent. Note that if a message is in the process of being sent asynchronously, this method will block until that message and this ping has been sent.

Specified by:
sendPing in interface RemoteEndpoint
Parameters:
applicationData - The payload for the ping message
Throws:
IOException
IllegalArgumentException

sendPong

public void sendPong(ByteBuffer applicationData)
              throws IOException,
                     IllegalArgumentException
Description copied from interface: javax.websocket.RemoteEndpoint
Send a pong message blocking until the message has been sent. Note that if a message is in the process of being sent asynchronously, this method will block until that message and this pong has been sent.

Specified by:
sendPong in interface RemoteEndpoint
Parameters:
applicationData - The payload for the pong message
Throws:
IOException
IllegalArgumentException

sendString

public void sendString(String text)
                throws IOException
Throws:
IOException

sendStringByFuture

public Future<Void> sendStringByFuture(String text)

sendStringByCompletion

public void sendStringByCompletion(String text,
                                   SendHandler handler)

sendPartialString

public void sendPartialString(String fragment,
                              boolean isLast)
                       throws IOException
Throws:
IOException

getSendStream

public OutputStream getSendStream()

getSendWriter

public Writer getSendWriter()

sendObject

public void sendObject(Object obj)
                throws IOException
Throws:
IOException

sendObjectByFuture

public Future<Void> sendObjectByFuture(Object obj)

sendObjectByCompletion

public void sendObjectByCompletion(Object obj,
                                   SendHandler completion)

setSession

protected void setSession(WsSession wsSession)

setEncoders

protected void setEncoders(EndpointConfig endpointConfig)
                    throws DeploymentException
Throws:
DeploymentException

close

public final void close()

doWrite

protected abstract void doWrite(SendHandler handler,
                                ByteBuffer... data)

isMasked

protected abstract boolean isMasked()

doClose

protected abstract void doClose()

Apache Tomcat 7.0.54

Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.