Annotations
Complete reference for all Talon annotations available for microservice development.
Overview
Talon provides a comprehensive set of Java annotations for developing microservices. These annotations enable declarative configuration of:
Microservice lifecycle hooks
Message and event handlers
Configuration injection
Command handlers
Application statistics
Store indexes
Annotation Categories
Control microservice lifecycle and dependency injection
Handle inbound messages and events
Inject configuration values
Implement administrative commands
Expose application statistics
Configure state storage and indexing
Expose objects for annotation scanning
Lifecycle Annotations
@AppHAPolicy
Package: com.neeve.server.app.annotations Target: TYPE (class level) Since: 1.0
Specifies the high-availability policy for the microservice.
Parameters:
value(required): HAPolicy enum -EventSourcingorStateReplication
Example:
See Also: Consensus Models, Specifying The HA Policy
@AppInjectionPoint
Package: com.neeve.server.app.annotations Target: METHOD, FIELD Since: 1.0
Marks methods or fields for dependency injection by the Talon runtime.
Supported Injectable Types:
SrvAppLoader- Application loaderAepEngine- AEP engine instanceAepEngineDescriptor- Engine configuration descriptorAepMessageSender- Message sender
Examples:
See Also: Lifecycle
@AppInitializer
Package: com.neeve.server.app.annotations Target: METHOD Since: 1.0
Marks the application initialization method, invoked after the engine is created and injected.
Example:
See Also: Lifecycle, Implementing Lifecycle Methods
@AppMain
Package: com.neeve.server.app.annotations Target: METHOD Since: 1.0
Marks the main entry point for synchronous microservices. Invoked in a separate thread after the engine becomes primary.
Example:
See Also: Lifecycle
@AppFinalizer
Package: com.neeve.server.app.annotations Target: METHOD Since: 1.0
Marks the application finalization method, invoked during shutdown before the application is unloaded.
Example:
See Also: Lifecycle
Message Processing Annotations
@EventHandler
Package: com.neeve.aep.annotations Target: METHOD Since: 1.0
Marks methods as handlers for inbound messages or lifecycle events.
Parameters:
source(optional, default: "*"): Source filter for eventslocalOnly(optional, default: false): Handle only locally-sourced events (experimental)
Valid Method Signatures:
Example:
See Also: Handling Messages, Lifecycle Events
Configuration Annotations
@Configured
Package: com.neeve.cli.annotations Target: FIELD, METHOD Since: 3.2
Marks fields or methods for configuration injection from XRuntime.
Parameters:
property(required): Configuration property namerequired(optional, default: false): Whether property is requireddefaultValue(optional, default: ""): Default value if property not setdescription(optional, default: ""): Property description
Supported Types: boolean, byte, short, int, long, float, double, char, String, XString, enumerations
Examples:
See Also: Injecting Configuration
Command & Control Annotations
@Command
Package: com.neeve.cli.annotations Target: TYPE, METHOD Since: 3.4
Marks a method as an executable command handler for administrative operations.
Parameters:
name(optional): Command name (defaults to method name)description(optional): Command descriptionaliases(optional): Alternative command namesparseOptions(optional, default: true): Whether to parse options
Example:
See Also: Implementing Command Handlers
@Argument
Package: com.neeve.cli.annotations Target: FIELD, PARAMETER Since: 3.4
Defines a positional command argument.
Parameters:
name(required): Argument nameposition(required): 1-based positiondescription(optional): Argument descriptiondefaultValue(optional): Default valuerequired(optional, default: true): Whether argument is requiredvalidOptions(optional): Array of valid values
Example:
See Also: Implementing Command Handlers
@Option
Package: com.neeve.cli.annotations Target: FIELD, PARAMETER Since: 3.4
Defines a command option (switch-based parameter).
Parameters:
shortForm(required): Short switch character (e.g., 'v')longForm(required): Long switch name (e.g., "verbose")description(optional): Option descriptiondefaultValue(optional): Default valuerequired(optional, default: false): Whether option is requiredvalidOptions(optional): Array of valid values
Example:
See Also: Implementing Command Handlers
@AppCommandHandler
Package: com.neeve.server.app.annotations Target: METHOD Since: 1.0
Legacy annotation for marking command handlers. @Command is now preferred.
Parameters:
command(required): Command name
Example:
See Also: Implementing Command Handlers
Monitoring Annotations
@AppStat
Package: com.neeve.server.app.annotations Target: METHOD, FIELD Since: 1.0
Marks fields or methods that provide statistic values for collection by the engine's statistics collector.
Parameters:
gauge(optional, default: true): Whether field/method is a gaugename(optional): Name of the gauge (for gauge stats)
Supported Types:
IStats.Counter- Counter statisticsIStats.Latencies- Latency statisticsIStats.Gauge- Gauge statisticsPrimitive types (when gauge=true)
Examples:
See Also: Exposing Application Stats
Storage Annotations
@AppStateFactoryAccessor
Package: com.neeve.server.app.annotations Target: METHOD Since: 1.0
Provides the state factory for State Replication microservices.
Return Type: IAepApplicationStateFactory
Example:
See Also: State Replication Template
@AppStoreUniqueIndex
Package: com.neeve.server.app.annotations Target: FIELD (type: IStoreUniqueIndex) Since: 2.0
Defines a unique index on state objects for State Replication microservices.
Parameters:
name(required): Index namefieldPath(required): Field path on which to create index
Example:
@AppStoreNonUniqueIndex
Package: com.neeve.server.app.annotations Target: FIELD (type: IStoreNonUniqueIndex) Since: 2.0
Defines a non-unique index on state objects for State Replication microservices.
Parameters:
name(required): Index namefieldPath(required): Field path on which to create index
Example:
Container Accessor Annotations
These annotations expose objects to the Talon runtime for annotation scanning.
@AppIntrospectionPoints
Package: com.neeve.server.app.annotations Target: METHOD Since: 3.0
Unified accessor that exposes objects for all annotation types. Called multiple times during lifecycle.
Method Signature:
Replaces: All fine-grained *Accessor annotations
See Also: Lifecycle
@AppConfiguredAccessor
Package: com.neeve.server.app.annotations Target: METHOD Since: 3.2
Exposes objects containing @Configured annotations.
Method Signature:
See Also: Injecting Configuration
@AppCommandHandlerContainersAccessor
Package: com.neeve.server.app.annotations Target: METHOD Since: 3.4
Exposes objects containing @Command methods.
Method Signature:
See Also: Implementing Command Handlers
@AppEventHandlerContainersAccessor
Package: com.neeve.server.app.annotations Target: METHOD Since: 1.0
Exposes objects containing @EventHandler methods.
Method Signature:
See Also: Handling Messages
@AppEventHandlerAccessor
Package: com.neeve.server.app.annotations Target: METHOD Since: 1.0
Provides the default event handler (programmatic alternative to @EventHandler).
Return Type: IEventHandler
Method Signature:
See Also: Lifecycle
@AppStatContainersAccessor
Package: com.neeve.server.app.annotations Target: METHOD Since: 1.0
Exposes objects containing @AppStat annotations.
Method Signature:
See Also: Exposing Application Stats
Annotation Packages
Talon annotations are organized into three packages:
com.neeve.aep.annotations
AEP Engine-level annotations:
@EventHandler
com.neeve.server.app.annotations
Talon application-level annotations (16 annotations):
All @App* annotations
Lifecycle, injection, and accessor annotations
com.neeve.cli.annotations
Configuration and command-line interface annotations (4 annotations):
@Configured
@Command
@Argument
@Option
Import Examples
Lifecycle Execution Order
Annotations are processed in this order during microservice startup:
@AppInjectionPoint(SrvAppLoader)@AppHAPolicy@AppInjectionPoint(AepEngineDescriptor)@AppConfiguredAccessor/@Configured@AppCommandHandlerContainersAccessor/@Command@AppStatContainersAccessor/@AppStat@AppEventHandlerContainersAccessor/@EventHandler@AppEventHandlerAccessor@AppStateFactoryAccessor@AppInjectionPoint(AepEngine)@AppInitializer@AppMain(after becoming primary)@AppFinalizer(during shutdown)
See Lifecycle for complete flow.
See Also
Lifecycle - Microservice lifecycle and annotation processing
Events - Lifecycle and runtime events
Implementing Lifecycle Methods - Using lifecycle annotations
Handling Messages - Using @EventHandler
Injecting Configuration - Using @Configured
Implementing Command Handlers - Using command annotations
Exposing Application Stats - Using @AppStat
Last updated

