ix.applet
Class AppletCommunicationStrategy
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
tool
AppletCommunicationTool tool
agent
Ip2 agent
docBase
java.net.URL docBase
messageListener
IPC.MessageListener messageListener
ableToSend
boolean ableToSend
expectedSeqNo
volatile int expectedSeqNo
messageMap
MessageMemory messageMap
AppletCommunicationStrategy
public AppletCommunicationStrategy()
setTool
void setTool(AppletCommunicationTool tool)
getAgentName
java.lang.String getAgentName()
isAbleToSend
boolean isAbleToSend()
setIsAbleToSend
void setIsAbleToSend(boolean v)
getDocumentBase
java.net.URL getDocumentBase()
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
registerAs
void registerAs(java.lang.String name)
serverUnavailable
void serverUnavailable()
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.
interpretServerException
java.lang.RuntimeException interpretServerException(java.lang.String text)
interpretRelayException
java.lang.RuntimeException interpretRelayException(java.lang.String text)
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