|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.core.space.support.WorkerAdapter
public class WorkerAdapter
An adapter class that can run legacy IWorker
implementations
as beans providing the same behavior when configured within a Space.
Note, the adapter aims to simplify the migration from "worker" based applications to the new processing unit architecture.
Constructor Summary | |
---|---|
WorkerAdapter()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
void |
destroy()
|
void |
onApplicationEvent(ApplicationEvent applicationEvent)
|
void |
setActiveWhenBackup(boolean activeWhenBackup)
Should the worker be active only when the Space is in primary mode. |
void |
setArgument(String argument)
Provides an optional argument that will be passed to IWorker.init(com.j_spaces.core.IJSpace, String, String)
(the last argument). |
void |
setGigaSpace(GigaSpace gigaSpace)
Sets the GigaSpace that will be used to pass an IJSpace
instance to the worker init method. |
void |
setWorker(IWorker worker)
Provides the worker implementation that will be run. |
void |
setWorkerName(String workerName)
Sets the worker name that will be used as the second parameter to the worker init method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkerAdapter()
Method Detail |
---|
public void setWorker(IWorker worker)
public void setGigaSpace(GigaSpace gigaSpace)
GigaSpace
that will be used to pass an IJSpace
instance to the worker init method.
public void setArgument(String argument)
IWorker.init(com.j_spaces.core.IJSpace, String, String)
(the last argument).
public void setWorkerName(String workerName)
public void setActiveWhenBackup(boolean activeWhenBackup)
false
. Setting
this to true
means that the worker will start regardless of the space state.
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
public void onApplicationEvent(ApplicationEvent applicationEvent)
onApplicationEvent
in interface ApplicationListener
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |