Skip to content

Commit 4c41688

Browse files
committed
#10 - Support lifecycle with @bean beans ... e.g. @bean(destroyMethod = "shutdown")
1 parent a869291 commit 4c41688

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/io/dinject/Bean.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,14 @@
4040
@Target(ElementType.METHOD)
4141
@Retention(RetentionPolicy.RUNTIME)
4242
public @interface Bean {
43+
44+
/**
45+
* Specify a method to be treated like a <code>@PostConstruct</code>
46+
*/
47+
String initMethod() default "";
48+
49+
/**
50+
* Specify a method to be treated like a <code>@PreDestroy</code>
51+
*/
52+
String destroyMethod() default "";
4353
}

0 commit comments

Comments
 (0)