Chapter 19. Dynamic Classloading

Deploying a distributed application can be rather difficult. All of the computers that run parts of the application must have the relevant parts installed. For a local area network, this is usually a time-consuming, but not particularly difficult, process. However, when applications are deployed on a larger scale, and updated frequently, the deployment process becomes far more difficult.

Dynamic classloading is a technology, built into RMI, which attempts to make this deployment a little easier. At this point in the book, we’ve covered most of the basics of building a robust and scalable distributed application. We’ve gone through the rules for designing interfaces, we’ve spent a lot of time discussing threads, we’ve covered testing a distributed application, and we’ve even discussed how to optimize the distributed garbage collector. Now it’s time to dig deep into the task of deploying (and redeploying) an application.

Deploying Can Be Difficult

Let’s start by supposing that we’re deploying the latest version of the banking application. We need to do the following:

  • Configure the server machines.

  • Add the stub classes to the naming service classpath, along with any other classes, such as socket factories and value objects, that might need to be instantiated inside the naming service.

  • If this is a redeployment, as opposed to a first-time deployment, you’ll probably have to restart the naming service and reregister all the objects to get rid of the ...

Get Java RMI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.