Java Programming Question and Answers

29. What are all the requirements needed to build a CORBA program?
  For the Visigenics VisiBroker's environment to be set up, the following environment variables must be set up properly:
  • Path
  • Vbroker_adm
  • Classpath
The VisiBroker development environment includes:
  • Administration and programming tools
  • Java class files
  • ORB
  • Gatekeeper (for applets)
    The following VisiBroker tools are used:
  • Idl2ir – to populate an interface repository with interfaces defined in an IDL file.
  • Idl2java – Generates Java stubs and skeletons from an IDL file.
  • Java2iiop – Also called Caffeine compiler, it allows the usage of Java language rather than IDL to define interfaces to CORBA objects
  • Java2idl – One of the features of Caffeine creates an IDL from Java file.
    Some of the administrative tools of VisiBroker are:
  • irep – Starts an interface repository server
  • oadutil- List, registers and unregisters ORB object implementations
  • osagent – Starts Smart Agent which makes it easy to obtain object references
  • oadj – Starts OAD which activates a server, registers and unregisters, and lists objects.
Your Name Your Email-ID
Your Answer
30. What is an Interface Repository?
  • An Interface Repository (IR) is like a database of CORBA object interface information. An IR data describes interfaces (types).
  • The information in IR is equivalent to the information in IDL files, but it is represented in a way that is easier for the clients to use. Client use IR to learn about unknown objects interfaces and they use DII to invoke methods on the objects.
  • IR contains hierarchies of objects whose methods give information about interfaces. An IR contains ModuleDef objects, which can contain InterfaceDef objects, which can further contain OperationDef objects.
Your Name Your Email-ID
Your Answer
31. What is an Externalizable object?
  There are cases in which the programmer may need to have control over 'Serialization' and 'Deserialization' processes. For example, it may be desirable to use compression or encryption techniques. The Externalizable interface is designed for these situations which define the following methods;
  • void readExternal(ObjectInput inStream) throws IOException, ClassNotFoundException.
  • Void writeExternal(ObjectOutput outStream) throws IOException.
In these methods, instream is the byte stream from which the object is to be read, and outstream is the byte stream to which the object is to be written. The object that implements the Externalizable interface is called Externalizable object.
Your Name Your Email-ID
Your Answer
32. What mechanism is mostly used in RMI which enables a client behind a firewall to invoke a method on a remote object, which resides outside the firewall?
  The default RMI transport layer provides two alternate HTTP based mechanisms:
  • To get outside a firewall, the Transport layer embeds an RMI call within the firewall-trusted HTTP protocol.
  • The RMI call data is sent outside as the body of the HTTP POST request, and the return information is sent back in the body of the HTTP response. The Transport layer formulates the POST request in one of two ways.

  • a. If the firewall proxy will forward an HTTP request directed to an arbitrary port on the host machine, then it is forwarded directly to the port on which the RMI server is listening. The default RMI Transport layer on the target machine is listening with a server socket that is capable of understanding and decoding RMI calls inside POST requests.
    b. If the firewall proxy will only forward HTTP request directed to certain well known ports, then the call will be forwarded to the HTTP server listening on port 80 of the host machine, and a CGI script will be executed to forward the call to the target RMI server port on the same machine.
Your Name Your Email-ID
Your Answer
12345678 Page 8 of 8