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.
-
LOC_FILE
- object is transfered to/from file.
-
LOC_NETWORK
- object is transfered to/from network.
-
OBJ_CAST
- usual instance, but casted to something is passed.
-
OBJ_INST
- usual instance is passed.
-
OBJ_LOOPY
- looped object is passed.
-
OBJ_NO_PROXY
- no proxy class was found.
-
OBJ_NULL
- null instance is passed.
-
OBJ_REF
- remote object reference is passed.
-
OBJ_STRING
- String is passed.
-
ORB_CLOSE
- disconnect to the object.
-
ORB_CONNECT_TO_INSTANCE
- connect to existent object.
-
ORB_CREATE_INSTANCE
- create a new object.
-
ORB_INVITE_TO_INSTANCE
- invite a server object to access a client object.
-
PREAMBLE
- preamble for each remote method call
-
STAT_CLASS_VERSION_MISMATCH
- class major version mismatch
-
STAT_EXCEPTION_IN_ARGUMENT
- exception occured during sending arguments
-
STAT_EXCEPTION_IN_METHOD
- exception occured during execution of the method
-
STAT_IOCI_NOT_FOUND
- requsted IOCI class not found
-
STAT_IOCI_VERSION_MISMATCH
- IOCI major version mismatch
-
STAT_NO_ERROR
- method call ended with no error
-
STAT_NO_SUCH_METHOD
- requested method not found
-
STAT_NO_SUCH_OBJECT
- requested object or class not found
-
STAT_PERMISSION_ERROR
- access is denied
-
STAT_PREAMBLE_MISMATCH
- connection is not syncronized.
-
acceptClassNo()
- receive a class number
-
acceptMethod()
- receive a method number
-
connect(HorbURL, String, short, short, String, String)
- connect to an object.
-
connectObject(HorbURL, String, short, short, String, String)
- connect to an existing remote object.
-
connectServer(String, int)
- connect to a server.
-
createObject(HorbURL, String, short, short, String, String)
- create a new remote object.
-
getMajorVersion()
- return major version number of this IOCI.
-
getMinorVersion()
- return minor version number of this IOCI.
-
getNumArgs()
- receive the number of arguments for a method
-
getSignature()
- return signature of this IOCI.
-
invite(HorbURL, HorbURL, String, String)
- invite a server object to a client object.
-
invite2(HorbURL, String, HorbURL, String, String, String)
- invite a server object to a client object, second part.
-
invited(String, HorbURL, short, short, String, String)
- connect to the client.
-
isAsyncMethodEnd()
-
-
kick()
- flush the output buffer to cause actual send
-
raiseIfException(short, String)
- raise exception according to status
-
recvBoolean()
- receive a boolean
-
recvBooleanArray()
- receive an array of booleans
-
recvByte()
- receive a byte
-
recvByteArray()
- receive an array of bytes
-
recvChar()
- receive a char
-
recvCharArray()
- receive an array of chars
-
recvConnectObject()
- receiver part of connectObject().
-
recvConnectServer()
- receive connect request from client.
-
recvCreateObject()
- receiver part of createObject().
-
recvDouble()
- receive a double
-
recvDoubleArray()
- receive an array of doubles
-
recvFloat()
- receive a float
-
recvFloatArray()
- receive an array of floats
-
recvInt()
- receive an int
-
recvIntArray()
- receive an array of ints
-
recvInvite()
- receiver part of invite().
-
recvLong()
- receive a long
-
recvLongArray()
- receive an array of longs
-
recvObject(String, Goldberg)
- Receives an object.
-
recvPreamble()
- receive a preamble
-
recvShort()
- receive a short
-
recvShortArray()
- receive an array of shorts
-
recvStatus()
- receive a status of execution
-
recvStatusNoCheck()
- receive a status of execution without status check
-
recvString()
- receive a string
-
recvStringArray()
- receive an array of strings
-
request()
- issue a request.
-
selectMethod(int, int, int)
- select a remote method
-
sendBoolean(boolean)
- send a boolean
-
sendBooleanArray(boolean[])
- send an array of booleans
-
sendByte(byte)
- send a byte
-
sendByteArray(byte[])
- send an array of bytes
-
sendChar(char)
- send a char
-
sendCharArray(char[])
- send an array of chars
-
sendDouble(double)
- send a double
-
sendDoubleArray(double[])
- send an array of doubles
-
sendFloat(float)
- send a float
-
sendFloatArray(float[])
- send an array of floats
-
sendInt(int)
- send an int
-
sendIntArray(int[])
- send an array of ints
-
sendIOCISignature()
- send signature of IOCI
-
sendLong(long)
- send a long
-
sendLongArray(long[])
- send an array of longs
-
sendObject(Object, String, Loopy)
- Sends a object.
-
sendShort(short)
- send a short
-
sendShortArray(short[])
- send an array of shorts
-
sendStatus(short)
- send status of method call.
-
sendString(String)
- send a string
-
sendStringArray(String[])
- send an array of Strings
-
serverAccept(int)
-
accept new connection request.
-
serverInit(int)
- initialize IOCI for server port.
-
setHandler(AsyncMethodHandler, int)
-
-
startAsyncHandler()
-
-
waitNoReceive(long)
-
-
waitReceive(long)
-
ORB_CREATE_INSTANCE
public final static short ORB_CREATE_INSTANCE
- create a new object.
ORB_CONNECT_TO_INSTANCE
public final static short ORB_CONNECT_TO_INSTANCE
- connect to existent object.
ORB_CLOSE
public final static short ORB_CLOSE
- disconnect to the object.
ORB_INVITE_TO_INSTANCE
public final static short ORB_INVITE_TO_INSTANCE
- invite a server object to access a client object.
PREAMBLE
public final static short PREAMBLE
- preamble for each remote method call
STAT_NO_ERROR
public final static short STAT_NO_ERROR
- method call ended with no error
STAT_NO_SUCH_OBJECT
public final static short STAT_NO_SUCH_OBJECT
- requested object or class not found
STAT_NO_SUCH_METHOD
public final static short STAT_NO_SUCH_METHOD
- requested method not found
STAT_EXCEPTION_IN_METHOD
public final static short STAT_EXCEPTION_IN_METHOD
- exception occured during execution of the method
STAT_EXCEPTION_IN_ARGUMENT
public final static short STAT_EXCEPTION_IN_ARGUMENT
- exception occured during sending arguments
STAT_PREAMBLE_MISMATCH
public final static short STAT_PREAMBLE_MISMATCH
- connection is not syncronized. reconnect!
STAT_PERMISSION_ERROR
public final static short STAT_PERMISSION_ERROR
- access is denied
STAT_IOCI_VERSION_MISMATCH
public final static short STAT_IOCI_VERSION_MISMATCH
- IOCI major version mismatch
STAT_IOCI_NOT_FOUND
public final static short STAT_IOCI_NOT_FOUND
- requsted IOCI class not found
STAT_CLASS_VERSION_MISMATCH
public final static short STAT_CLASS_VERSION_MISMATCH
- class major version mismatch
OBJ_NULL
public final static byte OBJ_NULL
- null instance is passed.
OBJ_REF
public final static byte OBJ_REF
- remote object reference is passed.
OBJ_INST
public final static byte OBJ_INST
- usual instance is passed.
OBJ_CAST
public final static byte OBJ_CAST
- usual instance, but casted to something is passed.
OBJ_LOOPY
public final static byte OBJ_LOOPY
- looped object is passed. this object was passed once
OBJ_NO_PROXY
public final static byte OBJ_NO_PROXY
- no proxy class was found. object was ignored
OBJ_STRING
public final static byte OBJ_STRING
- String is passed.
LOC_NETWORK
public final static byte LOC_NETWORK
- object is transfered to/from network.
LOC_FILE
public final static byte LOC_FILE
- object is transfered to/from file.
serverInit
public abstract void serverInit(int port) throws IOException
- initialize IOCI for server port.
- Parameters:
- port - port to serve by this HORB server.
serverAccept
public abstract IOCI serverAccept(int port) throws IOException
- accept new connection request.
- Parameters:
- port - port to listen
- Returns:
- new IOCI object.
recvConnectServer
public abstract boolean recvConnectServer() throws IOException
- receive connect request from client. This is the counter part of connectServer().
recvPreamble
public abstract short recvPreamble() throws IOException
- receive a preamble
acceptClassNo
public abstract short acceptClassNo() throws IOException
- receive a class number
acceptMethod
public abstract short acceptMethod() throws IOException
- receive a method number
getNumArgs
public abstract short getNumArgs() throws IOException
- receive the number of arguments for a method
sendStatus
public abstract void sendStatus(short status) throws IOException
- send status of method call.
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.
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.
recvCreateObject
public abstract NetIOCIInfo recvCreateObject() throws IOException
- receiver part of createObject().
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.
recvConnectObject
public abstract NetIOCIInfo recvConnectObject() throws IOException
- receiver part of connectObject().
selectMethod
public abstract void selectMethod(int classNo,
int methodNo,
int numArgs) throws IOException
- select a remote method
recvStatus
public abstract short recvStatus() throws IOException, HORBException
- receive a status of execution
recvStatusNoCheck
public abstract short recvStatusNoCheck() throws IOException
- receive a status of execution without status check
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.
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.
getMajorVersion
public abstract short getMajorVersion()
- return major version number of this IOCI.
getMinorVersion
public abstract short getMinorVersion()
- return minor version number of this IOCI.
connectServer
public abstract void connectServer(String host,
int port) throws IOException
- connect to a server.
sendIOCISignature
public abstract void sendIOCISignature() throws IOException
- send signature of IOCI
invite
public abstract void invite(HorbURL serverURL,
HorbURL clientURL,
String username,
String passwd) throws HORBException, NetException
- invite a server object to a client object.
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.
invited
public abstract void invited(String className,
HorbURL clientURL,
short major,
short minor,
String username,
String passwd) throws HORBException, NetException
- connect to the client.
recvInvite
public abstract NetIOCIInfo recvInvite() throws IOException
- receiver part of invite().
startAsyncHandler
public abstract void startAsyncHandler()
waitReceive
public abstract void waitReceive(long timeout) throws InterruptedException, HORBException
isAsyncMethodEnd
public abstract boolean isAsyncMethodEnd()
waitNoReceive
public abstract boolean waitNoReceive(long timeout) throws InterruptedException
setHandler
public abstract void setHandler(AsyncMethodHandler handler,
int tag)
request
public abstract void request() throws IOException
- issue a request. This is called after sending arguments.
kick
public abstract void kick() throws IOException
- flush the output buffer to cause actual send
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
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
sendBoolean
public abstract void sendBoolean(boolean value) throws IOException
- send a boolean
sendBooleanArray
public abstract void sendBooleanArray(boolean value[]) throws IOException
- send an array of booleans
sendByte
public abstract void sendByte(byte value) throws IOException
- send a byte
sendByteArray
public abstract void sendByteArray(byte value[]) throws IOException
- send an array of bytes
sendChar
public abstract void sendChar(char value) throws IOException
- send a char
sendCharArray
public abstract void sendCharArray(char value[]) throws IOException
- send an array of chars
sendShort
public abstract void sendShort(short value) throws IOException
- send a short
sendShortArray
public abstract void sendShortArray(short value[]) throws IOException
- send an array of shorts
sendInt
public abstract void sendInt(int value) throws IOException
- send an int
sendIntArray
public abstract void sendIntArray(int value[]) throws IOException
- send an array of ints
sendLong
public abstract void sendLong(long value) throws IOException
- send a long
sendLongArray
public abstract void sendLongArray(long value[]) throws IOException
- send an array of longs
sendFloat
public abstract void sendFloat(float value) throws IOException
- send a float
sendFloatArray
public abstract void sendFloatArray(float value[]) throws IOException
- send an array of floats
sendDouble
public abstract void sendDouble(double value) throws IOException
- send a double
sendDoubleArray
public abstract void sendDoubleArray(double value[]) throws IOException
- send an array of doubles
sendString
public abstract void sendString(String value) throws IOException
- send a string
sendStringArray
public abstract void sendStringArray(String value[]) throws IOException
- send an array of Strings
recvBoolean
public abstract boolean recvBoolean() throws IOException
- receive a boolean
recvBooleanArray
public abstract boolean[] recvBooleanArray() throws IOException
- receive an array of booleans
recvByte
public abstract byte recvByte() throws IOException
- receive a byte
recvByteArray
public abstract byte[] recvByteArray() throws IOException
- receive an array of bytes
recvChar
public abstract char recvChar() throws IOException
- receive a char
recvCharArray
public abstract char[] recvCharArray() throws IOException
- receive an array of chars
recvShort
public abstract short recvShort() throws IOException
- receive a short
recvShortArray
public abstract short[] recvShortArray() throws IOException
- receive an array of shorts
recvInt
public abstract int recvInt() throws IOException
- receive an int
recvIntArray
public abstract int[] recvIntArray() throws IOException
- receive an array of ints
recvLong
public abstract long recvLong() throws IOException
- receive a long
recvLongArray
public abstract long[] recvLongArray() throws IOException
- receive an array of longs
recvFloat
public abstract float recvFloat() throws IOException
- receive a float
recvFloatArray
public abstract float[] recvFloatArray() throws IOException
- receive an array of floats
recvDouble
public abstract double recvDouble() throws IOException
- receive a double
recvDoubleArray
public abstract double[] recvDoubleArray() throws IOException
- receive an array of doubles
recvString
public abstract String recvString() throws IOException
- receive a string
recvStringArray
public abstract String[] recvStringArray() throws IOException
- receive an array of strings
All Packages Class Hierarchy This Package Previous Next Index