Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Generic Worker configuration

I wanted to use the IWorker interface defined in the Gigaspaces API - clearly there's some kind of XML file that can be used to set the thing up, but the instructions just aren't detailed enough:

1) Where does the [spacename].xml file have to live? Is this on the space's classpath, or somewhere else?

2) Is it possible to have the code for the worker in some codebase somewhere (i.e. not on the space's classpath) and, if so, how do I set that up? (i.e. where do I tell the space what the codebase is?)

3) Can the XML file live at the codebase too, and how would I set that up?

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2268]{quote}

asked 2006-05-22 18:30:01 -0500

toby gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

See below:
To setup the IWorker implementation class you need to modify the space schema file - i.e.
GigaSpaces Root\config\schemas\cache-space-schema.xml

See the *workers *section

If you are uing gsServer to run the space this will be picked up.
If you are using gsInstance to run the space make sure <GigaSpacesEE5.0 Root> will be part server CLASSPATH. One way to do that is by running gsInstance with the following parameters:
gsInstance Embdded Space URL CLASSPATH to Apend
gsInstance "/./mySpace?schema=cache" "D:\GigaSpacesEE5.0;..\AppLicationclassesPath"

To access this space from your application use:
IJSpace space = (IJSpace)SpaceFinder.find("jini:////mySpace");

Yes - yo can place the worker code at the codebase. GigaSpaces runs webster embedded. You can configure it via the :
<GigaSpaces Root>\config\schemas\cache-container-schema.xml

                <!-- Starts a Webster HTTP Server embedded in the container VM 
                Default value: true -->
                    <!-- The additional root(s) to serve code from. This is a semi-colin delimited list of directories.
                    For example dir1;dir2 Default value: null no additional roots. The system uses the predefined 
                    roots com.gs.hom/lib;com.gs.home/lib/jini -->
                    <!-- The host address the server socket HTTPD (Webster) is using is bound to. 
                    Relevant for multi NIC environment. 
                    Default value: resolved to localhost ip address. -->

See also:
<GigaSpaces Root>\config\services\start-gigaspaces.config and the javaSpaceCodebase

See above.

answered 2006-05-26 03:25:02 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2006-05-22 18:30:01 -0500

Seen: 16 times

Last updated: May 26 '06