Fixing up javadoc issues in WebSocket classes

This commit is contained in:
Joakim Erdfelt 2013-08-14 10:54:07 -07:00
parent 34032552ea
commit e39b48c90d
50 changed files with 80 additions and 69 deletions

View File

@ -27,6 +27,7 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import javax.websocket.ClientEndpoint;
import javax.websocket.ClientEndpointConfig;
import javax.websocket.DeploymentException;
@ -85,21 +86,6 @@ public class ClientContainer extends ContainerLifeCycle implements WebSocketCont
addBean(client);
}
@Override
protected void doStart() throws Exception
{
super.doStart();
ShutdownThread.register(client);
}
@Override
protected void doStop() throws Exception
{
endpointClientMetadataCache.clear();
ShutdownThread.deregister(client);
super.doStop();
}
private Session connect(EndpointInstance instance, URI path) throws IOException
{
Objects.requireNonNull(instance,"EndpointInstance cannot be null");
@ -178,6 +164,21 @@ public class ClientContainer extends ContainerLifeCycle implements WebSocketCont
return connect(instance,path);
}
@Override
protected void doStart() throws Exception
{
super.doStart();
ShutdownThread.register(client);
}
@Override
protected void doStop() throws Exception
{
endpointClientMetadataCache.clear();
ShutdownThread.deregister(client);
super.doStop();
}
public EndpointMetadata getClientEndpointMetadata(Class<?> endpoint)
{
EndpointMetadata metadata = null;
@ -272,8 +273,6 @@ public class ClientContainer extends ContainerLifeCycle implements WebSocketCont
/**
* Used in {@link Session#getOpenSessions()}
*
* @return
*/
public Set<Session> getOpenSessions()
{

View File

@ -18,7 +18,8 @@
package org.eclipse.jetty.websocket.jsr356;
import javax.websocket.Decoder;
import javax.websocket.Decoder.BinaryStream;
import javax.websocket.Decoder.TextStream;
import javax.websocket.MessageHandler;
import javax.websocket.MessageHandler.Partial;
import javax.websocket.MessageHandler.Whole;
@ -26,7 +27,7 @@ import javax.websocket.MessageHandler.Whole;
import org.eclipse.jetty.websocket.jsr356.metadata.MessageHandlerMetadata;
/**
* Expose a {@link MessageHandler} instance along with its associated {@link MessageHandlerMetadata} and {@link DecoderWrapper}
* Expose a {@link MessageHandler} instance along with its associated {@link MessageHandlerMetadata} and {@link DecoderFactory.Wrapper}
*/
public class MessageHandlerWrapper
{
@ -74,8 +75,7 @@ public class MessageHandlerWrapper
}
/**
* Flag for a onMessage() method that wants MessageHandler.{@link Whole} with a Decoder that is based on {@link Decoder.TextStream} or
* {@link Decoder.BinaryStream}
* Flag for a onMessage() method that wants MessageHandler.{@link Whole} with a Decoder that is based on {@link TextStream} or {@link BinaryStream}
*
* @return true for Streaming based Decoder, false for normal decoder for whole messages.
*/

View File

@ -49,7 +49,7 @@ public interface IJsrMethod
/**
* The type of message this method can handle
*
* @return the message type if &#064;{@link OnMessage} annotated, {@link MessageType#UNKNOWN} if unknown/unspecified
* @return the message type if &#064;{@link OnMessage} annotated, null if unknown/unspecified
*/
MessageType getMessageType();

View File

@ -18,11 +18,13 @@
package org.eclipse.jetty.websocket.jsr356.annotations;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Binary;
import javax.websocket.OnMessage;
import org.eclipse.jetty.websocket.jsr356.JsrSession;
@ -33,7 +35,7 @@ import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role;
* <p>
* Not for use with {@link InputStream} based {@link OnMessage} method objects.
*
* @see Decoder.Binary
* @see Binary
*/
public class OnMessageBinaryCallable extends OnMessageCallable
{

View File

@ -18,12 +18,14 @@
package org.eclipse.jetty.websocket.jsr356.annotations;
//import java.io.IOException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.BinaryStream;
import javax.websocket.OnMessage;
import org.eclipse.jetty.websocket.jsr356.JsrSession;
@ -32,7 +34,7 @@ import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role;
/**
* Callable for {@link OnMessage} annotated methods for {@link InputStream} based binary message objects
*
* @see Decoder.BinaryStream
* @see BinaryStream
*/
public class OnMessageBinaryStreamCallable extends OnMessageCallable
{

View File

@ -23,6 +23,7 @@ import java.lang.reflect.Method;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Text;
import javax.websocket.OnMessage;
import org.eclipse.jetty.websocket.jsr356.JsrSession;
@ -33,7 +34,7 @@ import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role;
* <p>
* Not for use with {@link Reader} based {@link OnMessage} method objects.
*
* @see Decoder.Text
* @see Text
*/
public class OnMessageTextCallable extends OnMessageCallable
{

View File

@ -24,6 +24,7 @@ import java.lang.reflect.Method;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.TextStream;
import javax.websocket.OnMessage;
import org.eclipse.jetty.websocket.jsr356.JsrSession;
@ -32,7 +33,7 @@ import org.eclipse.jetty.websocket.jsr356.annotations.Param.Role;
/**
* Callable for {@link OnMessage} annotated methods for {@link Reader} based text message objects
*
* @see Decoder.TextStream
* @see TextStream
*/
public class OnMessageTextStreamCallable extends OnMessageCallable
{

View File

@ -20,6 +20,8 @@ package org.eclipse.jetty.websocket.jsr356.decoders;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Text;
/**
* Default implementation of the {@link Text} Message to {@link Boolean} decoder.

View File

@ -20,6 +20,8 @@ package org.eclipse.jetty.websocket.jsr356.decoders;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Text;
/**
* Default implementation of the {@link Text} Message to {@link Byte} decoder

View File

@ -20,6 +20,8 @@ package org.eclipse.jetty.websocket.jsr356.decoders;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Text;
/**
* Default implementation of the {@link Text} Message to {@link Character} decoder

View File

@ -20,6 +20,8 @@ package org.eclipse.jetty.websocket.jsr356.decoders;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Text;
/**
* Default implementation of the {@link Text} Message to {@link Double} to decoder

View File

@ -20,6 +20,8 @@ package org.eclipse.jetty.websocket.jsr356.decoders;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Text;
/**
* Default implementation of the {@link Text} Message to {@link Integer} decoder

View File

@ -20,6 +20,8 @@ package org.eclipse.jetty.websocket.jsr356.decoders;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Text;
/**
* Default implementation of the {@link Text} Message to {@link Short} decoder

View File

@ -20,6 +20,8 @@ package org.eclipse.jetty.websocket.jsr356.decoders;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.Decoder.Text;
/**
* Default implementation of the {@link Text} Message to {@link String} decoder

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.Encoder.Text;
/**
* Default encoder for {@link Boolean} to {@link Text} Message encoder

View File

@ -19,6 +19,7 @@
package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder.Text;
import javax.websocket.Encoder;
/**

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.Encoder.Text;
/**
* Default encoder for {@link Character} to {@link Text} Message encoder

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.Encoder.Text;
/**
* Default encoder for {@link Double} to {@link Text} Message encoder

View File

@ -20,7 +20,7 @@ package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.Encoder.Text;
/**
* Default encoder for {@link Float} to {@link Text} Message encoder
*/

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.Encoder.Text;
/**
* Default encoder for {@link Integer} to {@link Text} Message encoder

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.Encoder.Text;
/**
* Default encoder for {@link Long} to {@link Text} Message encoder

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.Encoder.Text;
/**
* Default encoder for {@link Short} to {@link Text} Message encoder

View File

@ -20,6 +20,7 @@ package org.eclipse.jetty.websocket.jsr356.encoders;
import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.Encoder.Text;
/**
* Default encoder for {@link String} to {@link Text} Message encoder

View File

@ -26,7 +26,7 @@ import java.util.Map;
import javax.websocket.CloseReason;
import javax.websocket.DecodeException;
import javax.websocket.MessageHandler;
import javax.websocket.MessageHandler.Whole;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.log.Log;
@ -142,7 +142,7 @@ public class JsrAnnotatedEventDriver extends AbstractJsrEventDriver implements E
}
/**
* Entry point for binary frames destined for {@link MessageHandler#Whole}
* Entry point for binary frames destined for {@link Whole}
*/
@Override
public void onBinaryMessage(byte[] data)

View File

@ -26,6 +26,7 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.websocket.ClientEndpointConfig;
import javax.websocket.ClientEndpointConfig.Configurator;
import javax.websocket.ContainerProvider;
import javax.websocket.HandshakeResponse;
import javax.websocket.Session;
@ -40,7 +41,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
/**
* Tests of {@link ClientEndpointConfig.Configurator}
* Tests of {@link Configurator}
*/
public class ConfiguratorTest
{

View File

@ -58,7 +58,7 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
/**
* Test {@link JsrAnnotatedClientScanner} against various valid, simple, 1 method annotated classes with valid signatures.
* Test {@link AnnotatedEndpointScanner} against various valid, simple, 1 method {@link ClientEndpoint} annotated classes with valid signatures.
*/
@RunWith(Parameterized.class)
public class ClientAnnotatedEndpointScanner_GoodSignaturesTest

View File

@ -52,7 +52,7 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
/**
* Test {@link JsrAnnotatedClientScanner} against various simple, single method annotated classes with invalid signatures.
* Test {@link AnnotatedEndpointScanner} against various simple, 1 method, {@link ClientEndpoint} annotated classes with invalid signatures.
*/
@RunWith(Parameterized.class)
public class ClientAnnotatedEndpointScanner_InvalidSignaturesTest

View File

@ -76,7 +76,7 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
/**
* Test {@link JsrAnnotatedServerScanner} against various valid, simple, 1 method annotated classes with valid signatures.
* Test {@link AnnotatedEndpointScanner} against various simple, 1 method {@link ServerEndpoint} annotated classes with valid signatures.
*/
@RunWith(Parameterized.class)
public class ServerAnnotatedEndpointScanner_GoodSignaturesTest

View File

@ -51,7 +51,7 @@ import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
/**
* Test {@link JsrAnnotatedServerScanner} against various simple, single method annotated classes with invalid signatures.
* Test {@link AnnotatedEndpointScanner} against various simple, 1 method {@link ServerEndpoint} annotated classes with invalid signatures.
*/
@RunWith(Parameterized.class)
public class ServerAnnotatedEndpointScanner_InvalidSignaturesTest

View File

@ -20,7 +20,7 @@ package org.eclipse.jetty.websocket.api;
/**
* Exception to terminate the connection because it has received data within a frame payload that was not consistent with the requirements of that frame
* payload. (eg: not UTF-8 in a text frame, or a bad data seen in the {@link PerMessageCompressionExtension})
* payload. (eg: not UTF-8 in a text frame, or a unexpected data seen by an extension)
*
* @see StatusCode#BAD_PAYLOAD
*/

View File

@ -18,6 +18,8 @@
package org.eclipse.jetty.websocket.api;
import org.eclipse.jetty.websocket.api.annotations.WebSocket;
/**
* Indicating that the provided Class is not a valid WebSocket as defined by the API.
* <p>

View File

@ -163,8 +163,6 @@ public class UpgradeResponse
/**
* Set the list of extensions that are approved for use with this websocket.
* <p>
* This is Advanced usage of the {@link WebSocketCreator} to allow for a custom set of negotiated extensions.
* <p>
* Notes:
* <ul>
* <li>Per the spec you cannot add extensions that have not been seen in the {@link UpgradeRequest}, just remove entries you don't want to use</li>

View File

@ -38,7 +38,7 @@ public interface WebSocketListener
/**
* A Close Event was received.
* <p>
* The underlying {@link WebSocketConnection} will be considered closed at this point.
* The underlying Connection will be considered closed at this point.
*
* @param statusCode
* the close status code. (See {@link StatusCode})

View File

@ -196,8 +196,6 @@ public class WebSocketPolicy
/**
* Get the maximum size of a binary message buffer (for streaming writing)
* <p>
* Note: Cannot be greater than {@link #getMaxBinaryMessageSize()}
*
* @return the maximum size of a binary message buffer
*/
@ -220,8 +218,6 @@ public class WebSocketPolicy
/**
* Get the maximum size of a text message buffer (for streaming writing)
* <p>
* Note: Cannot be greater than {@link #maxTextMessageSize}
*
* @return the maximum size of a text message buffer
*/

View File

@ -21,7 +21,7 @@ package org.eclipse.jetty.websocket.api.extensions;
/**
* Interface for WebSocket Extensions.
* <p>
* That work is performed by the two {@link FrameHandler} implementations for incoming and outgoing frame handling.
* That {@link Frame}s are passed through the Extension via the {@link IncomingFrames} and {@link OutgoingFrames} interfaces
*/
public interface Extension extends IncomingFrames, OutgoingFrames
{

View File

@ -108,7 +108,7 @@ public class ExtensionConfig
}
/**
* Return parameters in way similar to how {@link javax.net.websocket.extensions.Extension#getParameters()} works.
* Return parameters found in request URI.
*
* @return the parameter map
*/

View File

@ -342,7 +342,6 @@ public class QuoteUtil
* the string to possibly quote
* @param delim
* the delimiter characters that will trigger automatic quoting
* @throws IOException
*/
public static void quoteIfNeeded(StringBuilder buf, String str, String delim)
{

View File

@ -372,7 +372,7 @@ public class WebSocketClient extends ContainerLifeCycle
/**
* @return the {@link SslContextFactory} that manages TLS encryption
* @see WebSocketClient(SslContextFactory)
* @see #WebSocketClient(SslContextFactory)
*/
public SslContextFactory getSslContextFactory()
{

View File

@ -19,15 +19,15 @@
/**
* Jetty WebSocket Client API
* <p>
* The core class is {@link WebSocketClient}, which acts as a central configuration object (for example
* for {@link WebSocketClient#setConnectTimeout(int) connect timeouts}, {@link WebSocketClient#setCookieStore(CookieStore)
* The core class is {@link org.eclipse.jetty.websocket.client.WebSocketClient}, which acts as a central configuration object (for example
* for {@link org.eclipse.jetty.websocket.client.WebSocketClient#setConnectTimeout(int) connect timeouts}, {@link WebSocketClient#setCookieStore(CookieStore)
* request cookie store}, etc.) and as a factory for WebSocket {@link org.eclipse.jetty.websocket.api.Session} objects.
* <p>
* The <a href="https://tools.ietf.org/html/rfc6455">WebSocket protocol</a> is based on a framing protocol built
* around an upgraded HTTP connection. It is primarily focused on the sending of messages (text or binary), with an
* occasional control frame (close, ping, pong) that this implementation uses.
* <p />
* {@link WebSocketClient} holds a number of {@link org.eclipse.jetty.websocket.api.Session Sessions}, which in turn
* {@link org.eclipse.jetty.websocket.client.WebSocketClient} holds a number of {@link org.eclipse.jetty.websocket.api.Session Sessions}, which in turn
* is used to manage physical vs virtual connection handling (mux extension).
*/
package org.eclipse.jetty.websocket.client;

View File

@ -19,6 +19,7 @@
package org.eclipse.jetty.websocket.common;
import org.eclipse.jetty.websocket.common.io.IOState;
import org.eclipse.jetty.websocket.common.io.IOState.ConnectionStateListener;
/**
* Connection states as outlined in <a href="https://tools.ietf.org/html/rfc6455">RFC6455</a>.
@ -47,7 +48,7 @@ public enum ConnectionState
* <p>
* This can be considered a half-closed state.
* <p>
* When receiving this as an event on {@link IOState.ConnectionStateListener#onConnectionStateChange(ConnectionState)} a close frame should be sent using
* When receiving this as an event on {@link ConnectionStateListener#onConnectionStateChange(ConnectionState)} a close frame should be sent using
* the {@link CloseInfo} available from {@link IOState#getCloseInfo()}
*/
CLOSING,

View File

@ -61,13 +61,11 @@ public interface LogicalConnection extends OutgoingFrames, SuspendToken
/**
* Get the ByteBufferPool in use by the connection
* @return
*/
ByteBufferPool getBufferPool();
/**
* Get the Executor used by this connection.
* @return
*/
Executor getExecutor();
@ -167,8 +165,6 @@ public interface LogicalConnection extends OutgoingFrames, SuspendToken
/**
* Suspend a the incoming read events on the connection.
*
* @return
*/
SuspendToken suspend();
}

View File

@ -23,7 +23,7 @@ import java.net.URI;
import org.eclipse.jetty.websocket.common.events.EventDriver;
/**
* Interface for creating jetty {@link MutableSession} objects.
* Interface for creating jetty {@link WebSocketSession} objects.
*/
public interface SessionFactory
{

View File

@ -132,8 +132,8 @@ public class WebSocketFrame implements Frame
/**
* Copy constructor for the websocket frame.
*
* @param copy
* the websocket to copy.
* @param frame
* the websocket frame to copy.
*/
public WebSocketFrame(Frame frame)
{

View File

@ -373,8 +373,6 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Inc
/**
* Open/Activate the session
*
* @throws IOException
*/
public void open()
{

View File

@ -20,8 +20,6 @@ package org.eclipse.jetty.websocket.common.events.annotated;
/**
* A representation of the methods available to call for a particular class.
* <p>
* This class used to cache the method lookups via the {@link EventMethodsCache}
*/
public class EventMethods
{

View File

@ -59,7 +59,7 @@ import org.eclipse.jetty.websocket.common.WebSocketSession;
import org.eclipse.jetty.websocket.common.io.IOState.ConnectionStateListener;
/**
* Provides the implementation of {@link WebSocketConnection} within the framework of the new {@link Connection} framework of jetty-io
* Provides the implementation of {@link LogicalConnection} within the framework of the new {@link Connection} framework of jetty-io
*/
public abstract class AbstractWebSocketConnection extends AbstractConnection implements LogicalConnection, ConnectionStateListener
{

View File

@ -72,8 +72,6 @@ public class WriteBytesProvider implements Callback
/**
* Indicate that the frame entry is done generating
*
* @return
*/
public boolean isDone()
{

View File

@ -30,7 +30,6 @@ public interface WebSocketHandshake
*
* @param request
* @param response
* @param acceptedSubProtocol
*/
public void doHandshakeResponse(ServletUpgradeRequest request, ServletUpgradeResponse response) throws IOException;
}

View File

@ -49,8 +49,6 @@ import org.junit.runner.RunWith;
/**
* Test various <a href="http://tools.ietf.org/html/rfc6455">RFC 6455</a> specified requirements placed on {@link WebSocketServlet}
* <p>
* This test serves a different purpose than than the {@link WebSocketMessageRFC6455Test}, and {@link WebSocketParserRFC6455Test} tests.
*/
@RunWith(AdvancedRunner.class)
public class WebSocketServletRFCTest

View File

@ -32,7 +32,7 @@ import org.eclipse.jetty.websocket.api.annotations.WebSocket;
/**
* Abstract Servlet used to bridge the Servlet API to the WebSocket API.
* <p>
* To use this servlet, you will be required to register your websockets with the {@link WebSocketServerFactory} so that it can create your websockets under the
* To use this servlet, you will be required to register your websockets with the {@link WebSocketServletFactory} so that it can create your websockets under the
* appropriate conditions.
* <p>
* The most basic implementation would be as follows.
@ -56,7 +56,7 @@ import org.eclipse.jetty.websocket.api.annotations.WebSocket;
* }
* </pre>
*
* Note: that only request that conforms to a "WebSocket: Upgrade" handshake request will trigger the {@link WebSocketServerFactory} handling of creating
* Note: that only request that conforms to a "WebSocket: Upgrade" handshake request will trigger the {@link WebSocketServletFactory} handling of creating
* WebSockets.<br>
* All other requests are treated as normal servlet requests.
*