/**
- * The LifecycleEvent type for the "configure" event. Use by those
+ * The LifecycleEvent type for the "configure_start" event. Used by those
* components that use a separate component to perform configuration and
* need to signal when configuration should be performed - usually after
* {@link #BEFORE_START_EVENT} and before {@link #START_EVENT}.
*/
- public static final String CONFIGURE_EVENT = "configure";
+ public static final String CONFIGURE_START_EVENT = "configure_start";
+
+
+ /**
+ * The LifecycleEvent type for the "configure_stop" event. Used by those
+ * components that use a separate component to perform configuration and
+ * need to signal when de-configuration should be performed - usually after
+ * {@link #STOP_EVENT} and before {@link #AFTER_STOP_EVENT}.
+ */
+ public static final String CONFIGURE_STOP_EVENT = "configure_stop";
// --------------------------------------------------------- Public Methods
if ((resources != null) && (resources instanceof Lifecycle))
((Lifecycle) resources).start();
+ // Notify our interested LifecycleListeners
+ fireLifecycleEvent(Lifecycle.CONFIGURE_START_EVENT, null);
+
// Start our child containers, if any
Container children[] = findChildren();
for (int i = 0; i < children.length; i++) {
((Lifecycle) pipeline).start();
}
- // Notify our interested LifecycleListeners
- fireLifecycleEvent(Lifecycle.CONFIGURE_EVENT, null);
-
// Acquire clustered manager
Manager contextManager = null;
if (manager == null) {
if (log.isDebugEnabled())
log.debug("Processing standard container shutdown");
+ fireLifecycleEvent(Lifecycle.CONFIGURE_STOP_EVENT, null);
+
// Stop the Valves in our pipeline (including the basic), if any
if (pipeline instanceof Lifecycle) {
((Lifecycle) pipeline).stop();
}
// Process the event that has occurred
- if (event.getType().equals(Lifecycle.CONFIGURE_EVENT)) {
- configure();
+ if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) {
+ configureStart();
} else if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {
beforeStart();
} else if (event.getType().equals(Lifecycle.AFTER_START_EVENT)) {
context.setDocBase(originalDocBase);
originalDocBase = docBase;
}
- } else if (event.getType().equals(Lifecycle.STOP_EVENT)) {
+ } else if (event.getType().equals(Lifecycle.CONFIGURE_STOP_EVENT)) {
if (originalDocBase != null) {
String docBase = context.getDocBase();
context.setDocBase(originalDocBase);
originalDocBase = docBase;
}
- stop();
+ configureStop();
} else if (event.getType().equals(Lifecycle.INIT_EVENT)) {
init();
} else if (event.getType().equals(Lifecycle.DESTROY_EVENT)) {
/**
* Process a "contextConfig" event for this Context.
*/
- protected synchronized void configure() {
+ protected synchronized void configureStart() {
// Called from StandardContext.start()
if (log.isDebugEnabled())
/**
* Process a "stop" event for this Context.
*/
- protected synchronized void stop() {
+ protected synchronized void configureStop() {
if (log.isDebugEnabled())
log.debug(sm.getString("contextConfig.stop"));
if (event.getType().equals(Lifecycle.INIT_EVENT)) {
init();
- } else if (event.getType().equals(Lifecycle.CONFIGURE_EVENT)) {
+ } else if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) {
try {
execute();
} catch (Exception e) {
public void lifecycleEvent(LifecycleEvent event) {
try {
Context context = (Context) event.getLifecycle();
- if (event.getType().equals(Lifecycle.CONFIGURE_EVENT)) {
+ if (event.getType().equals(Lifecycle.CONFIGURE_START_EVENT)) {
context.setConfigured(true);
}
} catch (ClassCastException e) {