{"action":"created","issue":{"url":"https://api.github.com/repos/jvirtanen/philadelphia/issues/10","labels_url":"https://api.github.com/repos/jvirtanen/philadelphia/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/jvirtanen/philadelphia/issues/10/comments","events_url":"https://api.github.com/repos/jvirtanen/philadelphia/issues/10/events","html_url":"https://github.com/jvirtanen/philadelphia/issues/10","id":127026576,"number":10,"title":"Accessing FIXSession inside FIXStatusListener","user":{"login":"jheusser","id":1693496,"avatar_url":"https://avatars.githubusercontent.com/u/1693496?v=3","gravatar_id":"","url":"https://api.github.com/users/jheusser","html_url":"https://github.com/jheusser","followers_url":"https://api.github.com/users/jheusser/followers","following_url":"https://api.github.com/users/jheusser/following{/other_user}","gists_url":"https://api.github.com/users/jheusser/gists{/gist_id}","starred_url":"https://api.github.com/users/jheusser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jheusser/subscriptions","organizations_url":"https://api.github.com/users/jheusser/orgs","repos_url":"https://api.github.com/users/jheusser/repos","events_url":"https://api.github.com/users/jheusser/events{/privacy}","received_events_url":"https://api.github.com/users/jheusser/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jvirtanen/philadelphia/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-01-16T14:00:52Z","updated_at":"2016-01-21T18:19:15Z","closed_at":null,"body":"In the example Initiator a `FIXStatusListener` is passed to the `FIXSession` as anonymous class (see [here](https://github.com/jvirtanen/philadelphia/blob/master/philadelphia-initiator/src/main/java/org/jvirtanen/philadelphia/initiator/Initiator.java#L33)). For more complicated `FIXStatusListeners` (or for multiple active `FIXSessions`) it's not convenient to pass it as anonymous class and thus I ended up with the repetitive and bit awkward pattern\r\n\r\n```Java\r\nBaseFixStatusListener statusListener = new BaseFixStatusListener();\r\nFIXSession fixSession = new FIXSession(channel, fixConfig, inbound, statusListener);\r\nstatusListener.setFIXSession(fixSession);\r\n```\r\n\r\nWhere the `BaseFixStatusListener` has a `setFIXSession` method. If you always want to access the `FIXSession` in a `FixStatusListener` it might make sense to add such a setter method to the interface, or similar."},"comment":{"url":"https://api.github.com/repos/jvirtanen/philadelphia/issues/comments/173662389","html_url":"https://github.com/jvirtanen/philadelphia/issues/10#issuecomment-173662389","issue_url":"https://api.github.com/repos/jvirtanen/philadelphia/issues/10","id":173662389,"user":{"login":"jvirtanen","id":183430,"avatar_url":"https://avatars.githubusercontent.com/u/183430?v=3","gravatar_id":"","url":"https://api.github.com/users/jvirtanen","html_url":"https://github.com/jvirtanen","followers_url":"https://api.github.com/users/jvirtanen/followers","following_url":"https://api.github.com/users/jvirtanen/following{/other_user}","gists_url":"https://api.github.com/users/jvirtanen/gists{/gist_id}","starred_url":"https://api.github.com/users/jvirtanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvirtanen/subscriptions","organizations_url":"https://api.github.com/users/jvirtanen/orgs","repos_url":"https://api.github.com/users/jvirtanen/repos","events_url":"https://api.github.com/users/jvirtanen/events{/privacy}","received_events_url":"https://api.github.com/users/jvirtanen/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T18:19:15Z","updated_at":"2016-01-21T18:19:15Z","body":"Great, thanks! :+1:"}}