8. Deploying From a Remote Codebase

SwitchRMI supports declaration of objects with classes or scripts to be loaded from a remote codebase, The deployment descriptor may also declare URLs for any libraries required by the deployed object which are not already loaded in the SwitchRMI container.

Publishing a Scripted Object Service from a Remote Codebase

The JUnit test suites shipped with SwitchRMI include an example of a Javascript source file published as a SwitchRMI object in which the source file for the script is deployed from a remote URL:

		
		<object name="jsRemoteEcho" scope="request">
			<script source="http://localhost:8080/test/script/RemoteEcho.js" />
			<interface class="com.mjh.switchrmi.script.JSEcho" />
		</object>
		
The client declares the object in the same was as any other:
	
		<proxy name="jsRemoteEcho">
			<remote url="http://localhost:8080/rmi/jsRemoteEcho.xmlrpc" />				
			<interface class="com.mjh.switchrmi.script.JSEcho" />
			<description>
				The jsEcho object is included to allow testing of the SwitchRMI installation.
			</description>
		</proxy>
		
and accesses it in the same way:
	
		jsEcho = (JSEcho)jndiCtx.lookup("/switchrmi/client/proxy/jsRemoteEcho");