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`

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022