msg.setObject(config.getIntervalSeconds());
MessageProducer producer = session.createProducer(timerQueue);
producer.send(msg);
+ LOG.info("Message sent");
} catch (Exception e) {
LOG.fatal("Error sending message", e);
}
/**
*
*/
-@MessageDriven(name = "MythtvTimer")
+@MessageDriven(name = "TimerBean")
// Spring's JTA transaction manager does not work with container managed transactions
// because it uses the UserTransaction object which glassfish forbids.
@TransactionManagement(TransactionManagementType.BEAN)
@Timeout
private void timeout(Timer aTimer) {
- LOG.debug("Timer expired!!!");
+ LOG.info("Timer expired!!!");
try {
DirectoryMonitor monitor = BeanKernel.getBeanFactory().find(
DirectoryMonitor.class);
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
version="3.0">
-
- <!-- enterprise-beans>
+
+ <enterprise-beans>
<message-driven>
- <ejb-name>TimerBean</ejb-name>
+ <ejb-name>TimerBean</ejb-name>
<ejb-class>org.wamblee.timer.TimerBean</ejb-class>
- <message-destination-ref>
- <message-destination-ref-name>MythtvTimer</message-destination-ref-name>
- </message-destination-ref>
+ <messaging-type>javax.jms.MessageListener</messaging-type>
+ <message-destination-type>javax.jms.Queue</message-destination-type>
+ <message-destination-link>InternalBootstrapQueue</message-destination-link>
</message-driven>
- </enterprise-beans -->
- <!-- assembly-descriptor>
+ </enterprise-beans>
+ <assembly-descriptor>
<message-destination>
-
- <message-destination-name>MythtvTimer</message-destination-name>
- <mapped-name>jms/MythtvTimer</mapped-name>
+ <message-destination-name>InternalBootstrapQueue</message-destination-name>
</message-destination>
- </assembly-descriptor -->
-
-</ejb-jar>
\ No newline at end of file
+ </assembly-descriptor>
+</ejb-jar>
<enterprise-beans>
<ejb>
- <ejb-name>MythtvTimer</ejb-name>
+ <ejb-name>TimerBean</ejb-name>
<jndi-name>jms/MythtvTimer</jndi-name>
</ejb>
+ <message-destination>
+ <message-destination-name>InternalBootstrapQueue</message-destination-name>
+ <jndi-name>jms/MythtvTimer</jndi-name>
+ </message-destination>
+
</enterprise-beans>
-
+
</sun-ejb-jar>
\ No newline at end of file
<res-ref-name>MythtvConnectionFactory</res-ref-name>
<jndi-name>jms/MythtvConnectionFactory</jndi-name>
</resource-ref>
-
-
- <message-destination-ref>
- <message-destination-ref-name>MythtvTimer</message-destination-ref-name>
- <jndi-name>jms/MythtvTimer</jndi-name>
- </message-destination-ref>
-
+
</sun-web-app>
\ No newline at end of file
<persistence-context-ref-name>persistence/mythtv</persistence-context-ref-name>
</persistence-context-ref>
- <!-- resource-ref>
+ <resource-ref>
<res-ref-name>MythtvConnectionFactory</res-ref-name>
<res-type>javax.jms.ConnectionFactory</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
- </resource-ref -->
+ </resource-ref>
- <!-- message-destination-ref>
- <message-destination-ref-name>jms/MythtvTimer</message-destination-ref-name>
+ <message-destination-ref>
+ <message-destination-ref-name>MythtvTimer</message-destination-ref-name>
<message-destination-type>javax.jms.Queue</message-destination-type>
<message-destination-usage>Produces</message-destination-usage>
- <message-destination-link>Timer</message-destination-link>
- </message-destination-ref -->
+ <message-destination-link>InternalBootstrapQueue</message-destination-link>
+ </message-destination-ref>
</web-app>