org.apache.ignite.resources

## Annotation Type ServiceContextResource

-     @Documented
       @Retention(value=RUNTIME)
       @Target(value={METHOD,FIELD})
      public @interface ServiceContextResource

  Annotates a field or a setter method for injecting a `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;
           }
           ...
       }

  See Also:
    `Service`, `ServiceContext`

${current.year} Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023