Reloading Modules

To reload all Union modules at once, restart Union Server. After Union Server restarts, any module that is subsequently loaded into memory will use the latest code in the server's /modules/ directory.

To reload an individual Union module without restarting Union Server, follow the steps in the sections below.

Reloading a Room Module Written in Java

  1. First, clear the module cache using one of the techniques listed below under "Clearing Union's Module Cache".
  2. Next, remove the module's room.
  3. Finally, recreate the module's room.

Reloading a Room Module Written in a Scripting Language

To reload a script-based module, simply remove and then recreate the module's room. Modules written in JavaScript and other scripting languages are not cached by Union Server, so the module cache does not need not be cleared.

Reloading a Server Module Written in Java

  1. First, clear the module cache using one of the techniques listed below under "Clearing Union's Module Cache".
  2. Next, remove the module by calling shutdown() on the module object (the object that implements the Module interface).
  3. Finally, recreate the module by passing a new ModuleDef object to Server object's createModule() method.

Reloading Server Modules Written in a Scripting Language

To reload script-based modules, follow these steps:

  1. Remove the module by calling shutdown() on the module object (the object that implements the Module interface).
  2. Recreate the module by passing a new ModuleDef object to Server object's createModule() method.

Modules written in JavaScript and other scripting languages are not cached by Union Server, so the module cache does not need not be cleared before the preceding steps are performed.

Clearing Union's Module Cache

Union's module cache can be cleared via Union Admin or the command line, as follows:

  • In Union Admin (requires Union 1.0.2 or higher), on the Modules tab, click Clear Module Cache.

- or -

  • From the command line, issue one of the following commands in the UNION_HOME directory:
    • Union Server 1.0.0 and 1.0.1:
      java -cp lib/union.jar:lib/mariner.jar net.user1.union.core.UnionMain HOST PORT PASSWORD a18
      
    • Union Server 1.0.2 and higher:
      java -cp lib/union.jar:lib/mariner.jar net.user1.union.core.UnionMain HOST PORT PASSWORD u153
      

    In the preceding code, for HOST, PORT, and PASSWORD, specify the server's admin IP (typically "localhost"), admin port, and admin password as listed in union.xml.