Antonio Goncalves created FORGE-2395:
----------------------------------------
Summary: Being able to create new Websocket Client endpoints
Key: FORGE-2395
URL:
https://issues.jboss.org/browse/FORGE-2395
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.17.0.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
It would be good to be able to create a Websocket Client endpoint with the following
command :
{code}
websocket-new-client-endpoint --name MyClientEndpoint
{code}
This would generate the following code :
{code}
@ClientEndpoint
public class MyClientEndpoint {
}
{code}
As a shortcut (see [FORGE-2394]) we could easily implement basic methods such as :
{code}
websocket-new-client-endpoint --name MyClientEndpoint --methods ON_OPEN ON_CLOSE ON_ERROR
ON_MESSAGE
{code}
This would generate a client endpoint with the four following methods :
{code}
@ClientEndpoint
public class MyClientEndpoint {
@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}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)