org.apache.wicket.protocol.ws.api
Class WebSocketRequestHandler

java.lang.Object
  extended by org.apache.wicket.protocol.ws.api.WebSocketRequestHandler
All Implemented Interfaces:
AjaxRequestTarget, IPageClassRequestHandler, IPageRequestHandler, IWebSocketRequestHandler, org.apache.wicket.request.ILoggableRequestHandler, org.apache.wicket.request.IRequestHandler

public class WebSocketRequestHandler
extends Object
implements AjaxRequestTarget, IWebSocketRequestHandler

An extension of AjaxRequestTarget that also supports pushing data from the server to the client.

Since:
6.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.wicket.ajax.AjaxRequestTarget
AjaxRequestTarget.AbstractListener, AjaxRequestTarget.IJavaScriptResponse, AjaxRequestTarget.IListener, AjaxRequestTarget.ITargetRespondListener
 
Constructor Summary
WebSocketRequestHandler(Component component, IWebSocketConnection connection)
           
 
Method Summary
 void add(Component... components)
           
 void add(Component component, String markupId)
           
 void addChildren(MarkupContainer parent, Class<?> childCriteria)
           
 void addListener(AjaxRequestTarget.IListener listener)
           
 void appendJavaScript(CharSequence javascript)
           
 void detach(org.apache.wicket.request.IRequestCycle requestCycle)
           
 void focusComponent(Component component)
           
 Collection<? extends Component> getComponents()
           
 IHeaderResponse getHeaderResponse()
           
 String getLastFocusedElementId()
           
 org.apache.wicket.request.ILogData getLogData()
           
 Page getPage()
           
 Class<? extends IRequestablePage> getPageClass()
           
 Integer getPageId()
           
 org.apache.wicket.request.mapper.parameter.PageParameters getPageParameters()
           
 Integer getRenderCount()
           
 boolean isPageInstanceCreated()
           
 void prependJavaScript(CharSequence javascript)
           
 void push(byte[] message, int offset, int length)
          Pushes a binary message to the client.
 void push(CharSequence message)
          Pushes a text message to the client.
 void registerRespondListener(AjaxRequestTarget.ITargetRespondListener listener)
           
 void respond(org.apache.wicket.request.IRequestCycle requestCycle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebSocketRequestHandler

public WebSocketRequestHandler(Component component,
                               IWebSocketConnection connection)
Method Detail

push

public void push(CharSequence message)
Description copied from interface: IWebSocketRequestHandler
Pushes a text message to the client.

Specified by:
push in interface IWebSocketRequestHandler
Parameters:
message - the text message to push to the client if the web socket connection is open

push

public void push(byte[] message,
                 int offset,
                 int length)
Description copied from interface: IWebSocketRequestHandler
Pushes a binary message to the client.

Specified by:
push in interface IWebSocketRequestHandler
Parameters:
message - the binary message to push to the client if the web socket connection is open
offset - the offset to start to read from the message
length - how many bytes to read from the message

add

public void add(Component component,
                String markupId)
Specified by:
add in interface AjaxRequestTarget

add

public void add(Component... components)
Specified by:
add in interface AjaxRequestTarget

addChildren

public final void addChildren(MarkupContainer parent,
                              Class<?> childCriteria)
Specified by:
addChildren in interface AjaxRequestTarget

addListener

public void addListener(AjaxRequestTarget.IListener listener)
Specified by:
addListener in interface AjaxRequestTarget

appendJavaScript

public void appendJavaScript(CharSequence javascript)
Specified by:
appendJavaScript in interface AjaxRequestTarget

prependJavaScript

public void prependJavaScript(CharSequence javascript)
Specified by:
prependJavaScript in interface AjaxRequestTarget

registerRespondListener

public void registerRespondListener(AjaxRequestTarget.ITargetRespondListener listener)
Specified by:
registerRespondListener in interface AjaxRequestTarget

getComponents

public Collection<? extends Component> getComponents()
Specified by:
getComponents in interface AjaxRequestTarget

focusComponent

public final void focusComponent(Component component)
Specified by:
focusComponent in interface AjaxRequestTarget

getHeaderResponse

public IHeaderResponse getHeaderResponse()
Specified by:
getHeaderResponse in interface AjaxRequestTarget

getLastFocusedElementId

public String getLastFocusedElementId()
Specified by:
getLastFocusedElementId in interface AjaxRequestTarget

getPage

public Page getPage()
Specified by:
getPage in interface AjaxRequestTarget
Specified by:
getPage in interface IPageRequestHandler

getPageId

public Integer getPageId()
Specified by:
getPageId in interface IPageRequestHandler

isPageInstanceCreated

public boolean isPageInstanceCreated()
Specified by:
isPageInstanceCreated in interface IPageRequestHandler

getRenderCount

public Integer getRenderCount()
Specified by:
getRenderCount in interface IPageRequestHandler

getLogData

public org.apache.wicket.request.ILogData getLogData()
Specified by:
getLogData in interface org.apache.wicket.request.ILoggableRequestHandler

getPageClass

public Class<? extends IRequestablePage> getPageClass()
Specified by:
getPageClass in interface IPageClassRequestHandler

getPageParameters

public org.apache.wicket.request.mapper.parameter.PageParameters getPageParameters()
Specified by:
getPageParameters in interface IPageClassRequestHandler

respond

public void respond(org.apache.wicket.request.IRequestCycle requestCycle)
Specified by:
respond in interface org.apache.wicket.request.IRequestHandler

detach

public void detach(org.apache.wicket.request.IRequestCycle requestCycle)
Specified by:
detach in interface org.apache.wicket.request.IRequestHandler


Copyright © 2006–2013 Apache Software Foundation. All rights reserved.