Package org.nuxeo.runtime
Class RuntimeMessageHandlerImpl
- java.lang.Object
-
- org.nuxeo.runtime.RuntimeMessageHandlerImpl
-
- All Implemented Interfaces:
ComponentManager.Listener
,RuntimeMessageHandler
public class RuntimeMessageHandlerImpl extends Object implements RuntimeMessageHandler, ComponentManager.Listener
Handles runtime messages by taking care of component manager lifecycle in order to work correctly with hot reload. This is interesting to not store several time the same message in case of hot reload.- Since:
- 9.10
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
RuntimeMessageHandlerImpl.ComponentManagerStep
-
Field Summary
Fields Modifier and Type Field Description protected List<RuntimeMessage>
messages
protected RuntimeMessageHandlerImpl.ComponentManagerStep
step
-
Constructor Summary
Constructors Constructor Description RuntimeMessageHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addError(String message)
Deprecated.void
addMessage(RuntimeMessage message)
Adds the following message.void
addWarning(String message)
Deprecated.void
afterStart(ComponentManager mgr, boolean isResume)
Called just after all components were startedvoid
beforeActivation(ComponentManager mgr)
Called just before activating components.void
beforeDeactivation(ComponentManager mgr)
Called just before activating components.void
beforeStart(ComponentManager mgr, boolean isResume)
Called just before starting components.void
beforeStop(ComponentManager mgr, boolean isStandby)
Called just before stopping components.protected void
changeStep(RuntimeMessageHandlerImpl.ComponentManagerStep step)
List<String>
getErrors()
Deprecated.List<String>
getMessages(Predicate<RuntimeMessage> predicate)
Returns all messages strings, filtered by given predicate.List<String>
getMessages(RuntimeMessage.Level level)
Returns all messages strings, filtered by given level.List<RuntimeMessage>
getRuntimeMessages(Predicate<RuntimeMessage> predicate)
Returns all messages, filtered by given predicate.List<RuntimeMessage>
getRuntimeMessages(RuntimeMessage.Level level)
Returns all messages, filtered by given level.List<String>
getWarnings()
Deprecated.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.ComponentManager.Listener
afterActivation, afterDeactivation, afterStop, install, uninstall
-
-
-
-
Field Detail
-
step
protected RuntimeMessageHandlerImpl.ComponentManagerStep step
-
messages
protected final List<RuntimeMessage> messages
-
-
Method Detail
-
addWarning
@Deprecated public void addWarning(String message)
Deprecated.Description copied from interface:RuntimeMessageHandler
Warning messages don't block server startup.- Specified by:
addWarning
in interfaceRuntimeMessageHandler
-
getWarnings
@Deprecated public List<String> getWarnings()
Deprecated.- Specified by:
getWarnings
in interfaceRuntimeMessageHandler
- Returns:
- an unmodifiable
List
of warning messages
-
addError
@Deprecated public void addError(String message)
Deprecated.Description copied from interface:RuntimeMessageHandler
Add new error.Error messages block server startup in strict mode.
- Specified by:
addError
in interfaceRuntimeMessageHandler
-
getErrors
@Deprecated public List<String> getErrors()
Deprecated.- Specified by:
getErrors
in interfaceRuntimeMessageHandler
- Returns:
- an unmodifiable
List
of error messages
-
beforeActivation
public void beforeActivation(ComponentManager mgr)
Description copied from interface:ComponentManager.Listener
Called just before activating components. This is fired when enteringComponentManager.start()
- Specified by:
beforeActivation
in interfaceComponentManager.Listener
-
beforeStart
public void beforeStart(ComponentManager mgr, boolean isResume)
Description copied from interface:ComponentManager.Listener
Called just before starting components.- Specified by:
beforeStart
in interfaceComponentManager.Listener
isResume
- true if the event was initiated by aComponentManager.resume()
call, false otherwise.
-
afterStart
public void afterStart(ComponentManager mgr, boolean isResume)
Description copied from interface:ComponentManager.Listener
Called just after all components were started- Specified by:
afterStart
in interfaceComponentManager.Listener
isResume
- true if the event was initiated by aComponentManager.resume()
call, false otherwise.
-
beforeStop
public void beforeStop(ComponentManager mgr, boolean isStandby)
Description copied from interface:ComponentManager.Listener
Called just before stopping components.- Specified by:
beforeStop
in interfaceComponentManager.Listener
isStandby
- true if the event was initiated by aComponentManager.standby()
call, false otherwise
-
beforeDeactivation
public void beforeDeactivation(ComponentManager mgr)
Description copied from interface:ComponentManager.Listener
Called just before activating components.- Specified by:
beforeDeactivation
in interfaceComponentManager.Listener
-
changeStep
protected void changeStep(RuntimeMessageHandlerImpl.ComponentManagerStep step)
-
addMessage
public void addMessage(RuntimeMessage message)
Description copied from interface:RuntimeMessageHandler
Adds the following message.- Specified by:
addMessage
in interfaceRuntimeMessageHandler
-
getMessages
public List<String> getMessages(RuntimeMessage.Level level)
Description copied from interface:RuntimeMessageHandler
Returns all messages strings, filtered by given level.- Specified by:
getMessages
in interfaceRuntimeMessageHandler
-
getMessages
public List<String> getMessages(Predicate<RuntimeMessage> predicate)
Description copied from interface:RuntimeMessageHandler
Returns all messages strings, filtered by given predicate.- Specified by:
getMessages
in interfaceRuntimeMessageHandler
-
getRuntimeMessages
public List<RuntimeMessage> getRuntimeMessages(RuntimeMessage.Level level)
Description copied from interface:RuntimeMessageHandler
Returns all messages, filtered by given level.- Specified by:
getRuntimeMessages
in interfaceRuntimeMessageHandler
-
getRuntimeMessages
public List<RuntimeMessage> getRuntimeMessages(Predicate<RuntimeMessage> predicate)
Description copied from interface:RuntimeMessageHandler
Returns all messages, filtered by given predicate.- Specified by:
getRuntimeMessages
in interfaceRuntimeMessageHandler
-
-