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

Variable Index

 o debug
 o host
 o loopyCheck
 o netAddress
 o passwd
 o port
 o strict
 o url
 o username

Constructor Index

 o IOCICommon()

Method Index

 o acceptClassNo()
 o acceptMethod()
 o connect(HorbURL, String, short, short, String, String)
connect to object.
 o connectObject(HorbURL, String, short, short, String, String)
connect to an existing remote object.
 o connectServer(String, int)
 o createObject(HorbURL, String, short, short, String, String)
create a new remote object.
 o getNumArgs()
 o getProperty(int, Object)
 o getThreadName()
 o getUsername()
return username of the client.
 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)
 o isAsyncMethodEnd()
 o isConnected()
 o kick()
 o raiseIfException(short, String)
raise exception according to status
 o recvByte()
 o recvConnectObject()
receiver part of connectObject().
 o recvCreateObject()
receiver part of createObject().
 o recvInt()
 o recvInvite()
receiver part of invite().
 o recvObject(String, Goldberg, byte)
Receives an object.
 o recvPreamble()
 o recvShort()
 o recvStatus()
receive a status of execution
 o recvStatusNoCheck()
receive a status of execution without status check
 o recvString()
 o release()
 o request()
 o run()
receive status with blocking for an asynchronous method call.
 o selectMethod(int, int, int)
 o sendByte(byte)
 o sendInt(int)
 o sendIOCISignature()
 o sendObject(Object, String, Loopy, byte)
Sends a object.
 o sendShort(short)
 o sendStatus(short)
send status of method call.
 o sendString(String)
 o setHandler(AsyncMethodHandler, int)
 o setProperty(int, Object)
set propert of IOCI.
 o startAsyncHandler()
 o waitNoReceive(long)
 o waitNotify()
 o waitReceive(long)

Variables

 o loopyCheck
  protected boolean loopyCheck
 o strict
  protected boolean strict
 o debug
  protected boolean debug
 o port
  protected int port
 o url
  protected HorbURL url
 o host
  protected String host
 o netAddress
  protected byte netAddress[]
 o username
  protected String username
 o passwd
  protected String passwd

Constructors

 o IOCICommon
  public IOCICommon()

Methods

 o 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
 o 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.
 o recvCreateObject
  public NetIOCIInfo recvCreateObject() throws IOException
receiver part of createObject().
 o 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.
 o recvConnectObject
  public NetIOCIInfo recvConnectObject() throws IOException
receiver part of connectObject().
 o 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.
 o 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.
 o recvInvite
  public NetIOCIInfo recvInvite() throws IOException
receiver part of invite().
 o invited
  public void invited(String className,
                      HorbURL clientURL,
                      short major,
                      short minor,
                      String username,
                      String passwd) throws HORBException, IOException
 o startAsyncHandler
  public final void startAsyncHandler()
 o waitReceive
  public final void waitReceive(long timeout) throws InterruptedException, HORBException
 o run
  public void run()
receive status with blocking for an asynchronous method call.
 o waitNotify
  public synchronized void waitNotify()
 o isAsyncMethodEnd
  public final boolean isAsyncMethodEnd()
 o waitNoReceive
  public final synchronized boolean waitNoReceive(long timeout) throws InterruptedException
 o setHandler
  public final void setHandler(AsyncMethodHandler handler,
                               int tag)
 o selectMethod
  public final void selectMethod(int classNo,
                                 int methodNo,
                                 int numArgs) throws IOException
 o recvPreamble
  public final short recvPreamble() throws IOException
 o acceptClassNo
  public final short acceptClassNo() throws IOException
 o acceptMethod
  public final short acceptMethod() throws IOException
 o getNumArgs
  public final short getNumArgs() throws IOException
 o request
  public final void request() throws IOException
 o sendStatus
  public final void sendStatus(short status) throws IOException
send status of method call.
 o recvStatus
  public final short recvStatus() throws IOException, HORBException
receive a status of execution
 o recvStatusNoCheck
  public final short recvStatusNoCheck() throws IOException
receive a status of execution without status check
 o 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.
 o 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
 o 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
 o 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.
 o getProperty
  public Object getProperty(int request,
                            Object obj)
 o getThreadName
  public final String getThreadName()
 o getUsername
  public final String getUsername()
return username of the client. null means anonymous access.
 o connectServer
  public abstract void connectServer(String host,
                                     int port) throws IOException
 o sendIOCISignature
  public abstract void sendIOCISignature() throws IOException
 o kick
  public abstract void kick() throws IOException
 o release
  public abstract void release()
 o isConnected
  public abstract boolean isConnected()
 o sendByte
  public abstract void sendByte(byte value) throws IOException
 o sendShort
  public abstract void sendShort(short value) throws IOException
 o sendInt
  public abstract void sendInt(int value) throws IOException
 o sendString
  public abstract void sendString(String value) throws IOException
 o recvByte
  public abstract byte recvByte() throws IOException
 o recvShort
  public abstract short recvShort() throws IOException
 o recvInt
  public abstract int recvInt() throws IOException
 o recvString
  public abstract String recvString() throws IOException

All Packages  Class Hierarchy  This Package  Previous  Next  Index