TeslaCN commented on a change in pull request #1708:
URL: 
https://github.com/apache/shardingsphere-elasticjob/pull/1708#discussion_r521201164



##########
File path: 
docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md
##########
@@ -76,26 +76,39 @@ When to execute OneOffJob is up to you.
 Developers can inject the `OneOffJobBootstrap` bean into where they plan to 
invoke.
 Trigger the job by invoking `execute()` method manually.
 
-**About @DependsOn Annotation**
-
-JobBootstraps are created by the Starter dynamically. It's unable to inject 
the `JobBootstrap` beans if the beans which depends on `JobBootstrap` were 
instantiated earlier than the instantiation of `JobBootstrap`.
-
-Developers can also retrieve `JobBootstrap` beans by ApplicationContext.
-
 The bean name of `OneOffJobBootstrap` is specified by property 
"jobBootstrapBeanName",
 Please refer to [Spring Boot Starter 
Configuration](/en/user-manual/elasticjob-lite/configuration/spring-boot-starter).
 
+```yaml
+elasticjob:
+  jobs:
+    myOneOffJob:
+      jobBootstrapBeanName: myOneOffJobBean
+      ....
+```
+
 ```java
 @RestController
-@DependsOn("ElasticJobLiteAutoConfiguration")
 public class OneOffJobController {
-    
-    @Resource(name = "manualScriptJobOneOffJobBootstrap")
-    private OneOffJobBootstrap manualScriptJob;
+
+    // Through "@Resource" injection
+    @Resource(name = "myOneOffJobBean")
+    private OneOffJobBootstrap myOneOffJob;
     
     @GetMapping("/execute")
     public String executeOneOffJob() {
-        manualScriptJob.execute();
+        myOneOffJob.execute();
+        return "{\"msg\":\"OK\"}";
+    }
+
+    // Through "@Autowired" injection

Review comment:
       ```suggestion
       // Inject via "@Autowired"
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to