public abstract class AbstractReconfigurableDaemonModule extends Object implements ConfigurableDaemonModule
ConfigurableDaemonModule
s that wish to
reconfigure when their module configuration changes in the repository.
Note that implementations must make sure to take care of thread safety issues that arise as a consequence of a reconfiguration callback. This can happen at any time, possibly in the middle of servicing other threads.
Modifier and Type | Field and Description |
---|---|
protected String |
moduleConfigPath |
protected String |
moduleName |
protected javax.jcr.Session |
session |
Constructor and Description |
---|
AbstractReconfigurableDaemonModule() |
Modifier and Type | Method and Description |
---|---|
void |
configure(javax.jcr.Node moduleConfig)
Lifecycle callback to allow a
DaemonModule to configure itself. |
protected abstract void |
doConfigure(javax.jcr.Node moduleConfig)
Lifecycle callback to allow a
DaemonModule to configure itself. |
protected abstract void |
doInitialize(javax.jcr.Session session)
Lifecycle callback that is called when this module is started.
|
protected abstract void |
doShutdown()
Lifecycle callback method that is called by the repository before shutting down .
|
void |
initialize(javax.jcr.Session session)
Lifecycle callback method that is called when the component is started.
|
protected boolean |
isReconfigureEvent(javax.jcr.observation.Event event)
Called by the module configuration listener on event.
|
protected void |
onConfigurationChange(javax.jcr.Node moduleConfig)
Called when the module configuration has changed.
|
void |
shutdown()
Lifecycle callback method that is called by the repository before shutting down
|
protected String moduleName
protected String moduleConfigPath
protected javax.jcr.Session session
public final void configure(javax.jcr.Node moduleConfig) throws javax.jcr.RepositoryException
ConfigurableDaemonModule
DaemonModule
to configure itself.
This method is called on startup iff there is module config node,
and before DaemonModule.initialize(javax.jcr.Session)
is called.configure
in interface ConfigurableDaemonModule
moduleConfig
- the node containing the configuration of this modulejavax.jcr.RepositoryException
protected abstract void doConfigure(javax.jcr.Node moduleConfig) throws javax.jcr.RepositoryException
DaemonModule
to configure itself.
This method is called on startup iff there is module config node,
and before initialize(javax.jcr.Session)
is called. This method is also called when
the module config node or any of its descendants changes.moduleConfig
- the node containing the configuration of this modulejavax.jcr.RepositoryException
public final void initialize(javax.jcr.Session session) throws javax.jcr.RepositoryException
DaemonModule
initialize
in interface DaemonModule
session
- a Session
that can be used throughout this module's life.javax.jcr.RepositoryException
protected abstract void doInitialize(javax.jcr.Session session) throws javax.jcr.RepositoryException
session
- a Session
that can be used throughout this module's life.javax.jcr.RepositoryException
public final void shutdown()
DaemonModule
shutdown
in interface DaemonModule
protected abstract void doShutdown()
protected void onConfigurationChange(javax.jcr.Node moduleConfig) throws javax.jcr.RepositoryException
doConfigure(javax.jcr.Node)
but this method may be overridden.moduleConfig
- the new module configuration nodejavax.jcr.RepositoryException
protected boolean isReconfigureEvent(javax.jcr.observation.Event event) throws javax.jcr.RepositoryException
event
- event returned by the EventIteratorjavax.jcr.RepositoryException
Copyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.