-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add EzyExclusiveClassesConfiguration
- Loading branch information
Showing
7 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...bean/src/main/java/com/tvd12/ezyfox/bean/annotation/EzyExclusiveClassesConfiguration.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.tvd12.ezyfox.bean.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* | ||
* @author tavandung12 | ||
* | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.TYPE }) | ||
public @interface EzyExclusiveClassesConfiguration { | ||
|
||
Class<?>[] value(); | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/v120/testing/packet03/Config31.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,20 @@ | ||
package com.tvd12.ezyfox.bean.v120.testing.packet03; | ||
|
||
import com.tvd12.ezyfox.bean.EzyBeanAutoConfig; | ||
import com.tvd12.ezyfox.bean.EzySingletonFactory; | ||
import com.tvd12.ezyfox.bean.EzySingletonFactoryAware; | ||
import com.tvd12.ezyfox.bean.annotation.EzyConfigurationBefore; | ||
|
||
import lombok.Setter; | ||
|
||
@EzyConfigurationBefore | ||
public class Config31 implements EzySingletonFactoryAware, EzyBeanAutoConfig { | ||
|
||
@Setter | ||
private EzySingletonFactory singletonFactory; | ||
|
||
@Override | ||
public void autoConfig() { | ||
singletonFactory.addSingleton(new Singleton31()); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/v120/testing/packet03/Config32.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,20 @@ | ||
package com.tvd12.ezyfox.bean.v120.testing.packet03; | ||
|
||
import com.tvd12.ezyfox.bean.EzyBeanAutoConfig; | ||
import com.tvd12.ezyfox.bean.EzySingletonFactory; | ||
import com.tvd12.ezyfox.bean.EzySingletonFactoryAware; | ||
import com.tvd12.ezyfox.bean.annotation.EzyConfigurationBefore; | ||
|
||
import lombok.Setter; | ||
|
||
@EzyConfigurationBefore | ||
public class Config32 implements EzySingletonFactoryAware, EzyBeanAutoConfig { | ||
|
||
@Setter | ||
private EzySingletonFactory singletonFactory; | ||
|
||
@Override | ||
public void autoConfig() { | ||
singletonFactory.addSingleton(new Singleton32()); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/v120/testing/packet03/Config33.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,18 @@ | ||
package com.tvd12.ezyfox.bean.v120.testing.packet03; | ||
|
||
import com.tvd12.ezyfox.bean.EzyBeanAutoConfig; | ||
import com.tvd12.ezyfox.bean.annotation.EzyExclusiveClassesConfiguration; | ||
|
||
@EzyExclusiveClassesConfiguration({Config32.class, Config32.class}) | ||
public class Config33 implements EzyBeanAutoConfig { | ||
|
||
@Override | ||
public void config() { | ||
throw new RuntimeException("just test"); | ||
} | ||
|
||
@Override | ||
public void autoConfig() { | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/v120/testing/packet03/ConfigFailed31.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,11 @@ | ||
package com.tvd12.ezyfox.bean.v120.testing.packet03; | ||
|
||
import com.tvd12.ezyfox.bean.EzyBeanConfig; | ||
|
||
public class ConfigFailed31 implements EzyBeanConfig { | ||
|
||
@Override | ||
public void config() { | ||
throw new RuntimeException("just test"); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/v120/testing/packet03/Singleton31.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,4 @@ | ||
package com.tvd12.ezyfox.bean.v120.testing.packet03; | ||
|
||
public class Singleton31 { | ||
} |
4 changes: 4 additions & 0 deletions
4
ezyfox-bean/src/test/java/com/tvd12/ezyfox/bean/v120/testing/packet03/Singleton32.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,4 @@ | ||
package com.tvd12.ezyfox.bean.v120.testing.packet03; | ||
|
||
public class Singleton32 { | ||
} |