Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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()

void onStart(com.amazon.kepler.runtime.IComponentInstance* instance, com.amazon.kepler.messaging.IMessage* message)
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.

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()

void onStop(com.amazon.kepler.runtime.IComponentInstance* instance)
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.

Parameters

instance
com.amazon.kepler.runtime.IComponentInstance* — Required An object representing this instance of the component.
Last modified on October 29, 2026