M - The object which implements Model interfaceS - The object which implements Service interfacepublic abstract class ServiceBase<M,S> extends Object implements Service<M>, CRUDLifecycle<M>, Lifecycle<M,S>
| Modifier and Type | Field and Description |
|---|---|
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?
|
AFTER_CREATE_EVENT, AFTER_DELETE_EVENT, AFTER_UPDATE_EVENT, BEFORE_CREATE_EVENT, BEFORE_DELETE_EVENT, BEFORE_UPDATE_EVENT, CREATE_EVENT, DELETE_EVENT, UPDATE_EVENTAFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, DESTROY_EVENT, START_EVENT, STOP_EVENT| Constructor and Description |
|---|
ServiceBase() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected boolean started
protected LifecycleSupport<M,S> lifecycle
protected CRUDLifecycleSupport<M> crudLifecycle
public void start()
throws LifecycleException
start in interface Lifecycle<M,S>LifecycleException - if this component detects a fatal error that
prevents it from being startedpublic 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 instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionpublic void preCreate(M newInstance) throws SocialClientLibException
newInstance - A new instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionpublic void postCreate(M newInstance) throws SocialClientLibException
newInstance - A new instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionpublic final void doDelete(M existingInstance) throws SocialClientLibException
existingInstance - An existing instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionpublic void preDelete(M existingInstance) throws SocialClientLibException
existingInstance - An existing instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionpublic void postDelete(M existingInstance) throws SocialClientLibException
existingInstance - An existing instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionpublic final void doUpdate(M existingInstance) throws SocialClientLibException
existingInstance - An existing instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionpublic void preUpdate(M existingInstance) throws SocialClientLibException
existingInstance - An existing instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionpublic void postUpdate(M existingInstance) throws SocialClientLibException
existingInstance - An existing instanceAccessDeniedExceptionServiceExceptionSocialClientLibExceptionCopyright © 2011–2015 eXo Platform SAS. All rights reserved.