2121import java .util .Map ;
2222import java .util .Optional ;
2323
24+ import org .checkerframework .checker .nullness .qual .NonNull ;
25+ import org .checkerframework .checker .nullness .qual .Nullable ;
26+
2427/**
2528 * Runtime context for an application running on the platform. Provides access to isolated resources
2629 * and optional platform features.
@@ -49,68 +52,68 @@ public interface ApplicationContext {
4952 *
5053 * @return the application ID
5154 */
52- String getApplicationId ();
55+ @ NonNull String getApplicationId ();
5356
5457 /**
5558 * Returns the current lifecycle state of this application.
5659 *
5760 * @return the application state
5861 * @see ApplicationState
5962 */
60- ApplicationState getState ();
63+ @ NonNull ApplicationState getState ();
6164
6265 /**
6366 * Returns the timestamp when this application was deployed.
6467 *
6568 * @return the deployment timestamp
6669 */
67- Instant getDeployedAt ();
70+ @ NonNull Instant getDeployedAt ();
6871
6972 /**
7073 * Returns the isolated classloader for this application. All application classes are loaded
7174 * through this classloader for isolation.
7275 *
7376 * @return the application's classloader
7477 */
75- ClassLoader getClassLoader ();
78+ @ NonNull ClassLoader getClassLoader ();
7679
7780 /**
7881 * Returns the dedicated thread pool for this application. Use this for concurrent execution to
7982 * maintain resource isolation.
8083 *
8184 * @return the application's thread pool
8285 */
83- ThreadPoolExecutor getThreadPool ();
86+ @ NonNull ThreadPoolExecutor getThreadPool ();
8487
8588 /**
8689 * Returns the security policy for this application. Use this to check permissions before
8790 * performing privileged operations.
8891 *
8992 * @return the application's security policy
9093 */
91- SecurityPolicy getSecurityPolicy ();
94+ @ NonNull SecurityPolicy getSecurityPolicy ();
9295
9396 /**
9497 * Returns the resource monitor tracking this application's resource usage. Provides CPU time,
9598 * memory usage, and thread count metrics.
9699 *
97100 * @return the application's resource monitor
98101 */
99- ResourceMonitor getResourceMonitor ();
102+ @ NonNull ResourceMonitor getResourceMonitor ();
100103
101104 /**
102105 * Returns the message bus if messaging is enabled for this application.
103106 *
104107 * @return optional message bus, empty if messaging is not enabled
105108 */
106- Optional <MessageBus > getMessageBus ();
109+ @ NonNull Optional <MessageBus > getMessageBus ();
107110
108111 /**
109112 * Returns the service registry if messaging is enabled for this application.
110113 *
111114 * @return optional service registry, empty if messaging is not enabled
112115 */
113- Optional <ServiceRegistry > getServiceRegistry ();
116+ @ NonNull Optional <ServiceRegistry > getServiceRegistry ();
114117
115118 /**
116119 * Returns the volume manager if volumes are defined for this application. Provides access to
@@ -119,19 +122,19 @@ public interface ApplicationContext {
119122 * @return optional volume manager, empty if no volumes are defined
120123 * @since 2.0
121124 */
122- Optional <VolumeManager > getVolumeManager ();
125+ @ NonNull Optional <VolumeManager > getVolumeManager ();
123126
124127 /**
125128 * Returns custom properties configured for this application.
126129 *
127130 * @return immutable map of application properties
128131 */
129- Map <String , String > getProperties ();
132+ @ NonNull Map <String , String > getProperties ();
130133
131134 /**
132135 * Returns the application instance if it has been started.
133136 *
134137 * @return the application instance, or null if not yet started
135138 */
136- Object getApplicationInstance ();
139+ @ Nullable Object getApplicationInstance ();
137140}
0 commit comments