com.esf.device.serial.comm.service
Interface ISerialCommAquisitionService


public interface ISerialCommAquisitionService

This is the factory for managing ISerialCommService objects. Since multiple threads may share a single ISerialCommService object, a factory is required to create, deliver, track and destroy all ISerialCommService objects.

Author:
matt.demaree

Field Summary
static java.lang.String SERVICE_NAME
          Reports the class name representing this interface.
 
Method Summary
 ISerialCommService getSerialCommService(java.lang.String port, boolean exclusive)
          Gets an ISerialCommService object for the selected port.
 void releaseSerialCommService(ISerialCommService service)
          Releases the selected ISerialCommService object.
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Reports the class name representing this interface.

Method Detail

getSerialCommService

ISerialCommService getSerialCommService(java.lang.String port,
                                        boolean exclusive)
                                        throws PortInUseException,
                                               PortNotAvailableException
Gets an ISerialCommService object for the selected port. If the ISerialCommService object does not exist, it will be created and the port will be initially opened.

Parameters:
port - Name of device controlling the selected port.
exclusive - If set, the ISerialCOmmService object is not to be shared.
Returns:
The object through which all port operation will occur.
Throws:
PortInUseException - Attempted to obtain the object for a port already held exclusive by another thread or attempted exclusive mode for an object already held by another thread.
PortNotAvailableException - The selected port device does not exist.

releaseSerialCommService

void releaseSerialCommService(ISerialCommService service)
Releases the selected ISerialCommService object. If this was the last referring thread for the object, the port will be closed and the object will be released for garbage collection.

Parameters:
service - If service is invalid, this method does nothing.