]
Work on FORGE-2397 started by Antonio Goncalves.
------------------------------------------------
Being able to create new Websocket Server endpoints
---------------------------------------------------
Key: FORGE-2397
URL:
https://issues.jboss.org/browse/FORGE-2397
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.17.0.Final
Reporter: Antonio Goncalves
Assignee: Antonio Goncalves
Labels: starter
Fix For: 2.x Future
It would be good to be able to create a Websocket Server endpoint with the following
command :
{code}
websocket-new-server-endpoint --name MyServerEndpoint
{code}
This would generate the following code with the default URI {{myServer}}:
{code}
@ServerEndpoint("/myServer")
public class MyServerEndpoint {
}
{code}
A {{uri}} parameter would allow to customize the URI of the endpoint
{code}
websocket-new-server-endpoint --name MyServerEndpoint --uri abc
{code}
This would generate the following code with a {{abc}} URI:
{code}
@ServerEndpoint("/abc")
public class MyServerEndpoint {
}
{code}
As a shortcut (see [FORGE-2394] we could easily implement basic methods such as :
{code}
websocket-new-server-endpoint --name MyServerEndpoint --uri abc --methods ON_OPEN
ON_CLOSE ON_ERROR ON_MESSAGE
{code}
This would generate a server endpoint with the four following methods :
{code}
@ServerEndpoint("/abc")
public class MyServerEndpoint {
@OnOpen
public void onOpen(Session session) {
}
@OnClose
public void onClose(Session session, CloseReason closeReason) {
}
@OnMessage
public void onMessage(Session session, String message) {
}
@OnError
public void onError(Throwable t) {
}
}
{code}