How do I embed GigaSpaces in my project without any reference to the GigaSpaces installation ?

The rational behind the GigaSpaces libraries path:

The GigaSpaces depends on several components as parts of its environment.

Those framework includes Jini LUS, backport concurrent package and configuration bootstrapping utilities.

There are different approaches in which those libraries could packaged:

1 Single jar ??? While this may be tempting at first it introduces library compatibility and mintanability issues especially in cases where a user already have a different version of the libraries as part of he's project.

2. Separate jars in one classpath (System classloader) ??? In this option you will need to have a long list of libraries as part of the classpath. Beside for the inconveniency in some cases having all libraries as part of the System Classloder will lead to class resolution issues in a multi class loader environment.

3. Single Jar with Manifest class-path entry to dependency libraries ??? This approach provides the beneiftis of the two worlds i.e. the ability to maintain external reference to dependency jars which simplify the maintenance overhead and in addition to that keep the class-path short i.e. only the JSpaces.jar need to included in the classpath. The JVM will automatically add the libraries listed in the JSpaces.jar manifest into its classpath. The path location of those libraries is relative to the location of the JSpaces.jar.

Below is the content of the file which is part of the JSpaces.jar/META-INF

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.5.0_03-b07 (Sun Microsystems Inc.)
Main-Class: com.j_spaces.core.client.SpaceFinder
Build: 1382-008 20060215_1628
Built-By: ca
Implementation-Vendor: GigaSpaces Technologies
Class-Path: .. jini/jsk-platform.jar jini/jsk-lib.jar jini/start.jar r
 io/webster.jar common/backport-util-concurrent.jar rio/boot.jar log4j

Note that jini jars, backport and log4j jars are located on different sub directories.

The rational behind is to indicate that this list of jars shouldn't be part of the classpath ( as mentioned earlier they will be added automatically by the VM when it parses the class-path attribute of the JSpaces.jar manifest).

In order for the above will work the library structure need to be maintained in its exact directory structure. i.e. jini libraries need to be located under jini directory etc.

This thread was imported from the previous forum.
For your reference, the original is available here

asked 2006-03-21 15:56:05 -0500

bernard gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete