|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Deprecated public interface IWorker
This interface represents a generic space worker.
Default public constructor must be defined for every implemented worker.
On create/init space the init() method will be called.
On destroy and shutdown space, the close() method will be called.
To setup the IWorker implementation class you need to modify the space schema file - i.e.
<GigaSpaces Root>\config\schemas\<Schema Name>-space-schema.xml
For example: If you are using the cache schema you should modify the following file:
<GigaSpaces Root>\config\schemas\cache-space-schema.xml
If you are using gsInstance to run the space make sure will be part space CLASSPATH.
One way to do that is by running gsInstance with the following parameters:
gsInstance SPACE_URL CLASSPATH_TO_APPEND
Example:
gsInstance "/./mySpace?schema=cache" "c:\GigaSpacesEE5.0;..\AppLicationClasspath"
The space schema should have the following defined:
<space-config>
<workers>
<worker-names>MonitorWorker, StatisticWorker</worker-names>
<MonitorWorker>
<enabled>true</enabled>
<class-name>test.MonitorWorker</class-name>
<arg>file:///usr/root/my-monitor-worker-prop.xml</arg>
<description>Provides Space monitor capabilities</description>
</MonitorWorker>
<StatisticWorker>
<enabled>true</enabled>
<class-name>test.StatisticWorker</class-name>
<arg></arg>
<description></description>
</StatisticWorker>
</workers>
</space-config>
See more about IWroker here:
http://www.gigaspaces.com/wiki/display/GS/Space+Worker+-+Space+Schema
http://www.gigaspaces.com/wiki/display/GS/Partitioned+Space+Topology - Partitioned Space with IWorker Implementation
Method Summary | |
---|---|
void |
close()
Deprecated. This method should close by proper way the initialized worker, include all internal worker's Threads. |
void |
init(IJSpace proxy,
String workerName,
String arg)
Deprecated. This method will be called on space initialization. |
Methods inherited from interface java.lang.Runnable |
---|
run |
Method Detail |
---|
void init(IJSpace proxy, String workerName, String arg) throws Exception
proxy
- Space proxy.workerName
- Worker name.arg
- Any user defined argument.
Exception
- Failed to initialize worker.void close()
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |