webwork.action.client
Class ClientDispatcher

java.lang.Object
  extended bywebwork.action.client.ClientDispatcher

public class ClientDispatcher
extends java.lang.Object

The ClientDispatcher is used by remote clients to execute actions on a server running WebWork.

Author:
Rickard Öberg (rickard@dreambean.com)

Field Summary
static java.lang.String DISPATCHER
          Standard dispatcher servlet URL
 
Constructor Summary
ClientDispatcher(java.applet.Applet anApplet, java.lang.String context)
          Create a new dispatcher with an applet providing the URL.
ClientDispatcher(java.lang.String aHost)
          Create a new dispatcher.
 
Method Summary
protected  java.io.ObjectInputStream createObjectInputStream(java.io.InputStream in)
          Create an object input stream that wraps the URL connection stream.
protected  java.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream out)
          Create an object input stream that wraps the URL connection stream.
 ActionResult execute(Action anAction)
          Execute the action on the server.
 java.lang.String getHost()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPATCHER

public static final java.lang.String DISPATCHER
Standard dispatcher servlet URL

See Also:
Constant Field Values
Constructor Detail

ClientDispatcher

public ClientDispatcher(java.applet.Applet anApplet,
                        java.lang.String context)
                 throws java.net.MalformedURLException
Create a new dispatcher with an applet providing the URL. The servlet needs to be deployed with the name "dispatch".


ClientDispatcher

public ClientDispatcher(java.lang.String aHost)
Create a new dispatcher.

Parameters:
aHost - The URL of the servlet handler
Method Detail

getHost

public java.lang.String getHost()

execute

public ActionResult execute(Action anAction)
                     throws java.lang.Exception
Execute the action on the server.

Returns:
the result of the execution, including the action itself
Throws:
java.lang.Exception

createObjectInputStream

protected java.io.ObjectInputStream createObjectInputStream(java.io.InputStream in)
                                                     throws java.io.IOException
Create an object input stream that wraps the URL connection stream. This method can be overriden in order to create custom streams.

Parameters:
in - the underlying stream. It is buffered
Returns:
an object input stream
Throws:
java.io.IOException

createObjectOutputStream

protected java.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream out)
                                                       throws java.io.IOException
Create an object input stream that wraps the URL connection stream. This method can be overriden in order to create custom streams.

Parameters:
out - The OutputStream to wrap
Returns:
an ObjectOutputStream wrapping the specified OutputStream
Throws:
java.io.IOException


Copyright © 2001-2003 WebWork All Rights Reserved.