io.micronaut.starter.cli.feature.server.websocket.groovyWebsocketServer.rocker.raw Maven / Gradle / Ivy
@import io.micronaut.starter.application.Project
@args (
Project project
)
@if (project.getPackageName() != null) {
package @project.getPackageName()
}
import io.micronaut.websocket.WebSocketBroadcaster
import io.micronaut.websocket.annotation.OnClose
import io.micronaut.websocket.annotation.OnMessage
import io.micronaut.websocket.annotation.OnOpen
import io.micronaut.websocket.annotation.ServerWebSocket
@@ServerWebSocket("/@project.getPropertyName()/{topic}")
class @project.getClassName()Server {
private WebSocketBroadcaster broadcaster
@project.getClassName()Server(WebSocketBroadcaster broadcaster) {
this.broadcaster = broadcaster
}
@@OnOpen
void onOpen() {}
@@OnMessage
void onMessage() {}
@@OnClose
void onClose() {}
}