Interface IServiceComponent
interface IServiceComponent
Extends com.amazon.apmf.IStandard
A service lifecycle component runs work in the background which is not visible to the user.
Service components provide an API contract callable over IPC.
Methods
onStart()
This callback is invoked after a component instance has been successfully launched. Service components begin their work when this callback is invoked. If the component is unable to complete its callback successfully, it may throw an exception. Exceptions lead to application termination.voidonStart(com.amazon.kepler.runtime.IComponentInstance*instance,com.amazon.kepler.messaging.IMessage*message)
Parameters
instance
com.amazon.kepler.runtime.IComponentInstance* — Required
An object representing this instance of the component.
message
com.amazon.kepler.messaging.IMessage* — Required
The message which resulted in this instance of the component being launched.
onStop()
This callback is invoked when a component instance is going to be stopped; its process may be terminated at any point after this callback is invoked. Note that under most circumstances the component receives this callback before termination, but under some circumstances the process may be forcefully killed before this callback can be invoked. For instance, a component may be forcefully killed if the device is under critical memory pressure and needs to quickly reclaim resources or if the component fails to respond to callbacks in a timely manner. If the component is unable to complete its callback successfully, it may throw an exception. Exceptions lead to application termination.voidonStop(com.amazon.kepler.runtime.IComponentInstance*instance)
Parameters
instance
com.amazon.kepler.runtime.IComponentInstance* — Required
An object representing this instance of the component.

