Defining HTTP Codebase and Port

  Search Here
Searching XAP 6.0 Documentation

                                               

Summary: How to externally set HTTP codebase and port using -Djava.rmi.server.codebase.

Overview

A codebase is how programs that use RMI remote classloading semantics find new classes. When the sender of an object serializes an object for transmission to another JVM, it annotates the serialized stream of bytes with information called the codebase. This information tells the receiver where the implementation of this object can be found.

There is a difference between who sets and who uses the codebase information. Any program that wants to pass an object to another program that might not recognize it must set the codebase, so that the receiver can know where to download the code from, if it doesn't have the code available locally. The receiver, upon deserializing the object, fetches the codebase from it and load the code from that location.

The actual information stored in the codebase annotation is a list of URLs from which the classfile for the needed object can be downloaded.

If you don't set a codebase, you can't pass an object to any program that doesn't have that object's classfile already available locally.

For more details, see: Jini Planet, How Codebase Works.

Defining HTTP codebase using -Djava.rmi.server.codebase

By default, GigaSpaces sets the codebase, and adds the JSpaces-dl.jar/JSpaces.jar, reggie-dl.jar (if reggie is used) and jsk-dl.jar files to it.

However, you can choose to pre-define you codebase using -Djava.rmi.server.codebase. In this case, no jar files are added by default, meaning you must add all of the relevant jar files yourself (in previous versions, even if you set the codebase externally, some jar files were added by default).

For the required jar files when using GigaSpaces, refer to the Setting Classpath section.

Defining HTTP Port

When externally defining your codebase, you define a port (in previous versions, the port number was defined dynamically). Make sure the port number you define in the codebase is the same port number you set in your container schema:

<embedded-services>
<!-- Starts a Webster HTTP Server embedded in the container VM
Default value: true -->
<httpd>
...

<!-- The host port the server socket HTTPD (Webster) is using is bound to.
Default value: port 9813 but if that is busy it generates an anonymous port-->
<explicit-binding-port>${com.gs.embedded-services.httpd.port}</explicit-binding-port>
<httpd>


IMPORTANT: This is an old version of GigaSpaces XAP. Click here for the latest version.
GigaSpaces 6.0 Documentation Contents (Current Page in Bold)

    Java

    C++

    .NET

    Middleware Capabilities

    Configuration and Management

Add GigaSpaces wiki search to your browser search engines!
(works on Firefox 2 and Internet Explorer 7)

Labels