ix.applet
Class AppletCommunicationStrategy

java.lang.Object
  extended by ix.applet.AppletCommunicationStrategy
All Implemented Interfaces:
IPC.CommunicationStrategy

public class AppletCommunicationStrategy
extends java.lang.Object
implements IPC.CommunicationStrategy

Lets I-P2 applets talk with each other. It can also be used with non-applet instances of Ip2 if they specify a "base-url" parameter.

See Also:
Parameters

Constructor Summary
AppletCommunicationStrategy()
           
 
Method Summary
 void appletDestroy()
           
 void appletStart()
           
 void appletStop()
           
protected  java.lang.Object decodeReply(java.lang.String text)
           
protected  void do_transcript(java.lang.String line)
           
protected  java.lang.String encodeForSend(AppletMessage m)
           
protected  java.io.InputStreamReader makeReader(java.net.URLConnection conn)
           
protected  java.lang.Object requestObject(AppletMessage m)
          Sends a request to the message server and returns the server's reply.
 void sendObject(java.lang.Object destination, java.lang.Object contents)
           
protected  java.lang.String sendText(java.lang.String text)
           
 void setupServer(java.lang.Object destination, IPC.MessageListener listener)
           
protected  void transcript(java.lang.String line)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppletCommunicationStrategy

public AppletCommunicationStrategy()
Method Detail

appletStart

public void appletStart()

appletStop

public void appletStop()

appletDestroy

public void appletDestroy()

setupServer

public void setupServer(java.lang.Object destination,
                        IPC.MessageListener listener)
Specified by:
setupServer in interface IPC.CommunicationStrategy

transcript

protected void transcript(java.lang.String line)

do_transcript

protected void do_transcript(java.lang.String line)

sendObject

public void sendObject(java.lang.Object destination,
                       java.lang.Object contents)
Specified by:
sendObject in interface IPC.CommunicationStrategy

requestObject

protected java.lang.Object requestObject(AppletMessage m)
Sends a request to the message server and returns the server's reply. A string reply that reports an exception is turned into an appropriate exception and then thrown, rather than being returned.


encodeForSend

protected java.lang.String encodeForSend(AppletMessage m)

decodeReply

protected java.lang.Object decodeReply(java.lang.String text)

sendText

protected java.lang.String sendText(java.lang.String text)
                             throws java.net.MalformedURLException,
                                    java.io.IOException
Throws:
java.net.MalformedURLException
java.io.IOException

makeReader

protected java.io.InputStreamReader makeReader(java.net.URLConnection conn)
                                        throws java.io.IOException,
                                               java.io.UnsupportedEncodingException
Throws:
java.io.IOException
java.io.UnsupportedEncodingException