Package javax.websocket

Skip navigation links

Overview
Package
Class
Use
Tree
Deprecated
Index
Help

Prev Package
Next Package

Frames
No Frames

Package javax.websocket
This package contains all the WebSocket APIs common to both the client and server side.

See: Description

Interface Summary Interface 	Description
ClientEndpointConfig 	
The ClientEndpointConfig is a special kind of endpoint configuration object that contains web socket configuration information specific only to client endpoints.
CloseReason.CloseCode 	
A marker interface for the close codes.
Decoder 	
The Decoder interface holds member interfaces that define how a developer can provide the web socket container a way web socket messages into developer defined custom objects.
Decoder.Binary<T> 	
This interface defines how a custom object (of type T) is decoded from a web socket message in the form of a byte buffer.
Decoder.BinaryStream<T> 	
This interface defines how a custom object is decoded from a web socket message in the form of a binary stream.
Decoder.Text<T> 	
This interface defines how a custom object is decoded from a web socket message in the form of a string.
Decoder.TextStream<T> 	
This interface defines how a custom object of type T is decoded from a web socket message in the form of a character stream.
Encoder 	
The Encoder interface defines how developers can provide a way to convert their custom objects into web socket messages.
Encoder.Binary<T> 	
This interface defines how to provide a way to convert a custom object into a binary message.
Encoder.BinaryStream<T> 	
This interface may be implemented by encoding algorithms that want to write the encoded object to a binary stream.
Encoder.Text<T> 	
This interface defines how to provide a way to convert a custom object into a text message.
Encoder.TextStream<T> 	
This interface may be implemented by encoding algorithms that want to write the encoded object to a character stream.
EndpointConfig 	
The endpoint configuration contains all the information needed during the handshake process for this end point.
Extension 	
A simple representation of a websocket extension as a name and map of extension parameters.
Extension.Parameter 	
This member interface defines a single websocket extension parameter.
HandshakeResponse 	
The handshake response represents the web socket-defined Http response that is the response to the opening handshake request.
MessageHandler 	
Developers implement MessageHandlers in order to receive incoming messages during a web socket conversation.
MessageHandler.Partial<T> 	
This kind of handler is notified by the implementation as it becomes ready to deliver parts of a whole message.
MessageHandler.Whole<T> 	
This kind of handler is notified by the container on arrival of a complete message.
PongMessage 	
The PongMessage interface represents a web socket pong.
RemoteEndpoint 	
The RemoteEndpoint object is supplied by the container and represents the 'other end' or peer of the Web Socket conversation.
RemoteEndpoint.Async 	
This representation of the peer of a web socket conversation has the ability to send messages asynchronously.
RemoteEndpoint.Basic 	
This representation of the peer of a web socket conversation has the ability to send messages synchronously.
SendHandler 	
A simple callback object for asynchronous sending of web socket messages.
Session 	
A Web Socket session represents a conversation between two web socket endpoints.
WebSocketContainer 	
A WebSocketContainer is an implementation provided object that provides applications a view on the container running it.
Class Summary Class 	Description
ClientEndpointConfig.Builder 	
The ClientEndpointConfig.Builder is a class used for creating ClientEndpointConfig objects for the purposes of deploying a client endpoint.
ClientEndpointConfig.Configurator 	
The Configurator class may be extended by developers who want to provide custom configuration algorithms, such as intercepting the opening handshake, or providing arbitrary methods and algorithms that can be accessed from each endpoint instance configured with this configurator.
CloseReason 	
A class encapsulating the reason why a web socket has been closed, or why it is being asked to close.
ContainerProvider 	
Provider class that allows the developer to get a reference to the implementation of the WebSocketContainer.
Endpoint 	
The Web Socket Endpoint represents an object that can handle websocket conversations.
SendResult 	
The result of asynchronously sending a web socket message.
Enum Summary Enum 	Description
CloseReason.CloseCodes 	
An Enumeration of status codes for a web socket close that are defined in the specification.
Exception Summary Exception 	Description
DecodeException 	
A general exception that occurs when trying to decode a custom object from a text or binary message.
DeploymentException 	
Checked exception indicating some kind of failure either to publish an endpoint on its server, or a failure to connect a client to its server.
EncodeException 	
A general exception that occurs when trying to encode a custom object to a string or binary message.
SessionException 	
A SessionException represents a general exception type reporting problems occurring on a websocket session.
Annotation Types Summary Annotation Type 	Description
ClientEndpoint 	
The ClientEndpoint annotation a class level annotation is used to denote that a POJO is a web socket client and can be deployed as such.
OnClose 	
This method level annotation can be used to decorate a Java method that wishes to be called when a web socket session is closing.
OnError 	
This method level annotation can be used to decorate a Java method that wishes to be called in order to handle errors.
OnMessage 	
This method level annotation can be used to make a Java method receive incoming web socket messages.
OnOpen 	
This method level annotation can be used to decorate a Java method that wishes to be called when a new web socket session is open.

Package javax.websocket Description
This package contains all the WebSocket APIs common to both the client and server side.
Skip navigation links

Overview
Package
Class
Use
Tree
Deprecated
Index
Help

Prev Package
Next Package

Frames
No Frames

Copyright © 1996-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.

javax.websocketJava EE规范中的一部分,用于支持基于WebSocket协议的实时双向通信。WebSocket是HTML5中新增的一种协议,通过在单个 TCP 连接上提供全双工、双向通信,使得服务器与客户端之间可以实时地交换数据。 javax.websocket定义了一套API,用于开发WebSocket应用程序。它提供了WebSocket通信的必要组件和接口,包括Endpoint、Session、Message等。开发者可以使用这些接口和类来创建WebSocket服务器和客户端,并实现消息的发送和接收。 在WebSocket通信中,有两个主要的角色:服务器和客户端。服务器负责监听和接受客户端的连接请求,然后与客户端建立WebSocket连接。而客户端则负责向服务器发起连接请求,并与服务器建立WebSocket连接。一旦建立了连接,服务器和客户端可以通过发送和接收消息来进行实时的双向通信。 javax.websocket提供了一系列的注解和接口,方便开发者使用。其中,@ServerEndpoint和@ClientEndpoint注解分别用于标识服务器和客户端的WebSocket端点。开发者可以通过实现Endpoint接口,并在类上添加相应的注解,来创建WebSocket服务器和客户端。 使用javax.websocket开发WebSocket应用程序,可以实现实时通信功能,如聊天室、在线游戏、即时通讯等。它具有跨平台的特性,可以在不同的操作系统和浏览器上运行。此外,javax.websocket还提供了一些用于处理连接、消息、错误等事件的回调方法,方便开发者处理各种情况。 总之,javax.websocketJava EE规范中支持WebSocket通信的API,它提供了一套接口和类,方便开发者创建WebSocket服务器和客户端,并实现实时的双向通信。它是实现实时通信功能的一种重要工具。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值