-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File module abstract interface. Docean lookup supports configuration…
- Loading branch information
Showing
11 changed files
with
137 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
jcommon/docean-plugin/docean-plugin-test/src/main/java/com/xiaomi/mione/plugin/dao/Run.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.xiaomi.mione.plugin.dao; | ||
|
||
/** | ||
* @author goodjava@qq.com | ||
* @date 2023/9/20 14:57 | ||
*/ | ||
public class Run { | ||
|
||
|
||
public static void main(String[] args) { | ||
System.out.println("run"); | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...plugin/docean-plugin-test/src/test/java/com/xiaomi/youpin/docean/plugin/test/IocTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.xiaomi.youpin.docean.plugin.test; | ||
|
||
import com.google.common.collect.Maps; | ||
import com.xiaomi.youpin.docean.Aop; | ||
import com.xiaomi.youpin.docean.Ioc; | ||
import com.xiaomi.youpin.docean.plugin.test.lookup.LookupService; | ||
import org.junit.Test; | ||
|
||
import java.util.stream.IntStream; | ||
|
||
/** | ||
* @author goodjava@qq.com | ||
* @date 2023/9/20 13:55 | ||
*/ | ||
public class IocTest { | ||
|
||
|
||
@Test | ||
public void testLookup() { | ||
Aop.ins().init(Maps.newLinkedHashMap()); | ||
Ioc.ins().init("com.xiaomi.youpin.docean.plugin.test.lookup", "com.xiaomi.youpin.docean.plugin.config"); | ||
LookupService ds = Ioc.ins().getBean(LookupService.class); | ||
IntStream.range(0, 5).forEach(i -> { | ||
com.xiaomi.youpin.docean.plugin.test.bo.Test dv = ds.g(); | ||
dv.setId(123); | ||
System.out.println(dv.getId()); | ||
}); | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...-plugin-test/src/test/java/com/xiaomi/youpin/docean/plugin/test/lookup/LookupService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.xiaomi.youpin.docean.plugin.test.lookup; | ||
|
||
import com.xiaomi.youpin.docean.anno.Lookup; | ||
import com.xiaomi.youpin.docean.anno.Service; | ||
import com.xiaomi.youpin.docean.plugin.test.bo.Test; | ||
|
||
/** | ||
* @author goodjava@qq.com | ||
* @date 2023/9/20 13:56 | ||
*/ | ||
@Service | ||
public class LookupService { | ||
|
||
@Lookup | ||
public Test getTest() { | ||
return null; | ||
} | ||
|
||
|
||
public Test g() { | ||
return getTest(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,7 @@ | |
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface Lookup { | ||
|
||
String value() default ""; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,7 @@ http_port=9999 | |
cglib=true | ||
download_file_path=/tmp/v | ||
|
||
demoVo=com.xiaomi.youpin.docean.test.demo.DemoVo | ||
|
||
|
||
|
19 changes: 19 additions & 0 deletions
19
jcommon/file/src/main/java/com/xiaomi/mone/file/ILogFile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.xiaomi.mone.file; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* @author goodjava@qq.com | ||
* @date 2023/9/20 10:39 | ||
*/ | ||
public interface ILogFile { | ||
|
||
void readLine() throws IOException; | ||
|
||
void setStop(boolean stop); | ||
|
||
void setReOpen(boolean reOpen); | ||
|
||
void initLogFile(String file, ReadListener listener, long pointer, long lineNumber); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters