CS 441 Exam Questions
(T/F vs why)
1. For each of the following statements, indicate whether it is true or
false, and explain why it is true or false. (No credit is given
for just answering "true" or "false" without an explanation.)
So2.2 The java class ServerSocket is a subclass of the class Socket.
So2.3 The ServerSocket.accept method starts a thread to handle the
client connection.
So2.4 In the socket programs in the course notes and the first
programming assignment, the server's main
method accepts
connections
in a infinite loop and must be stopped via the operating system kill
command. If we want to allow stopping the server by typing "quit"
at the command line, another thread would be needed in the server
class. [or explain/code: thread & synch'd flag]
Se1.2 The class Frame is not serializable.
Se1.2 It is a compiler error to define a class that implements
Serializable
if it contains a field whose type is not
serializable.
Se1.3 Java default serialization copies the referent of every
non-static non-transient field to the output stream. [F: not
serailizable]
Se3.4 If a recipient virtual machine is deserializing an object and its
serial version UID for the object's class matches that in the stream,
but the recipient's version of the class has additional instance
variables, an exception occurs.
R1.3 Invoking a remote method can result in a ClassNotFoundException
on the server that handles the invocation, even if the server has
all the classes it needs to be compiled. (**or give 2 ways)
R2.3 An RMI remote object must be registered in an rmiregistry running
on the same host.
C2.2/5 A CORBA object reference cannot be converted to the
corresponding implementation class.
C2.2 In IDL, identifiers are case sensitive.
C2.4 The IDL-to-Java mapping maps structures to Java classes that are
serializable.
C4.4.5 A servant manager must be activated before registering it with
the POA.
C5.1.3 A corbaname
URL can be used to refer to any
non-local
CORBA object.
So1.3 Describe the primary functionality of server sockets and of
client sockets.
Se1.2 **NotSerializableExc when ....
Se 1.3 **default serialization: handling pointers, type identity, via
reflection
Se1.3 **why readObject signals ClassNotFoundExc
Se3.1 What is the meaing of the Java keyword transient
?
Se3.1 Give an example of a situation in which an instance vairable
would be declared transient.
Se3.2 **class with custom serialization
Se3.4 **versioning and serial version UID
R1.1 Describe three way in which remote method invocation improves
on the use of sockets for distributed programming.
[no encoding and parsing, easier to add, inheritance among remote objs,
don't need port for each object, object-oriented, simpler with multiple
remote objects, can signal exceptions]
R1.2 What is an RMI stub class? Describe its functionality.
R1.3 Describe the process of marshalling and unmarshalling with RMI.
R1.4 Why should remote object methods be idempotent?
R2.1 **rmic, rmiregistry (what is purpose of ...)
R2.2 Give the two requirements that methods in a remote interface must
satisfy that are not necessary for other interface methods, and explain
why each is necessary.
R2.3 **Naming
R2.4 In the course notes, we gave the following implementation of the
main
method for a remote server class:
public static void main(String[] args) {
System.setSecurityManager(new
RMISecurityManager());
try {
coolObj = new
CoolImpl(...);
Naming.rebind(“edu.uic.cs.cs441.CoolService”, coolObj);
}
catch (IOException ex) {
System.out.println(“Could not
register coolService”);
System.exit(1);
}
}
It appears that main
(and, therefore, the process)
terminates after binding the remote object. Explain why the
program does not terminate
R2.6 ** classpath for rmiregistry
C1.1 **RMI vs CORBA
C1.4 **execution semantics
C1.4 **no inheritance for CORBA exceptions
C1.5 **CORBA arch/terms: ORB, IDL compiler, DII & DSI, object
adapter, IR, services & facilities, GIOP & IIOP
C1.5 **CORBA vs RMI stubs (sim & diff) / RMI vs CORBA
marshalling
C2.4 **any
C2.5 What does it mean to designate an IDL operation as oneway
?
C2.5 **in, out, inout parameters
C2.6 Valuetypes were introduced in CORBA 3 to address two problems with
parameter passing. Describe them. [by value, null values]
C2 Define an IDL module for a simple bank account CORBA object as
follows:
1) a currency amount has two fields: a decimal number of up to ten
integer digits and two fraction digits and a currency indicator, for
which
there are three values: US dollars, Canadian dollars, and British pounds
2) accounts support the operations id and owner, both of which return a
string, and balance, withdraw and deposit; withdraw can raise an
OverdrawException, which contains the current balance and the withdrawn
amount
3) the account manager supports the operations createAccount, which
takes a string giving the owner and an initial balance, getAccount,
which takes the string ID and can raise InvalidIDException, and
getAllAccounts
C3.1 Describe the processing performed by a typical CORBA client
program main
method. [init ORB, get obj refs,
invoke, excs, orb.destroy]
C3.1 Describe the processing performed by a typical CORBA server
program main
method. [init ORB, POA(s) and
servants, export obj refs, activate POA mgr, orb.run, excs, orb.destroy]
C3.2.1 **IDL const in module
C3.2.2 **holder & helper classes, narrow
C3.2.3 In Java, RemoteException
is a checked exception,
but in the IDL-to-Java mapping, SystemException
is an
unchecked
exception. Which do you think is the correct choice for such
exceptions,
and why?
C3.2.3 **write the Java class that the IDL-to-Java mapping emits for
the following enum
C3.2.3 **no equals, toString for IDL structures, exceptions, enums
C3.2.6 **ops & sig intfs, holder, helper, stub, POA, POATie;
IntfPackage
C3.2.6 **purpose/impl of ops vs sig intfs
C3.2.6 **mapping an IDL type within an interface
C3.2.7 What is the purpose of the tie mechanism in the IDL-to-Java
mapping?
C3.2.7 Give a code example that demonstrates how to use the tie
mechanism to define and activate a servant. [servant impls ops extends
XXXPOATie,
pass servant to tie constructor, export tie not servant]
C3.2.7 Explain how to use the tie mechanism when defining and
activating a servant. (You may use a code example to clarify your
explanation.) [servant impls ops extends XXXPOATie, pass servant
to tie constructor, export tie not servant]
C4.1 **PIDL, local intfs
C4.2 **CORBA::Object
C4.3 **CORBA::ORB; resolve_initial_references, string_to_object,
object_to_string
C4.4.1 ** obj adap purpose, scalability, exs
C4.4.1 What are the primary responsibilities of an object
adapter? [create obj refs, map obj refs to servants]
C4.4.1 How does CORBA provide dynamic binding of the implementation of
a CORBA object? How does this differ from traditional programming
languages?
C4.4.1 **root POA, parent-child POAs
C4.4.2 ** 7 policies, PERSISTENT, AOM
C4.4.2 **uses of Servant Retention & Request Processing policy
C4.4.2 **What combination of POA policies would be used for each of the
following: a. **session, b. **shopping part c. ** patient.
Explain your
answer.
C4.4.2 Suppose a POA uses the IMPLICIT_ACTIVATION policy and the
program invokes servant_to_reference to obtain an object reference
immediately after creating a servant. Give two different POA
policies that would cause this invocation to raise WrongPolicy and
explain why each is invalid. [NON_RETAIN, MULTIPLE_ID]
C4.4.2 For each of the following POA operations, give a POA policy (or
a combination of POA policies) that would cause an invocation to raise
WrongPolicy and explain why that policy is invalid for that operation.
a. (de)activate_object, b. servant_to_reference, c.
create_reference, d. id_to_servant, e. set_servant
C4.4.3 **info in obj ref [intf, host & port, POA name, obj ID]
C4.4.3 ** creating obj ref [activate_object(_with_id),
create_reference(_with_id), servant_to_reference, _this]
C4.4.3 Carefully distinguish between the terms CORBA object, object
reference, and servant. [or 2]
C4.4.4 **def servant
C4.4.4-5 **set_servant(Servant) vs. set_servant_manager(ServantManager)
needs ref
C4.4.5 ** serv mgr: activator vs locator; subclass of
skeleton; purpose [lazy instantiation]; activate
C4.4.5 **serv act: incarnate if not in AOM; factory calls
create_ref (write to db), create servant in incarnate (read from db);
eviction, deactivate_object, etherealize
C4.4.5 **serv loc: preinvoke every call, postinvoke after (postinvoke
exc to client)
C4.4.5 **ForwardRequest
C4.4.6 **Poa mgr, POA states
C4.4.2&6 a. What does it mean to activate a servant? b. What
does it mean to activate a POA manager?
C4.4.7 **adapter activator
C5.1 Describe three capabilities that are provided by the CORBA
Interoperable Naming Service that are not available with the RMI naming
service.
C5.2.1 Describe three ways in which the notification provided by the
CORBA Event Service differs from that provided by the Java Observable
class.
C5.2.1 What is an event channnel in the CORBA Event Service? Give
three notification characteristics implemented by the event channel and
explain
how it does so. [loose coupling of suppliers and consumers,
non-blocking
notification, notification caching for pull, mixed-mode]
C5.2.1 **push/pull
C5.2.2 **pull vs try_pull
C5.2.2 **proxy supplier and consumer, admin objects,
channel.for_consumers().obtain_pull_supplier().connect_pull_consumer(...)
C5.2.3 **Notification Service