@Retention(value=RUNTIME) @Target(value={METHOD,FIELD}) public @interface AppInjectionPoint
Injection points are points in the application where the server injects platform objects of interest to the application. the injected object is determined from the annotated method signature.
When running in an XVM, the Talon runtime will inject the following types if annotated with @AppInjectionPoint:
Example: Injecting into a field
public class MyApp { @AppInjectionPoint private AepMessageSender sender; }Example: Injecting via a method
public class MyApp { private AepMessageSender sender; @AppInjectionPoint public void setMessageSender(final AepMessageSender sender) { this.sender = sender; } }Example: Injecting into other objects By default Talon only searches for annotations on methods and fields of the application main class. The
AppIntrospectionPoints
annotation
can be used to tell Talon about other objects that should be introspected
for annotations.
public class MyApp { private class SomeObject { @AppInjectionPoint private AepMessageSender sender; } private final SomeObject someObject = new SomeObject(); @AppIntrospectionPoints public void getIntrospectedObjects(final Set<Object> introspectionPoints) { introspectionPoints.add(someObject); } }
AppIntrospectionPoints
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.