|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ha.framework.server.HAServiceImpl<E>
E
- type of event generated by this servicepublic class HAServiceImpl<E extends EventObject>
Base class for clustered services. Provides clustered event facility.
Nested Class Summary | |
---|---|
protected class |
HAServiceImpl.RpcHandler
|
Field Summary | |
---|---|
protected org.jboss.logging.Logger |
log
|
Constructor Summary | |
---|---|
HAServiceImpl(EventFactory<E> eventFactory)
|
|
HAServiceImpl(EventFactory<E> eventFactory,
EventFacility<E> eventFacility)
|
Method Summary | ||
---|---|---|
void |
addEventListener(EventListener<E> listener)
|
|
protected void |
callAsyncMethodOnPartition(String methodName,
Object[] args,
Class<?>[] types)
|
|
protected
|
callMethodOnPartition(String methodName,
Object[] args,
Class<?>[] types)
|
|
void |
create()
|
|
void |
destroy()
|
|
protected EventFacility<E> |
getEventFacility()
|
|
protected EventFactory<E> |
getEventFactory()
|
|
HAPartition |
getHAPartition()
Get the underlying partition used by this service. |
|
String |
getHAServiceKey()
Get the key used to identify a service within a clustering service. |
|
protected Serializable |
getReplicant()
|
|
protected HAServiceRpcHandler<E> |
getRpcHandler()
|
|
String |
getServiceHAName()
|
|
void |
handleEvent(E event)
|
|
boolean |
isRegisterThreadContextClassLoader()
Test whether the thread context classloader should be used in RPC calls. |
|
void |
notifyListeners(E event)
|
|
protected void |
partitionTopologyChanged(List<?> newReplicants,
int newReplicantsViewId,
boolean merge)
|
|
protected void |
registerDRMListener()
|
|
protected void |
registerRPCHandler()
|
|
void |
removeEventListener(EventListener<E> listener)
|
|
void |
replicantsChanged(String key,
List newReplicants,
int newReplicantsViewId,
boolean merge)
Callback called when the content/list of replicant for a given replicant key has changed |
|
void |
setHAPartition(HAPartition partition)
|
|
void |
setRegisterThreadContextClassLoader(boolean registerClassLoader)
Sets a flag specifying whether the calling thread's context classloader should be used when making RPC calls. |
|
void |
setServiceHAName(String name)
|
|
void |
start()
|
|
void |
stop()
|
|
protected void |
unregisterDRMListener()
|
|
protected void |
unregisterRPCHandler()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.jboss.logging.Logger log
Constructor Detail |
---|
public HAServiceImpl(EventFactory<E> eventFactory, EventFacility<E> eventFacility)
public HAServiceImpl(EventFactory<E> eventFactory)
Method Detail |
---|
public void addEventListener(EventListener<E> listener)
public void removeEventListener(EventListener<E> listener)
public void notifyListeners(E event)
notifyListeners
in interface EventFacility<E extends EventObject>
EventFacility.notifyListeners(java.util.EventObject)
public HAPartition getHAPartition()
HAServiceKeyProvider
getHAPartition
in interface HAServiceKeyProvider
HAServiceKeyProvider.getHAPartition()
public void setHAPartition(HAPartition partition)
setHAPartition
in interface HAService<E extends EventObject>
HAService.setHAPartition(org.jboss.ha.framework.interfaces.HAPartition)
public boolean isRegisterThreadContextClassLoader()
HAService
isRegisterThreadContextClassLoader
in interface HAService<E extends EventObject>
HAService.isRegisterThreadContextClassLoader()
public void setRegisterThreadContextClassLoader(boolean registerClassLoader)
HAService
setRegisterThreadContextClassLoader
in interface HAService<E extends EventObject>
registerClassLoader
- whether to use the thread context classloader when
registering the service's RPC handler.HAService.setRegisterThreadContextClassLoader(boolean)
public String getServiceHAName()
getServiceHAName
in interface HAService<E extends EventObject>
public void setServiceHAName(String name)
setServiceHAName
in interface HAService<E extends EventObject>
HAService.setServiceHAName(java.lang.String)
public void handleEvent(E event) throws Exception
Exception
EventListener.handleEvent(java.util.EventObject)
protected HAServiceRpcHandler<E> getRpcHandler()
protected EventFactory<E> getEventFactory()
protected EventFacility<E> getEventFacility()
public void create() throws Exception
create
in interface HAService<E extends EventObject>
Exception
HAService.create()
public void start() throws Exception
start
in interface HAService<E extends EventObject>
Exception
HAService.start()
public void stop()
stop
in interface HAService<E extends EventObject>
HAService.stop()
public void destroy()
destroy
in interface HAService<E extends EventObject>
HAService.destroy()
protected <T> List<T> callMethodOnPartition(String methodName, Object[] args, Class<?>[] types) throws Exception
Exception
protected void callAsyncMethodOnPartition(String methodName, Object[] args, Class<?>[] types) throws Exception
Exception
protected void registerRPCHandler()
protected void unregisterRPCHandler()
protected void registerDRMListener() throws Exception
Exception
protected void unregisterDRMListener() throws Exception
Exception
public String getHAServiceKey()
getHAServiceKey
in interface HAServiceKeyProvider
protected Serializable getReplicant()
DistributedReplicantManager
.public void replicantsChanged(String key, List newReplicants, int newReplicantsViewId, boolean merge)
DistributedReplicantManager.ReplicantListener
replicantsChanged
in interface DistributedReplicantManager.ReplicantListener
key
- The name of the key of the replicant that has changednewReplicants
- The list of new replicants for the give replicant key.
This list will be in a consistent order on all
cluster nodes on which the current viewId is
in effectnewReplicantsViewId
- The new replicant view id corresponding to this changemerge
- Is the change due to a merge (i.e. the healing of a
cluster split)?DistributedReplicantManager.ReplicantListener.replicantsChanged(java.lang.String, java.util.List, int, boolean)
protected void partitionTopologyChanged(List<?> newReplicants, int newReplicantsViewId, boolean merge)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |