Class horb.orb.IOCICommon
All Packages Class Hierarchy This Package Previous Next Index
Class horb.orb.IOCICommon
java.lang.Object
|
+----horb.orb.IOCICommon
- public class IOCICommon
- extends Object
- implements Runnable
protocol independent part of IOCI. Implementations of IOCI
must inherit this class. Programmers must use IOCIService
interface to access IOCI related services. Don't access
this class directly.
- See Also:
- IOCIService
-
debug
-
-
host
-
-
loopyCheck
-
-
netAddress
-
-
passwd
-
-
port
-
-
strict
-
-
url
-
-
username
-
-
IOCICommon()
-
-
acceptClassNo()
-
-
acceptMethod()
-
-
connect(HorbURL, String, short, short, String, String)
- connect to object.
-
connectObject(HorbURL, String, short, short, String, String)
- connect to an existing remote object.
-
connectServer(String, int)
-
-
createObject(HorbURL, String, short, short, String, String)
- create a new remote object.
-
getNumArgs()
-
-
getProperty(int, Object)
-
-
getThreadName()
-
-
getUsername()
- return username of the client.
-
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)
-
-
isAsyncMethodEnd()
-
-
isConnected()
-
-
kick()
-
-
raiseIfException(short, String)
- raise exception according to status
-
recvByte()
-
-
recvConnectObject()
- receiver part of connectObject().
-
recvCreateObject()
- receiver part of createObject().
-
recvInt()
-
-
recvInvite()
- receiver part of invite().
-
recvObject(String, Goldberg, byte)
- Receives an object.
-
recvPreamble()
-
-
recvShort()
-
-
recvStatus()
- receive a status of execution
-
recvStatusNoCheck()
- receive a status of execution without status check
-
recvString()
-
-
release()
-
-
request()
-
-
run()
- receive status with blocking for an asynchronous method call.
-
selectMethod(int, int, int)
-
-
sendByte(byte)
-
-
sendInt(int)
-
-
sendIOCISignature()
-
-
sendObject(Object, String, Loopy, byte)
- Sends a object.
-
sendShort(short)
-
-
sendStatus(short)
- send status of method call.
-
sendString(String)
-
-
setHandler(AsyncMethodHandler, int)
-
-
setProperty(int, Object)
- set propert of IOCI.
-
startAsyncHandler()
-
-
waitNoReceive(long)
-
-
waitNotify()
-
-
waitReceive(long)
-
loopyCheck
protected boolean loopyCheck
strict
protected boolean strict
debug
protected boolean debug
port
protected int port
url
protected HorbURL url
host
protected String host
netAddress
protected byte netAddress[]
username
protected String username
passwd
protected String passwd
IOCICommon
public IOCICommon()
connect
public HorbURL connect(HorbURL url,
String className,
short major,
short minor,
String username,
String passwd) throws HORBException, NetException
- connect to object.
- Parameters:
- url - HorbURL of the remote machine.
- 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.
- Throws: HORBException
- object not found in remote system, or can't create IOCI
- Throws: NetException
- Network error
createObject
public HorbURL createObject(HorbURL url,
String className,
short major,
short minor,
String username,
String passwd) throws HORBException
- 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 NetIOCIInfo recvCreateObject() throws IOException
- receiver part of createObject().
connectObject
public HorbURL connectObject(HorbURL url,
String className,
short major,
short minor,
String username,
String passwd) throws 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 NetIOCIInfo recvConnectObject() throws IOException
- receiver part of connectObject().
invite
public void invite(HorbURL serverUrl,
HorbURL clientURL,
String username,
String passwd) throws HORBException
- invite a server object to a client object. In order to prevent
someone to use invitation as a covert channel, here is key checking, too.
invite2
public 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.
recvInvite
public NetIOCIInfo recvInvite() throws IOException
- receiver part of invite().
invited
public void invited(String className,
HorbURL clientURL,
short major,
short minor,
String username,
String passwd) throws HORBException, IOException
startAsyncHandler
public final void startAsyncHandler()
waitReceive
public final void waitReceive(long timeout) throws InterruptedException, HORBException
run
public void run()
- receive status with blocking for an asynchronous method call.
waitNotify
public synchronized void waitNotify()
isAsyncMethodEnd
public final boolean isAsyncMethodEnd()
waitNoReceive
public final synchronized boolean waitNoReceive(long timeout) throws InterruptedException
setHandler
public final void setHandler(AsyncMethodHandler handler,
int tag)
selectMethod
public final void selectMethod(int classNo,
int methodNo,
int numArgs) throws IOException
recvPreamble
public final short recvPreamble() throws IOException
acceptClassNo
public final short acceptClassNo() throws IOException
acceptMethod
public final short acceptMethod() throws IOException
getNumArgs
public final short getNumArgs() throws IOException
request
public final void request() throws IOException
sendStatus
public final void sendStatus(short status) throws IOException
- send status of method call.
recvStatus
public final short recvStatus() throws IOException, HORBException
- receive a status of execution
recvStatusNoCheck
public final short recvStatusNoCheck() throws IOException
- receive a status of execution without status check
raiseIfException
public final void raiseIfException(short status,
String s) 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.
sendObject
public void sendObject(Object o,
String expectedClassName,
Loopy loopy,
byte place) throws HORBException, IOException, ProxyException
- 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.
- place - IOCI.LOC_*. for example, LOC_FILE, LOC_NETWORK..
- Throws: ProxyException
- couldn't instantiate a proxy object
- Throws: HORBException
- null object reference
- Throws: IOException
- network error
recvObject
public Object recvObject(String expectedClassName,
Goldberg gb,
byte place) throws HORBException, IOException, ProxyException
- 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.
- place - IOCI.LOC_*. for example, LOC_FILE, LOC_NETWORK..
- Throws: ProxyException
- couldn't instantiate a proxy object
- Throws: HORBException
- illegal tag type is detected
- Throws: IOException
- network error
setProperty
public void setProperty(int request,
Object obj)
- set propert of IOCI.
setProperty(IOCI.PROP_DEBUG, null) turns debug flag true.
setProperty(IOCI.PROP_NO_DEBUG, null) turns debug flag false.
setProperty(IOCI.PROP_STRICT, null) turns strict flag true.
setProperty(IOCI.PROP_NO_STRICT, null) turns strict flag false.
getProperty
public Object getProperty(int request,
Object obj)
getThreadName
public final String getThreadName()
getUsername
public final String getUsername()
- return username of the client. null means anonymous access.
connectServer
public abstract void connectServer(String host,
int port) throws IOException
sendIOCISignature
public abstract void sendIOCISignature() throws IOException
kick
public abstract void kick() throws IOException
release
public abstract void release()
isConnected
public abstract boolean isConnected()
sendByte
public abstract void sendByte(byte value) throws IOException
sendShort
public abstract void sendShort(short value) throws IOException
sendInt
public abstract void sendInt(int value) throws IOException
sendString
public abstract void sendString(String value) throws IOException
recvByte
public abstract byte recvByte() throws IOException
recvShort
public abstract short recvShort() throws IOException
recvInt
public abstract int recvInt() throws IOException
recvString
public abstract String recvString() throws IOException
All Packages Class Hierarchy This Package Previous Next Index