com.javaparts.dde
Class DDEClient

java.lang.Object
  extended bycom.javaparts.dde.DDEClient

public class DDEClient
extends java.lang.Object

DDEClient is the main class for establishing conversation with DDE servers. It is designed as a singleton, that is only one instance of it can be created. You obtain DDEClient instance with getInstance method:

DDEClient client = DDEClient.getInstance()

This class is responsible for processing all DDE events from server. You should close client instance when you finish your work with DDE.


Method Summary
 void addDDEEventListener(DDEEventListener l)
          Add event handler.
 void close()
          Close this instance of the client and stop processing DDE events.
 Conversation connect(java.lang.String service, java.lang.String topic)
          Establish conversation with the given service/topic.
static DDEClient getInstance()
          Obtain an instance of the client object.
 void removeDDEEventListener(DDEEventListener l)
          Remove event handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DDEClient getInstance()
Obtain an instance of the client object. This class is a singleton, only one instance can be created. But from this instance many connections with DDE servers can be opened, see connect method.

Returns:
an instance of the client.

connect

public Conversation connect(java.lang.String service,
                            java.lang.String topic)
                     throws DDEException
Establish conversation with the given service/topic.

Parameters:
service - name of the DDE service (for example "Excel")
topic - name of the DDE topic (for example "Sheet1")
Returns:
established conversation object
Throws:
DDEException - if client is unable to establish a connection.

close

public void close()
Close this instance of the client and stop processing DDE events. You should always call this method at the end of you application or when you stop working with DDE in your application.


addDDEEventListener

public void addDDEEventListener(DDEEventListener l)
Add event handler.

Parameters:
l - event handler to add

removeDDEEventListener

public void removeDDEEventListener(DDEEventListener l)
Remove event handler.

Parameters:
l - event handler to remove