[JBoss JIRA] (FORGE-2397) Being able to create new Websocket Server endpoints
by Antonio Goncalves (JIRA)
[ https://issues.jboss.org/browse/FORGE-2397?page=com.atlassian.jira.plugin... ]
Antonio Goncalves updated FORGE-2397:
-------------------------------------
Description:
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 {…
[View More]{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}
was:
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(CloseReason closeReason) {
}
@OnMessage
public void onMessage(String message, Session session) {
}
@OnError
public void onError(Throwable t) {
}
}
{code}
> 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
> 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}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
[View Less]