Java Reference
In-Depth Information
TextMessage message =
session.createTextMessage(txt);
publisher.send(message);
}
catch (Exception exc) {
logger.error("Error ! "+exc);
}
finally {
if (connection != null) {
try {
connection.close();
connection = null;
} catch (JMSException e) {
logger.error(e); }
}
}
}
}
Now you can use your service to notify some application-specific actions. For ex-
ample, we will inject JMSService into the BookerService bean and send a mes-
sage whenever a user registers:
public class BookerService implements
Serializable {
@Inject JMSService jmsService;
. . . . .
Search WWH ::




Custom Search