public abstract class NIOConnection extends StreamConnectionBase
Modifier and Type | Field and Description |
---|---|
protected SocketChannel |
channel |
protected int |
failedWriteAttempts |
protected boolean |
isDebugEnabled |
protected SelectorManager |
selectorManager |
in_stream, out_stream
b_out, configuration, connected, connection_info, finalTimeout, logger, orb, profile
Constructor and Description |
---|
NIOConnection() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Configuration config) |
void |
flush()
Causes any buffered data to be actually written to the Connection.
|
protected int |
getTimeout() |
protected COMM_FAILURE |
handleCommFailure(IOException e)
this is invoked whenever a communication error occurs.
|
boolean |
is_connected() |
boolean |
isSSL() |
int |
read(org.omg.ETF.BufferHolder data,
int offset,
int min_length,
int max_length,
long time_out)
Reads bytes from the connection.
|
protected void |
setConnected(boolean connected) |
protected void |
setTimeout(int timeout) |
void |
write(boolean is_first,
boolean is_last,
byte[] data,
int offset,
int length,
long time_out)
Writes bytes to this Connection.
|
is_data_available, silentClose
get_server_profile, getLocalhost, supports_callback, to_COMM_FAILURE, turnOnFinalTimeout, use_handle_time_out, wait_next_data
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
protected SocketChannel channel
protected SelectorManager selectorManager
protected int failedWriteAttempts
protected boolean isDebugEnabled
public void configure(Configuration config) throws ConfigurationException
configure
in interface Configurable
configure
in class ConnectionBase
ConfigurationException
public boolean isSSL()
isSSL
in class StreamConnectionBase
public boolean is_connected()
is_connected
in interface org.omg.ETF.ConnectionOperations
is_connected
in class ConnectionBase
protected void setConnected(boolean connected)
protected COMM_FAILURE handleCommFailure(IOException e)
ConnectionBase
handleCommFailure
in class ConnectionBase
protected void setTimeout(int timeout)
setTimeout
in class ConnectionBase
protected int getTimeout()
getTimeout
in class ConnectionBase
public int read(org.omg.ETF.BufferHolder data, int offset, int min_length, int max_length, long time_out)
StreamConnectionBase
read
in interface org.omg.ETF.ConnectionOperations
read
in class StreamConnectionBase
data
- holds a byte array to which the bytes will be written. The
field data.value
must be initialized with a valid byte
array already, it cannot be null.offset
- the index in data.value
at which the first
byte will be written.min_length
- the minimum number of bytes that shall be read from
the Connection. The method will block until at least this many bytes
have been read. If min_length
is 0, the method will always
return immediately without reading any data.max_length
- the maximum number of bytes that shall be read from
the Connection. If max_length
is greater than
min_length
, then the transport is free to read
(max_length
- min_length
) additional bytes
beyond min_length
.time_out
- timeout for this particular read operation. Currently
ignored in JacORB; we use socket-level timeouts.data.value
is at the index offset
+ this return
value. This return type is a change to the ETF draft spec in JacORB.
It is needed because the mechanism suggested in the draft does not work
in Java.public void write(boolean is_first, boolean is_last, byte[] data, int offset, int length, long time_out)
StreamConnectionBase
write
in interface org.omg.ETF.ConnectionOperations
write
in class StreamConnectionBase
is_first
- Currently not used in JacORB.is_last
- Currently not used in JacORB.data
- the buffer that holds the data that is to be written.offset
- index of the first byte in data
that shall
be written to the Connection.length
- the number of bytes in data that shall be written. The
last byte in data
that is written is at the index
offset + length
.time_out
- timeout for this particular write operation. Currently
ignored in JacORB.public void flush()
StreamConnectionBase
flush
in interface org.omg.ETF.ConnectionOperations
flush
in class StreamConnectionBase
Copyright © 2017 JacORB. All rights reserved.