@Documented @Retention(value=RUNTIME) @Target(value={METHOD,FIELD}) public @interface ServiceContextResource
service context
into a service
instance.
It is guaranteed that context will be injected before calling the Service.init()
method.
Here is how injection would typically happen:
public class MyServiceImpl implements MyService { ... @ServiceContextResource private ServiceContext ctx; ... }or attach the same annotation to the method:
public class MyServiceImpl implements MyService { ... private ServiceContext ctx; ... @ServiceContextResource public void setServiceContext(ServiceContext ctx) { this.ctx = ctx; } ... }
Service
,
ServiceContext
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023