01: package com.bm.creators;
02:
03: import java.util.HashSet;
04: import java.util.Set;
05:
06: import com.bm.ejb3guice.inject.CreationListner;
07:
08: /**
09: * Protokolls which objects are created.
10: * @author wiesda00
11: *
12: */
13: public class BeanCreationListener implements CreationListner {
14:
15: private Set<Object> createdBeans = new HashSet<Object>();
16:
17: /**
18: * Will be called by ejb3guice after creation.
19: */
20: public void afterCreation(Object obj) {
21: createdBeans.add(obj);
22:
23: }
24:
25: /**
26: * Returns the created beans.
27: * @return the created beans.
28: */
29: public Set<Object> getCreatedBeans() {
30: return createdBeans;
31: }
32:
33: }
|