|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.social.client.core.service.ServiceBase<M,S>
M - The object which implements Model interfaceS - The object which implements Service interfacepublic abstract class ServiceBase<M,S>
Abstract implementation of the Lifecycle interface, CRUDLifecycle interface, and Service interface, moreover providing common functionality required when Service execution
| Field Summary | |
|---|---|
protected CRUDLifecycleSupport<M> |
crudLifecycle
The crud lifecycle event support for this component. |
protected LifecycleSupport<M,S> |
lifecycle
The lifecycle event support for this component. |
protected boolean |
started
Has this component been started? |
| Fields inherited from interface org.exoplatform.social.client.api.event.CRUDLifecycle |
|---|
AFTER_CREATE_EVENT, AFTER_DELETE_EVENT, AFTER_UPDATE_EVENT, BEFORE_CREATE_EVENT, BEFORE_DELETE_EVENT, BEFORE_UPDATE_EVENT, CREATE_EVENT, DELETE_EVENT, UPDATE_EVENT |
| Fields inherited from interface org.exoplatform.social.client.api.event.Lifecycle |
|---|
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, START_EVENT, STOP_EVENT |
| Constructor Summary | |
|---|---|
ServiceBase()
|
|
| Method Summary | |
|---|---|
void |
addCRUDLifecycleListener(CRUDLifecycleListener<M> listener)
Adds a CRUD lifecycle event listener to this component. |
void |
addLifecycleListener(LifecycleListener<M,S> listener)
Adds a lifecycle event listener to this component. |
void |
doCreate(M newInstance)
This implementation performs the corresponding action for CRUD operation. |
void |
doDelete(M existingInstance)
This implementation performs the corresponding action for CRUD operation. |
void |
doUpdate(M existingInstance)
This implementation performs the corresponding action for CRUD operation. |
CRUDLifecycleListener<M>[] |
findCRUDLifecycleListeners()
Gets the lifecycle listeners associated with this lifecycle. |
LifecycleListener<M,S>[] |
findLifecycleListeners()
Get the lifecycle listeners associated with this lifecycle. |
void |
postCreate(M newInstance)
Overrides this method to perform post-processing on new model being saved. |
void |
postDelete(M existingInstance)
Overrides this method to perform post-processing on existing model being deleted. |
void |
postUpdate(M existingInstance)
Overrides this method to perform post-processing on existing model being updated. |
void |
preCreate(M newInstance)
Overrides this method to perform pre-processing on new model being saved. |
void |
preDelete(M existingInstance)
Overrides this method to perform pre-processing on existing model being deleted. |
void |
preUpdate(M existingInstance)
Overrides this method to perform pre-processing on existing model being updated. |
void |
removeCRUDLifecycleListener(CRUDLifecycleListener<M> listener)
Removes a crud lifecycle event listener which was added to this component. |
void |
removeLifecycleListener(LifecycleListener<M,S> listener)
Removes a lifecycle event listener which was added to this component. |
void |
start()
Prepares for active use of the public methods of this Component. |
void |
stop()
Gracefully shut down active use of the public methods of this Component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.exoplatform.social.client.api.service.Service |
|---|
create, delete, get, update |
| Field Detail |
|---|
protected boolean started
protected LifecycleSupport<M,S> lifecycle
protected CRUDLifecycleSupport<M> crudLifecycle
| Constructor Detail |
|---|
public ServiceBase()
| Method Detail |
|---|
public void start()
throws LifecycleException
start in interface Lifecycle<M,S>LifecycleException - if this component detects a fatal error
that prevents it from being started
public void stop()
throws LifecycleException
stop in interface Lifecycle<M,S>LifecycleException - if this component detects a fatal error
that needs to be reportedpublic void addLifecycleListener(LifecycleListener<M,S> listener)
addLifecycleListener in interface Lifecycle<M,S>listener - The listener is addedpublic void removeLifecycleListener(LifecycleListener<M,S> listener)
removeLifecycleListener in interface Lifecycle<M,S>listener - The listener will be removed.public LifecycleListener<M,S>[] findLifecycleListeners()
findLifecycleListeners in interface Lifecycle<M,S>public void addCRUDLifecycleListener(CRUDLifecycleListener<M> listener)
addCRUDLifecycleListener in interface CRUDLifecycle<M>listener - The listener is addedpublic void removeCRUDLifecycleListener(CRUDLifecycleListener<M> listener)
removeCRUDLifecycleListener in interface CRUDLifecycle<M>listener - The listener will be removed.public CRUDLifecycleListener<M>[] findCRUDLifecycleListeners()
findCRUDLifecycleListeners in interface CRUDLifecycle<M>
public final void doCreate(M newInstance)
throws SocialClientLibException
newInstance - A new instance
AccessDeniedException
ServiceException
SocialClientLibException
public void preCreate(M newInstance)
throws SocialClientLibException
newInstance - A new instance
AccessDeniedException
ServiceException
SocialClientLibException
public void postCreate(M newInstance)
throws SocialClientLibException
newInstance - A new instance
AccessDeniedException
ServiceException
SocialClientLibException
public final void doDelete(M existingInstance)
throws SocialClientLibException
existingInstance - An existing instance
AccessDeniedException
ServiceException
SocialClientLibException
public void preDelete(M existingInstance)
throws SocialClientLibException
existingInstance - An existing instance
AccessDeniedException
ServiceException
SocialClientLibException
public void postDelete(M existingInstance)
throws SocialClientLibException
existingInstance - An existing instance
AccessDeniedException
ServiceException
SocialClientLibException
public final void doUpdate(M existingInstance)
throws SocialClientLibException
existingInstance - An existing instance
AccessDeniedException
ServiceException
SocialClientLibException
public void preUpdate(M existingInstance)
throws SocialClientLibException
existingInstance - An existing instance
AccessDeniedException
ServiceException
SocialClientLibException
public void postUpdate(M existingInstance)
throws SocialClientLibException
existingInstance - An existing instance
AccessDeniedException
ServiceException
SocialClientLibException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||