|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openorb.orb.iiop.IIOPTransport
Interface for creating sockets.
Constructor Summary | |
IIOPTransport(java.net.InetAddress host,
int port,
org.apache.avalon.framework.logger.Logger logger)
|
|
IIOPTransport(java.net.InetAddress host,
int port,
org.apache.avalon.framework.logger.Logger logger,
SocketFactory socketFactory)
Constructor. |
|
IIOPTransport(java.net.Socket sock,
int serverPort,
org.apache.avalon.framework.logger.Logger logger)
Constructor. |
Method Summary | |
protected int |
checkGIOPHeader(byte[] buf,
int off)
Check the IIOP header and return the length. |
void |
close()
Close the connection this always succeeds. |
protected java.net.Socket |
createSocket(java.net.InetAddress host,
int port)
Open the socket to the specified host and port. |
boolean |
establishAssociation(Address addr)
Check for applicability of channel for carrying messages for the specified address and setup any client transport binding. |
protected java.lang.String |
getConnString()
This returns a string describing the connection endpoints. |
protected java.net.Socket |
getSocket()
Return the socket. |
boolean |
isMessageError()
Returns true if setMessageError has been called. |
boolean |
isOpen()
Is is the transport open? |
void |
open()
Open the connection. |
protected void |
read(byte[] buf,
int off,
int len)
Read bytes into the array. |
protected StorageBuffer |
readBuffer(byte[] head,
int off,
int len,
int total_len)
Create a storage buffer from the passed buffer, reading extra bytes from the stream. |
protected boolean |
readMagic(int timeout,
byte[] buf,
int off)
Reads four bytes from the input stream into the buffer at the specified offset. |
StorageBuffer |
recvMessage(int timeout)
Read next message. |
void |
sendMessage(StorageBuffer msg)
Write message to comms protocol. |
void |
setMessageError()
If this gets called then the close operation will close by sending a MessageError message. |
java.lang.String |
toString()
Print out socket information. |
protected void |
write(byte[] buf,
int off,
int len)
Write bytes directly to socket. |
protected void |
writeCloseMessage()
Send the close message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public IIOPTransport(java.net.InetAddress host, int port, org.apache.avalon.framework.logger.Logger logger)
public IIOPTransport(java.net.InetAddress host, int port, org.apache.avalon.framework.logger.Logger logger, SocketFactory socketFactory)
host
- Host of the endpoint.port
- Port of the endoint.public IIOPTransport(java.net.Socket sock, int serverPort, org.apache.avalon.framework.logger.Logger logger)
sock
- Client socket.serverPort
- Port of the endoint.logger
- The logger to use in this instance.Method Detail |
public void open()
open
in interface Transport
org.openorb.orb.net.Transport
org.omg.CORBA.COMM_FAILURE
- failed to open channel. This exception
will be reported to clients.protected java.net.Socket createSocket(java.net.InetAddress host, int port) throws java.io.IOException
protected java.net.Socket getSocket()
public void close()
close
in interface Transport
protected void writeCloseMessage()
public boolean isOpen()
isOpen
in interface Transport
public void sendMessage(StorageBuffer msg)
sendMessage
in interface Transport
msg
- The message to be sent.org.omg.CORBA.COMM_FAILURE
- permanent transport failure occoured.
Cleanup and then call close.protected void write(byte[] buf, int off, int len)
buf
- message buffer.off
- offset of beginning of message in buffer.len
- length of message in buffer.org.omg.CORBA.COMM_FAILURE
- permanent transport failure occoured.public StorageBuffer recvMessage(int timeout) throws java.io.EOFException
recvMessage
in interface Transport
timeout
- max time to wait before recieving a message.java.io.EOFException
- end of file has been reached. Cleanup and call close.org.omg.CORBA.COMM_FAILURE
- permanent transport failure occoured.
Cleanup and then call close.public void setMessageError()
public boolean isMessageError()
protected boolean readMagic(int timeout, byte[] buf, int off) throws java.io.EOFException
protected int checkGIOPHeader(byte[] buf, int off) throws java.io.EOFException
java.io.EOFException
- If header is a CloseConnection messageorg.omg.CORBA.COMM_FAILURE
- If header is a MsgError message.protected final void read(byte[] buf, int off, int len)
protected StorageBuffer readBuffer(byte[] head, int off, int len, int total_len)
public boolean establishAssociation(Address addr)
establishAssociation
in interface Transport
addr
- the address.public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getConnString()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |