org.apache.yoko.orb.OCI.IIOP
Class Transport_impl

java.lang.Object
  extended by org.omg.CORBA.LocalObject
      extended by org.apache.yoko.orb.OCI.IIOP.Transport_impl
All Implemented Interfaces:
Transport, TransportOperations, Object

public final class Transport_impl
extends LocalObject
implements Transport


Field Summary
 Socket socket_
           
 
Constructor Summary
Transport_impl(Acceptor acceptor, Socket socket, ListenerMap lm)
           
Transport_impl(Connector connector, Socket socket, ListenerMap lm)
           
 
Method Summary
 void close()
          Closes the Transport.
 void finalize()
           
 TransportInfo get_info()
          Returns the information object associated with the Transport.
 int handle()
          The "handle" for this Transport.
 String id()
          The plugin id.
 SendReceiveMode mode()
          The send/receive capabilities of this Transport.
 boolean receive_detect(Buffer buf, boolean block)
          Similar to receive, but it signals a connection loss by returning FALSE instead of raising COMM_FAILURE.
 boolean receive_timeout_detect(Buffer buf, int t)
          Similar to receive_timeout, but it signals a connection loss by returning FALSE instead of raising COMM_FAILURE.
 void receive_timeout(Buffer buf, int t)
          Similar to receive, but it is possible to specify a timeout.
 void receive(Buffer buf, boolean block)
          Receives a buffer's contents.
 boolean send_detect(Buffer buf, boolean block)
          Similar to send, but it signals a connection loss by returning FALSE instead of raising COMM_FAILURE.
 boolean send_timeout_detect(Buffer buf, int t)
          Similar to send_timeout, but it signals a connection loss by returning FALSE instead of raising COMM_FAILURE.
 void send_timeout(Buffer buf, int t)
          Similar to send, but it is possible to specify a timeout.
 void send(Buffer buf, boolean block)
          Sends a buffer's contents.
 void shutdown()
          Shutdown the Transport.
 int tag()
          The profile id tag.
 String toString()
           
 
Methods inherited from class org.omg.CORBA.LocalObject
_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
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Field Detail

socket_

public Socket socket_
Constructor Detail

Transport_impl

public Transport_impl(Connector connector,
                      Socket socket,
                      ListenerMap lm)

Transport_impl

public Transport_impl(Acceptor acceptor,
                      Socket socket,
                      ListenerMap lm)
Method Detail

id

public String id()
Description copied from interface: TransportOperations
The plugin id.

Specified by:
id in interface TransportOperations

tag

public int tag()
Description copied from interface: TransportOperations
The profile id tag.

Specified by:
tag in interface TransportOperations

mode

public SendReceiveMode mode()
Description copied from interface: TransportOperations
The send/receive capabilities of this Transport.

Specified by:
mode in interface TransportOperations

handle

public int handle()
Description copied from interface: TransportOperations
The "handle" for this Transport. The handle may only be used to determine whether the Transport object is ready to send or to receive data, e.g., with select() on Unix-based operating systems. All other uses (e.g., calls to read(), write(), close()) are strictly non-compliant. A handle value of -1 indicates that the protocol plug-in does not support "selectable" Transports.

Specified by:
handle in interface TransportOperations

close

public void close()
Description copied from interface: TransportOperations
Closes the Transport. After calling close, no operations on this Transport object and its associated TransportInfo object may be called. To ensure that no messages get lost when close is called, shutdown should be called first. Then dummy data should be read from the Transport, using one of the receive operations, until either an exception is raised, or until connection closure is detected. After that its save to call close, i.e., no messages can get lost.

Specified by:
close in interface TransportOperations

shutdown

public void shutdown()
Description copied from interface: TransportOperations
Shutdown the Transport. Upon a successful shutdown, threads blocking in the receive operations will return or throw an exception. After calling shutdown, no operations on associated TransportInfo object may be called. To fully close the Transport, close must be called.

Specified by:
shutdown in interface TransportOperations

receive

public void receive(Buffer buf,
                    boolean block)
Description copied from interface: TransportOperations
Receives a buffer's contents.

Specified by:
receive in interface TransportOperations
Parameters:
buf - The buffer to fill.
block - If set to TRUE, the operation blocks until the buffer is full. If set to FALSE, the operation fills as much of the buffer as possible without blocking.

receive_detect

public boolean receive_detect(Buffer buf,
                              boolean block)
Description copied from interface: TransportOperations
Similar to receive, but it signals a connection loss by returning FALSE instead of raising COMM_FAILURE.

Specified by:
receive_detect in interface TransportOperations
Parameters:
buf - The buffer to fill.
block - If set to TRUE, the operation blocks until the buffer is full. If set to FALSE, the operation fills as much of the buffer as possible without blocking.
Returns:
FALSE if a connection loss is detected, TRUE otherwise.

receive_timeout

public void receive_timeout(Buffer buf,
                            int t)
Description copied from interface: TransportOperations
Similar to receive, but it is possible to specify a timeout. On return the caller can test whether there was a timeout by checking if the buffer has been filled completely.

Specified by:
receive_timeout in interface TransportOperations
Parameters:
buf - The buffer to fill.
t - The timeout value in milliseconds. A zero timeout is equivalent to calling receive(buf, FALSE).

receive_timeout_detect

public boolean receive_timeout_detect(Buffer buf,
                                      int t)
Description copied from interface: TransportOperations
Similar to receive_timeout, but it signals a connection loss by returning FALSE instead of raising COMM_FAILURE.

Specified by:
receive_timeout_detect in interface TransportOperations
Parameters:
buf - The buffer to fill.
t - The timeout value in milliseconds. A zero timeout is equivalent to calling receive(buf, FALSE).
Returns:
FALSE if a connection loss is detected, TRUE otherwise.

send

public void send(Buffer buf,
                 boolean block)
Description copied from interface: TransportOperations
Sends a buffer's contents.

Specified by:
send in interface TransportOperations
Parameters:
buf - The buffer to send.
block - If set to TRUE, the operation blocks until the buffer has completely been sent. If set to FALSE, the operation sends as much of the buffer's data as possible without blocking.

send_detect

public boolean send_detect(Buffer buf,
                           boolean block)
Description copied from interface: TransportOperations
Similar to send, but it signals a connection loss by returning FALSE instead of raising COMM_FAILURE.

Specified by:
send_detect in interface TransportOperations
Parameters:
buf - The buffer to fill.
block - If set to TRUE, the operation blocks until the entire buffer has been sent. If set to FALSE, the operation sends as much of the buffer's data as possible without blocking.
Returns:
FALSE if a connection loss is detected, TRUE otherwise.

send_timeout

public void send_timeout(Buffer buf,
                         int t)
Description copied from interface: TransportOperations
Similar to send, but it is possible to specify a timeout. On return the caller can test whether there was a timeout by checking if the buffer has been sent completely.

Specified by:
send_timeout in interface TransportOperations
Parameters:
buf - The buffer to send.
t - The timeout value in milliseconds. A zero timeout is equivalent to calling send(buf, FALSE).

send_timeout_detect

public boolean send_timeout_detect(Buffer buf,
                                   int t)
Description copied from interface: TransportOperations
Similar to send_timeout, but it signals a connection loss by returning FALSE instead of raising COMM_FAILURE.

Specified by:
send_timeout_detect in interface TransportOperations
Parameters:
buf - The buffer to fill.
t - The timeout value in milliseconds. A zero timeout is equivalent to calling send(buf, FALSE).
Returns:
FALSE if a connection loss is detected, TRUE otherwise.

get_info

public TransportInfo get_info()
Description copied from interface: TransportOperations
Returns the information object associated with the Transport.

Specified by:
get_info in interface TransportOperations
Returns:
The Transport information object.

finalize

public void finalize()
              throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.