Interface horb.orb.IOCI
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface horb.orb.IOCI

public interface IOCI
extends Object
extends IOCIService
Definition of Inter-Object Communication Interface. This class will be largely changed in future. User accessible methods are separated in IOCIService. If you are a HORB programmer, you don't concern with this interface.

This interface defines APIs between the lower transport layer and the upper application layer (i.e. HORB). Thus this interface is responsible for the session management and presentation of data on network.

APIs can be separated into two parts. One is common to every IOCI implementations, such as upper level connection creation and object passing. This is protocol independent. The other is protocol dependent and protocol specific. For example, making new network connection, sending a integer, and obtaining IP address.

The common part is separated in the class IOCICommon. The protocol dependent part may inherit IOCICommon easily to comply to the IOCI. But you don't need to do so, if you don't want to.

APIs in the IOCI are also categolized into server side, client side, both sides. A HORB server serves a port. The meaning of port depends on the implementations of IOCI. BasicIOCI, for example, is an implementation for TCP/IP and the socket interface, thus the port means socket number. You can use port number as other meanings, such like ATM channel number.


Variable Index

 o LOC_FILE
object is transfered to/from file.
 o LOC_NETWORK
object is transfered to/from network.
 o OBJ_CAST
usual instance, but casted to something is passed.
 o OBJ_INST
usual instance is passed.
 o OBJ_LOOPY
looped object is passed.
 o OBJ_NO_PROXY
no proxy class was found.
 o OBJ_NULL
null instance is passed.
 o OBJ_REF
remote object reference is passed.
 o OBJ_STRING
String is passed.
 o ORB_CLOSE
disconnect to the object.
 o ORB_CONNECT_TO_INSTANCE
connect to existent object.
 o ORB_CREATE_INSTANCE
create a new object.
 o ORB_INVITE_TO_INSTANCE
invite a server object to access a client object.
 o PREAMBLE
preamble for each remote method call
 o STAT_CLASS_VERSION_MISMATCH
class major version mismatch
 o STAT_EXCEPTION_IN_ARGUMENT
exception occured during sending arguments
 o STAT_EXCEPTION_IN_METHOD
exception occured during execution of the method
 o STAT_IOCI_NOT_FOUND
requsted IOCI class not found
 o STAT_IOCI_VERSION_MISMATCH
IOCI major version mismatch
 o STAT_NO_ERROR
method call ended with no error
 o STAT_NO_SUCH_METHOD
requested method not found
 o STAT_NO_SUCH_OBJECT
requested object or class not found
 o STAT_PERMISSION_ERROR
access is denied
 o STAT_PREAMBLE_MISMATCH
connection is not syncronized.

Method Index

 o acceptClassNo()
receive a class number
 o acceptMethod()
receive a method number
 o connect(HorbURL, String, short, short, String, String)
connect to an object.
 o connectObject(HorbURL, String, short, short, String, String)
connect to an existing remote object.
 o connectServer(String, int)
connect to a server.
 o createObject(HorbURL, String, short, short, String, String)
create a new remote object.
 o getMajorVersion()
return major version number of this IOCI.
 o getMinorVersion()
return minor version number of this IOCI.
 o getNumArgs()
receive the number of arguments for a method
 o getSignature()
return signature of this IOCI.
 o invite(HorbURL, HorbURL, String, String)
invite a server object to a client object.
 o invite2(HorbURL, String, HorbURL, String, String, String)
invite a server object to a client object, second part.
 o invited(String, HorbURL, short, short, String, String)
connect to the client.
 o isAsyncMethodEnd()
 o kick()
flush the output buffer to cause actual send
 o raiseIfException(short, String)
raise exception according to status
 o recvBoolean()
receive a boolean
 o recvBooleanArray()
receive an array of booleans
 o recvByte()
receive a byte
 o recvByteArray()
receive an array of bytes
 o recvChar()
receive a char
 o recvCharArray()
receive an array of chars
 o recvConnectObject()
receiver part of connectObject().
 o recvConnectServer()
receive connect request from client.
 o recvCreateObject()
receiver part of createObject().
 o recvDouble()
receive a double
 o recvDoubleArray()
receive an array of doubles
 o recvFloat()
receive a float
 o recvFloatArray()
receive an array of floats
 o recvInt()
receive an int
 o recvIntArray()
receive an array of ints
 o recvInvite()
receiver part of invite().
 o recvLong()
receive a long
 o recvLongArray()
receive an array of longs
 o recvObject(String, Goldberg)
Receives an object.
 o recvPreamble()
receive a preamble
 o recvShort()
receive a short
 o recvShortArray()
receive an array of shorts
 o recvStatus()
receive a status of execution
 o recvStatusNoCheck()
receive a status of execution without status check
 o recvString()
receive a string
 o recvStringArray()
receive an array of strings
 o request()
issue a request.
 o selectMethod(int, int, int)
select a remote method
 o sendBoolean(boolean)
send a boolean
 o sendBooleanArray(boolean[])
send an array of booleans
 o sendByte(byte)
send a byte
 o sendByteArray(byte[])
send an array of bytes
 o sendChar(char)
send a char
 o sendCharArray(char[])
send an array of chars
 o sendDouble(double)
send a double
 o sendDoubleArray(double[])
send an array of doubles
 o sendFloat(float)
send a float
 o sendFloatArray(float[])
send an array of floats
 o sendInt(int)
send an int
 o sendIntArray(int[])
send an array of ints
 o sendIOCISignature()
send signature of IOCI
 o sendLong(long)
send a long
 o sendLongArray(long[])
send an array of longs
 o sendObject(Object, String, Loopy)
Sends a object.
 o sendShort(short)
send a short
 o sendShortArray(short[])
send an array of shorts
 o sendStatus(short)
send status of method call.
 o sendString(String)
send a string
 o sendStringArray(String[])
send an array of Strings
 o serverAccept(int)
accept new connection request.
 o serverInit(int)
initialize IOCI for server port.
 o setHandler(AsyncMethodHandler, int)
 o startAsyncHandler()
 o waitNoReceive(long)
 o waitReceive(long)

Variables

 o ORB_CREATE_INSTANCE
  public final static short ORB_CREATE_INSTANCE
create a new object.
 o ORB_CONNECT_TO_INSTANCE
  public final static short ORB_CONNECT_TO_INSTANCE
connect to existent object.
 o ORB_CLOSE
  public final static short ORB_CLOSE
disconnect to the object.
 o ORB_INVITE_TO_INSTANCE
  public final static short ORB_INVITE_TO_INSTANCE
invite a server object to access a client object.
 o PREAMBLE
  public final static short PREAMBLE
preamble for each remote method call
 o STAT_NO_ERROR
  public final static short STAT_NO_ERROR
method call ended with no error
 o STAT_NO_SUCH_OBJECT
  public final static short STAT_NO_SUCH_OBJECT
requested object or class not found
 o STAT_NO_SUCH_METHOD
  public final static short STAT_NO_SUCH_METHOD
requested method not found
 o STAT_EXCEPTION_IN_METHOD
  public final static short STAT_EXCEPTION_IN_METHOD
exception occured during execution of the method
 o STAT_EXCEPTION_IN_ARGUMENT
  public final static short STAT_EXCEPTION_IN_ARGUMENT
exception occured during sending arguments
 o STAT_PREAMBLE_MISMATCH
  public final static short STAT_PREAMBLE_MISMATCH
connection is not syncronized. reconnect!
 o STAT_PERMISSION_ERROR
  public final static short STAT_PERMISSION_ERROR
access is denied
 o STAT_IOCI_VERSION_MISMATCH
  public final static short STAT_IOCI_VERSION_MISMATCH
IOCI major version mismatch
 o STAT_IOCI_NOT_FOUND
  public final static short STAT_IOCI_NOT_FOUND
requsted IOCI class not found
 o STAT_CLASS_VERSION_MISMATCH
  public final static short STAT_CLASS_VERSION_MISMATCH
class major version mismatch
 o OBJ_NULL
  public final static byte OBJ_NULL
null instance is passed.
 o OBJ_REF
  public final static byte OBJ_REF
remote object reference is passed.
 o OBJ_INST
  public final static byte OBJ_INST
usual instance is passed.
 o OBJ_CAST
  public final static byte OBJ_CAST
usual instance, but casted to something is passed.
 o OBJ_LOOPY
  public final static byte OBJ_LOOPY
looped object is passed. this object was passed once
 o OBJ_NO_PROXY
  public final static byte OBJ_NO_PROXY
no proxy class was found. object was ignored
 o OBJ_STRING
  public final static byte OBJ_STRING
String is passed.
 o LOC_NETWORK
  public final static byte LOC_NETWORK
object is transfered to/from network.
 o LOC_FILE
  public final static byte LOC_FILE
object is transfered to/from file.

Methods

 o serverInit
  public abstract void serverInit(int port) throws IOException
initialize IOCI for server port.
Parameters:
port - port to serve by this HORB server.
 o serverAccept
  public abstract IOCI serverAccept(int port) throws IOException
accept new connection request.
Parameters:
port - port to listen
Returns:
new IOCI object.
 o recvConnectServer
  public abstract boolean recvConnectServer() throws IOException
receive connect request from client. This is the counter part of connectServer().
 o recvPreamble
  public abstract short recvPreamble() throws IOException
receive a preamble
 o acceptClassNo
  public abstract short acceptClassNo() throws IOException
receive a class number
 o acceptMethod
  public abstract short acceptMethod() throws IOException
receive a method number
 o getNumArgs
  public abstract short getNumArgs() throws IOException
receive the number of arguments for a method
 o sendStatus
  public abstract void sendStatus(short status) throws IOException
send status of method call.
 o connect
  public abstract HorbURL connect(HorbURL url,
                                  String className,
                                  short major,
                                  short minor,
                                  String username,
                                  String passwd) throws HORBException, NetException
connect to an object.
Parameters:
major - major version number. Mismatch causes exception.
minor - minor version number.
username - username. null if anonymous user.
passwd - password.
 o createObject
  public abstract HorbURL createObject(HorbURL url,
                                       String className,
                                       short major,
                                       short minor,
                                       String username,
                                       String passwd) throws HORBException, NetException
create a new remote object.
Parameters:
url - HorbURL of the remote machine. This may not contain objectID.
className - class name of the object
major - major version number. Mismatch causes exception.
minor - minor version number.
username - username. null if anonymous user.
passwd - password.
 o recvCreateObject
  public abstract NetIOCIInfo recvCreateObject() throws IOException
receiver part of createObject().
 o connectObject
  public abstract HorbURL connectObject(HorbURL url,
                                        String className,
                                        short major,
                                        short minor,
                                        String username,
                                        String passwd) throws NetException, HORBException
connect to an existing remote object.
Parameters:
url - HorbURL of the remote machine. objectID must be contained.
className - class name of the object
major - major version number. Mismatch causes exception.
minor - minor version number.
username - username. null if anonymous user.
passwd - password.
 o recvConnectObject
  public abstract NetIOCIInfo recvConnectObject() throws IOException
receiver part of connectObject().
 o selectMethod
  public abstract void selectMethod(int classNo,
                                    int methodNo,
                                    int numArgs) throws IOException
select a remote method
 o recvStatus
  public abstract short recvStatus() throws IOException, HORBException
receive a status of execution
 o recvStatusNoCheck
  public abstract short recvStatusNoCheck() throws IOException
receive a status of execution without status check
 o raiseIfException
  public abstract void raiseIfException(short status,
                                        String str) throws HORBException
raise exception according to status
Parameters:
status - status to check. This must be one of IOCI.STAT_*.
str - this string is prepended to an exception message.
 o getSignature
  public abstract short getSignature()
return signature of this IOCI. range 0 to 0x7fff are reserved. If an IOCI is compatible with BasicIOCI, you can use the same signature. subtypes can be distinguished by options.
 o getMajorVersion
  public abstract short getMajorVersion()
return major version number of this IOCI.
 o getMinorVersion
  public abstract short getMinorVersion()
return minor version number of this IOCI.
 o connectServer
  public abstract void connectServer(String host,
                                     int port) throws IOException
connect to a server.
 o sendIOCISignature
  public abstract void sendIOCISignature() throws IOException
send signature of IOCI
 o invite
  public abstract void invite(HorbURL serverURL,
                              HorbURL clientURL,
                              String username,
                              String passwd) throws HORBException, NetException
invite a server object to a client object.
 o invite2
  public abstract void invite2(HorbURL serverURL,
                               String serverThreadName,
                               HorbURL clientURL,
                               String clientClassName,
                               String username,
                               String passwd) throws HORBException, IOException
invite a server object to a client object, second part.
 o invited
  public abstract void invited(String className,
                               HorbURL clientURL,
                               short major,
                               short minor,
                               String username,
                               String passwd) throws HORBException, NetException
connect to the client.
 o recvInvite
  public abstract NetIOCIInfo recvInvite() throws IOException
receiver part of invite().
 o startAsyncHandler
  public abstract void startAsyncHandler()
 o waitReceive
  public abstract void waitReceive(long timeout) throws InterruptedException, HORBException
 o isAsyncMethodEnd
  public abstract boolean isAsyncMethodEnd()
 o waitNoReceive
  public abstract boolean waitNoReceive(long timeout) throws InterruptedException
 o setHandler
  public abstract void setHandler(AsyncMethodHandler handler,
                                  int tag)
 o request
  public abstract void request() throws IOException
issue a request. This is called after sending arguments.
 o kick
  public abstract void kick() throws IOException
flush the output buffer to cause actual send
 o sendObject
  public abstract void sendObject(Object o,
                                  String expectedClassName,
                                  Loopy loopy) throws HORBException, IOException
Sends a object. The type of object is one of null object, remote object reference, or casted(narrowed) object. Returns true if the true class of 'o' is equal to 'expectedClass', Otherwise returns false. If true, the caller must send object by itself, otherwise need not.
Parameters:
o - Object to be passed.
expectedClassName - Name of expected class to be passed. If this class is equal to the class of parameter 'o', _sendInstance() of proxy class of 'expectedClassName' is used.
loopy - looping object checker.
Throws: ProxyException
couldn't instantiate a proxy object
Throws: HORBException
null object reference
Throws: IOException
network error
 o recvObject
  public abstract Object recvObject(String receiverClassName,
                                    Goldberg gb) throws HORBException, IOException
Receives an object. First receive what type of object (e.g. null object, object reference), and then receive object. If the the class of the receiving object is equal to 'expectedClassName', it's receiver class (expectedClassName_Proxy) is used to pass it in.
Parameters:
expectedClassName - Name of expected class to be passed in.
gb - another side of loop checker.
Throws: ProxyException
couldn't instantiate a proxy object
Throws: HORBException
illegal tag type is detected
Throws: IOException
network error
 o sendBoolean
  public abstract void sendBoolean(boolean value) throws IOException
send a boolean
 o sendBooleanArray
  public abstract void sendBooleanArray(boolean value[]) throws IOException
send an array of booleans
 o sendByte
  public abstract void sendByte(byte value) throws IOException
send a byte
 o sendByteArray
  public abstract void sendByteArray(byte value[]) throws IOException
send an array of bytes
 o sendChar
  public abstract void sendChar(char value) throws IOException
send a char
 o sendCharArray
  public abstract void sendCharArray(char value[]) throws IOException
send an array of chars
 o sendShort
  public abstract void sendShort(short value) throws IOException
send a short
 o sendShortArray
  public abstract void sendShortArray(short value[]) throws IOException
send an array of shorts
 o sendInt
  public abstract void sendInt(int value) throws IOException
send an int
 o sendIntArray
  public abstract void sendIntArray(int value[]) throws IOException
send an array of ints
 o sendLong
  public abstract void sendLong(long value) throws IOException
send a long
 o sendLongArray
  public abstract void sendLongArray(long value[]) throws IOException
send an array of longs
 o sendFloat
  public abstract void sendFloat(float value) throws IOException
send a float
 o sendFloatArray
  public abstract void sendFloatArray(float value[]) throws IOException
send an array of floats
 o sendDouble
  public abstract void sendDouble(double value) throws IOException
send a double
 o sendDoubleArray
  public abstract void sendDoubleArray(double value[]) throws IOException
send an array of doubles
 o sendString
  public abstract void sendString(String value) throws IOException
send a string
 o sendStringArray
  public abstract void sendStringArray(String value[]) throws IOException
send an array of Strings
 o recvBoolean
  public abstract boolean recvBoolean() throws IOException
receive a boolean
 o recvBooleanArray
  public abstract boolean[] recvBooleanArray() throws IOException
receive an array of booleans
 o recvByte
  public abstract byte recvByte() throws IOException
receive a byte
 o recvByteArray
  public abstract byte[] recvByteArray() throws IOException
receive an array of bytes
 o recvChar
  public abstract char recvChar() throws IOException
receive a char
 o recvCharArray
  public abstract char[] recvCharArray() throws IOException
receive an array of chars
 o recvShort
  public abstract short recvShort() throws IOException
receive a short
 o recvShortArray
  public abstract short[] recvShortArray() throws IOException
receive an array of shorts
 o recvInt
  public abstract int recvInt() throws IOException
receive an int
 o recvIntArray
  public abstract int[] recvIntArray() throws IOException
receive an array of ints
 o recvLong
  public abstract long recvLong() throws IOException
receive a long
 o recvLongArray
  public abstract long[] recvLongArray() throws IOException
receive an array of longs
 o recvFloat
  public abstract float recvFloat() throws IOException
receive a float
 o recvFloatArray
  public abstract float[] recvFloatArray() throws IOException
receive an array of floats
 o recvDouble
  public abstract double recvDouble() throws IOException
receive a double
 o recvDoubleArray
  public abstract double[] recvDoubleArray() throws IOException
receive an array of doubles
 o recvString
  public abstract String recvString() throws IOException
receive a string
 o recvStringArray
  public abstract String[] recvStringArray() throws IOException
receive an array of strings

All Packages  Class Hierarchy  This Package  Previous  Next  Index