|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.infoengine.procunit.adapter.Adapter
This class supports communication between Info*Engine components. It establishes network connections, transmits requests, and receives results. The Info*Engine servlet uses it to create connections and send requests to the template and task processors, and the task processor uses it to create connections and send requests to adapters.
Nested Class Summary | |
private class |
Adapter.AdapterInputStream
The following inner classes wrap InputStream and OutputStream in order to prevent their close() methods from closing the sockets from which they are derived. |
private class |
Adapter.AdapterOutputStream
|
Field Summary | |
private static HashMap |
adapterInstances
|
private static Map |
busyConnections
|
private static Map |
freeConnections
|
private static Map |
freeConnectionsLastUse
|
private IeRequest |
ieResponse
|
protected IeMultipartInputStream |
inputStream
|
private com.infoengine.log.LogWriter |
logWriter
|
private int |
maxConnectionAge
|
private int |
maxConnectionCacheSize
|
private static String |
myHostName
|
private IeRequest |
originalRequest
|
protected IeMultipartOutputStream |
outputStream
|
private IeProcessor |
processor
|
private String |
requestContentType
|
private static String |
RESOURCE
|
private String |
runtimeServiceName
|
private String |
serviceName
|
private Socket |
socket
|
Constructor Summary | |
Adapter(Enumeration serviceNames,
com.infoengine.log.LogWriter logWriter)
Constructs an instance initialized to support communication with a component identified in an enumeration. |
|
Adapter(String serviceName,
com.infoengine.log.LogWriter logWriter)
Constructs an instance initialized to support communication with a named component. |
Method Summary | |
void |
close()
Releases the connection. |
private void |
closeConnection(Socket connection,
boolean force)
|
private void |
createConnection(String serviceName,
com.infoengine.log.LogWriter logWriter)
Creates a connection to a named component. |
private Socket |
getConnection(String serviceName)
|
private Socket |
getFreeConnection(String serviceName)
|
InputStream |
getInputStream()
Returns the input stream associated with the connection established by this object. |
OutputStream |
getOutputStream()
Returns the output stream currently associated with the connection established by this object. |
String |
getServiceName()
Returns the name of the service currently associated with the object instance. |
private void |
initialize()
Initializes the object instance. |
boolean |
isInProcess()
Indicates whether the service currently associated with the object instance will be executed in-process. |
IeRequest |
receive()
Reads and returns a response to a request previously sent across the established connection. |
void |
send(IeRequest request)
Sends an Info*Engine request object across the established connection. |
void |
send(IeRequest request,
IeMultipartInputStream in)
Sends an Info*Engine request object across the established connection, and copies BLOB's from a specified servlet input stream to the connection too. |
void |
setInputStream(IeMultipartInputStream is)
Sets the multipart input stream associated with the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private IeRequest ieResponse
private com.infoengine.log.LogWriter logWriter
private static String myHostName
private IeRequest originalRequest
private IeProcessor processor
private Socket socket
private String serviceName
private String runtimeServiceName
private String requestContentType
private static String RESOURCE
protected IeMultipartOutputStream outputStream
protected IeMultipartInputStream inputStream
private static HashMap adapterInstances
private static Map busyConnections
private static Map freeConnections
private static Map freeConnectionsLastUse
private int maxConnectionAge
private int maxConnectionCacheSize
Constructor Detail |
public Adapter(String serviceName, com.infoengine.log.LogWriter logWriter) throws IEException
serviceName
- The name of the component with which to establish
a connection.logWriter
- The LogWriter on which to write messages related
to this network connection.
IEException
- if a connection can not be established to
the named component, perhaps because the
component is unknown or it is not accepting
connections.public Adapter(Enumeration serviceNames, com.infoengine.log.LogWriter logWriter) throws IEException
serviceNames
- The enumeration of service names with which to
establish a connection.logWriter
- The LogWriter on which to write messages related
to this network connection.
IEException
- if a connection can not be established to
any of the named services, perhaps because none
of the services are known, or none are accepting
connections.Method Detail |
public String getServiceName()
public boolean isInProcess()
public void setInputStream(IeMultipartInputStream is) throws IEException
is
- The multipart input stream from which BLOB's will be
copied to the component at the other end of the
connection.
IEException
- if the input stream can not be associated
with this object.public InputStream getInputStream() throws IEException
IEException
- if the input stream can not be obtained.public OutputStream getOutputStream() throws IEException
IEException
- if the output stream can not be pbtained.public void send(IeRequest request, IeMultipartInputStream in) throws IEException
request
- The Info*Engine request object to be sent across the
connection.in
- The servlet input stream possibly containing BLOB's to be
sent across the connection.
IEException
- if the request and/or BLOB's can not be sent
successfully.public void send(IeRequest request) throws IEException
request
- The Info*Engine request object to be sent across the
connection.
IEException
- if the request can not be sent successfully.public IeRequest receive() throws IEException, AdapterException
IEException
- if an I/O error prevents the response from
being received successfully.
AdapterException
- if the peer on the other end of the
connection returns an exception.public void close()
private void createConnection(String serviceName, com.infoengine.log.LogWriter logWriter) throws IEException
serviceName
- The name of the component with which to establish
a connection.logWriter
- The log writer to which to write log messages
IEException
- if a connection can not be established to
the named component, perhaps because the
component is unknown or it is not accepting
connections.private void initialize() throws IEException
IEException
private Socket getConnection(String serviceName) throws IEException
IEException
private Socket getFreeConnection(String serviceName)
private void closeConnection(Socket connection, boolean force)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |