View Javadoc
1   package org.myorg.encconfig.ejb;
2   
3   import javax.jms.ConnectionFactory;
4   import javax.jms.Topic;
5   import javax.persistence.EntityManager;
6   
7   import org.slf4j.Logger;
8   import org.slf4j.LoggerFactory;
9   
10  public class XMLInjectAuditorEJB extends AuditorBase 
11  	implements AuditorRemote {
12  	private static final Logger log = LoggerFactory.getLogger(XMLInjectAuditorEJB.class);
13  	
14  	private Boolean publishJMS;
15  	private EntityManager em;
16  	private ConnectionFactory cf;
17  	private Topic topic;
18  	
19  	public void init() {
20  		super.setLog(log);
21  		super.setConnectionFactory(cf);
22  		super.setEntityManager(em);
23  		super.setTopic(topic);
24  		super.setPublishJMS(isPublishJMS());
25  	}
26  
27  	@Override
28  	public boolean isPublishJMS() {
29  		return publishJMS!=null && publishJMS;
30  	}
31  	@Override
32  	public boolean havePersistenceContext() {
33  		return em!=null;
34  	}
35  	@Override
36  	public boolean haveTopic() {
37  		return topic!=null;
38  	}
39  	@Override
40  	public boolean haveConnectionFactory() {
41  		return cf!=null;
42  	}	
43  	@Override
44  	public int audit(String message) {
45  		return super.audit(message);
46  	}
47  }