[go: nahoru, domu]

Skip to content

Commit

Permalink
代码修改 => 1.修改ApplicationContext的获取方式
Browse files Browse the repository at this point in the history
  • Loading branch information
Joezeo committed Aug 1, 2021
1 parent 66ad35a commit bec1e1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ public void init() {
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
AbstractVessel.applicationContext = applicationContext;
}

}
10 changes: 10 additions & 0 deletions common/src/main/java/com/toocol/common/vessel/IBasisVessel.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.toocol.common.vessel;

import org.springframework.context.ApplicationContext;

/**
* to put and manage the spring injected object.
* this interface is provided for the consume side.
Expand All @@ -16,4 +18,12 @@ public interface IBasisVessel<T extends AbstractVessel> {
*/
T vessel();

/**
* get the spring's ApplicationContext
*
* @return
*/
default ApplicationContext applicationContext() {
return AbstractVessel.applicationContext;
}
}

0 comments on commit bec1e1f

Please sign in to comment.