{"id":533,"date":"2009-10-18T10:24:12","date_gmt":"2009-10-18T15:24:12","guid":{"rendered":"http:\/\/www.andygibson.net\/blog\/?p=533"},"modified":"2010-07-27T21:46:07","modified_gmt":"2010-07-28T02:46:07","slug":"logging-conversation-demarcation-in-seam","status":"publish","type":"post","link":"http:\/\/www.andygibson.net\/blog\/tutorial\/logging-conversation-demarcation-in-seam\/","title":{"rendered":"Logging Conversation Demarcation In Seam"},"content":{"rendered":"<p>One way to see where your conversations start and end is to use the Seam event model to observe the conversation start and ends. <\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Name(&quot;conversationListener&quot;)\r\n@Scope(STATELESS)\r\npublic class ConversationListenerBean implements ConversationListener {\r\n\r\n\t@Logger\r\n\tprivate Log log;\r\n\t\r\n\t@In\r\n\tprivate Conversation conversation;\r\n\r\n\t@Observer(value=&quot;org.jboss.seam.beginConversation&quot;)\r\n\tpublic void observeConversationStart() {\r\n\t\tlog.debug(&quot;Conversation #0 Started&quot;,conversation.getId());\t\t\r\n\t}\r\n\t\r\n\t@Observer(value=&quot;org.jboss.seam.endConversation&quot;)\r\n\tpublic void observeConversationEnd() {\r\n\t\tlog.debug(&quot;Conversation #0 Ended&quot;,conversation.getId());\r\n\t\t\r\n\t}\r\n}\r\n<\/pre>\n<p>Just add this bean into your project and it will automatically log when you start and end conversations. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>One way to see where your conversations start and end is to use the Seam event model to observe the conversation start and ends. @Name(&quot;conversationListener&quot;) @Scope(STATELESS) public class ConversationListenerBean implements ConversationListener { @Logger private Log log; @In private Conversation conversation; @Observer(value=&quot;org.jboss.seam.beginConversation&quot;) public void observeConversationStart() { log.debug(&quot;Conversation #0 Started&quot;,conversation.getId()); } @Observer(value=&quot;org.jboss.seam.endConversation&quot;) public void observeConversationEnd() { log.debug(&quot;Conversation [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[64],"tags":[6,8],"_links":{"self":[{"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/posts\/533"}],"collection":[{"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/comments?post=533"}],"version-history":[{"count":6,"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/posts\/533\/revisions"}],"predecessor-version":[{"id":1171,"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/posts\/533\/revisions\/1171"}],"wp:attachment":[{"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/media?parent=533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/categories?post=533"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.andygibson.net\/blog\/wp-json\/wp\/v2\/tags?post=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}