org.apache.wicket.protocol.ws.api.message.TextMessage Java Examples

The following examples show how to use org.apache.wicket.protocol.ws.api.message.TextMessage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractWebSocketProcessor.java    From onedev with MIT License 5 votes vote down vote up
@SuppressWarnings("rawtypes")
private WebSocketPayload createEventPayload(IWebSocketMessage message, WebSocketRequestHandler handler)
{
	final WebSocketPayload payload;
	if (message instanceof TextMessage)
	{
		payload = new WebSocketTextPayload((TextMessage) message, handler);
	}
	else if (message instanceof BinaryMessage)
	{
		payload = new WebSocketBinaryPayload((BinaryMessage) message, handler);
	}
	else if (message instanceof ConnectedMessage)
	{
		payload = new WebSocketConnectedPayload((ConnectedMessage) message, handler);
	}
	else if (message instanceof ClosedMessage)
	{
		payload = new WebSocketClosedPayload((ClosedMessage) message, handler);
	}
	else if (message instanceof AbortedMessage)
	{
		payload = new WebSocketAbortedPayload((AbortedMessage) message, handler);
	}
	else if (message instanceof IWebSocketPushMessage)
	{
		payload = new WebSocketPushPayload((IWebSocketPushMessage) message, handler);
	}
	else
	{
		throw new IllegalArgumentException("Unsupported message type: " + message.getClass().getName());
	}
	return payload;
}
 
Example #2
Source File: AbstractWebSocketProcessor.java    From onedev with MIT License 4 votes vote down vote up
@Override
public void onMessage(final String message)
{
	broadcastMessage(new TextMessage(message));
}