org.apache.uima.collection.impl.cpm.container.deployer.socket
Interface SocketTransport

All Known Implementing Classes:
OFSocketTransportImpl

public interface SocketTransport


Method Summary
 java.net.Socket connect(java.net.URL aURI, long aTimeout)
          Creates a socket connection to a given endpoint.
 java.lang.String getName()
          Returns transport identifier
 ProcessingResourceMetaData getProcessingResourceMetaData(java.net.Socket aSocket)
          Returns metadata associated with the fenced CasProcessor
 CAS process(java.net.Socket aSocket, CAS aCas)
          Invokes fenced CasProcessor.
 

Method Detail

getName

java.lang.String getName()
Returns transport identifier

Returns:
- String uniquely identifying the transport.

connect

java.net.Socket connect(java.net.URL aURI,
                        long aTimeout)
                        throws java.net.SocketException
Creates a socket connection to a given endpoint. This method blocks until all Connections are resolved or an error occurs.

Parameters:
- - aURI - URI containing service endpoint info: host&port
- - aTimeout - max time in millis to wait for response
Returns:
- Socket bound to a given endpoint
Throws:
- - SocketException - Failed to connect
java.net.SocketException

process

CAS process(java.net.Socket aSocket,
            CAS aCas)
            throws java.net.SocketTimeoutException,
                   java.net.SocketException,
                   AnalysisEngineProcessException
Invokes fenced CasProcessor.

Parameters:
- - aSocket - Socket bound to fenced CasProcessor
- - aCas - CAS to be sent to the CasProcessor for analysis
Returns:
- CAS - CAS returned from the fenced CasProcessor
Throws:
- - SocketTimeoutException - Socket timesout before receiving response from the fenced CasProcessor
- - SocketException - connection broken
java.net.SocketTimeoutException
java.net.SocketException
AnalysisEngineProcessException

getProcessingResourceMetaData

ProcessingResourceMetaData getProcessingResourceMetaData(java.net.Socket aSocket)
                                                         throws java.net.SocketException,
                                                                AnalysisEngineProcessException
Returns metadata associated with the fenced CasProcessor

Parameters:
aSocket - - socket to the fenced CasProcessor
Returns:
- metadata
Throws:
java.net.SocketException
AnalysisEngineProcessException


Copyright © 2013. All Rights Reserved.