com.jniwrapper.win32.dde
Class DdeServiceEventAdapter

java.lang.Object
  extended by com.jniwrapper.win32.dde.DdeServiceEventAdapter
All Implemented Interfaces:
DdeServiceEventHandler

public abstract class DdeServiceEventAdapter
extends java.lang.Object
implements DdeServiceEventHandler

An abstract adapter class for processing DDE service events.


Constructor Summary
DdeServiceEventAdapter()
           
 
Method Summary
 byte[] adviseRequest(java.lang.String topic, DdeItem item)
          Occurs when the value of the item has been changed and it is necessary to notify clients.
 boolean adviseStart(java.lang.String topic, DdeItem item)
          Occurs when a client begins an advise loop.
 void adviseStop(java.lang.String topic, DdeItem item)
          Occurs when a client stops an advise loop.
 boolean beforeConnect(java.lang.String topic, boolean sameApplication)
          Occurs when a client attempts to establish connection with the service.
 void disconnect(boolean sameApplication)
          Occurs on disconnect.
 void disconnect(boolean sameApplication)
          Occurs on disconnect.
 DdeResponse execute(java.lang.String topic, java.lang.String command)
          Occurs when a client makes a command execution request.
 DdeResponse pokeData(java.lang.String topic, DdeItem item, byte[] data)
          Occurs when a client sends data to the service.
 byte[] requestData(java.lang.String topic, DdeItem item)
          Occurs when a client makes a request for data.
 void serviceRegister(java.lang.String service, java.lang.String instanceName)
          Occurs when a service is registered.
 void serviceRegister(java.lang.String service, java.lang.String instanceName)
          Occurs when a service is registered.
 void serviceUnregister(java.lang.String service, java.lang.String instanceName)
          Occurs when a service is unregistered.
 void serviceUnregister(java.lang.String service, java.lang.String instanceName)
          Occurs when a service is unregistered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DdeServiceEventAdapter

public DdeServiceEventAdapter()
Method Detail

adviseRequest

public byte[] adviseRequest(java.lang.String topic,
                            DdeItem item)
Description copied from interface: DdeServiceEventHandler
Occurs when the value of the item has been changed and it is necessary to notify clients.

Specified by:
adviseRequest in interface DdeServiceEventHandler
Parameters:
topic - is the name of the topic.
item - specifies the item name and data format.
Returns:
a new value of the item data or null if the service is unable to process the request.

adviseStart

public boolean adviseStart(java.lang.String topic,
                           DdeItem item)
Description copied from interface: DdeServiceEventHandler
Occurs when a client begins an advise loop.

Specified by:
adviseStart in interface DdeServiceEventHandler
Parameters:
topic - is the name of the topic.
item - specifies the item name and data format.
Returns:
true to allow the client to start the advise loop, or false otherwise.

adviseStop

public void adviseStop(java.lang.String topic,
                       DdeItem item)
Description copied from interface: DdeServiceEventHandler
Occurs when a client stops an advise loop.

Specified by:
adviseStop in interface DdeServiceEventHandler
Parameters:
topic - is the name of the topic.
item - specifies the item name.

execute

public DdeResponse execute(java.lang.String topic,
                           java.lang.String command)
Description copied from interface: DdeServiceEventHandler
Occurs when a client makes a command execution request.

Specified by:
execute in interface DdeServiceEventHandler
Parameters:
topic - is the name of the topic.
command - is the command to be executed.
Returns:
the result of the request processing.

beforeConnect

public boolean beforeConnect(java.lang.String topic,
                             boolean sameApplication)
Description copied from interface: DdeServiceEventHandler
Occurs when a client attempts to establish connection with the service.

Specified by:
beforeConnect in interface DdeServiceEventHandler
Parameters:
topic - is the name of the topic.
sameApplication - specifies if the client and the service are the same application.
Returns:
true to allow the client to connect, or false otherwise.

pokeData

public DdeResponse pokeData(java.lang.String topic,
                            DdeItem item,
                            byte[] data)
Description copied from interface: DdeServiceEventHandler
Occurs when a client sends data to the service.

Specified by:
pokeData in interface DdeServiceEventHandler
Parameters:
topic - is the name of the topic.
item - specifies the item name and data format.
data - is the sent data.
Returns:
the result of the event processing.

requestData

public byte[] requestData(java.lang.String topic,
                          DdeItem item)
Description copied from interface: DdeServiceEventHandler
Occurs when a client makes a request for data.

Specified by:
requestData in interface DdeServiceEventHandler
Parameters:
topic - is the name of the topic.
item - specifies the item name and data format.
Returns:
a new value of the item data or null if the service is unable to process the request.

disconnect

public void disconnect(boolean sameApplication)
Occurs on disconnect.

Parameters:
sameApplication - specifies if the client and the service are the same application.

serviceRegister

public void serviceRegister(java.lang.String service,
                            java.lang.String instanceName)
Occurs when a service is registered.

Parameters:
service - is the basic name of the service.
instanceName - is an instance-specific service name.

serviceUnregister

public void serviceUnregister(java.lang.String service,
                              java.lang.String instanceName)
Occurs when a service is unregistered.

Parameters:
service - is the basic name of the service.
instanceName - is an instance-specific service name.

disconnect

public void disconnect(boolean sameApplication)
Occurs on disconnect.

Parameters:
sameApplication - specifies if the client and the service are the same application.

serviceRegister

public void serviceRegister(java.lang.String service,
                            java.lang.String instanceName)
Occurs when a service is registered.

Parameters:
service - is the basic name of the service.
instanceName - is an instance-specific service name.

serviceUnregister

public void serviceUnregister(java.lang.String service,
                              java.lang.String instanceName)
Occurs when a service is unregistered.

Parameters:
service - is the basic name of the service.
instanceName - is an instance-specific service name.