Week 11 Flashcards

1
Q

What is dynamic code loading in RMI?

A

Enables downloading class definitions along with object references during remote method invocation

Allows introducing new behaviors and types to a JVM at runtime

Requires that class definitions are available in a network-accessible location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are class loaders in Java?

A

Responsible for loading classes into the JVM

Types of class loaders:

Bootstrap Class Loader: Loads core Java libraries

Extensions Class Loader: Loads from platform-specific extension directories

System Class Loader: Loads from the current directory or CLASSPATH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How does the class loading process work?

A

Precedence: Bootstrap → Extensions → System

Example process:

Y y = new Y();

is internally executed as:

Y y = X.class.getClassLoader().loadClass(“Y”).newInstance();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Can you develop custom class loaders?

A

Yes, by extending java.lang.ClassLoader

Enables adding new classes dynamically at runtime without restarting the application

Often leveraged by RMI for dynamic behavior

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are stubs in RMI?

A

Client-side proxies that represent remote objects

Implement the same interfaces as the remote object, enabling seamless method calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the RMI architecture?

A

Application Layer: Contains client and server programs

Stub and Skeleton Layer: Handles method invocation and redirection

Remote Reference Layer: Manages remote object references

Transport Layer: Based on TCP/IP for communication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do distributed and non-distributed models differ?

A

Distributed model:

Clients interact with remote interfaces, not implementation classes

Non-remote arguments/results are passed by copy

Remote objects are passed by reference

Remote method invocations can fail due to network or remote errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How are distributed and non-distributed models similar?

A

Both can:

Pass remote object references as arguments or results

Use casting with remote interfaces

Use instanceof to check remote interface compatibility

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the limitations of RMI?

A

Requires all class definitions to be accessible

Additional exceptions for remote invocations

Performance overhead due to serialization and network latency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How is RMI used in enterprise applications?

A

Enables distributed services across multiple machines

Supports dynamic runtime behavior through class loading

Common in thin-client architectures where the server handles most processing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly