{"action":"opened","issue":{"url":"https://api.github.com/repos/jpamodeler/jgmongo-application-generator/issues/6","repository_url":"https://api.github.com/repos/jpamodeler/jgmongo-application-generator","labels_url":"https://api.github.com/repos/jpamodeler/jgmongo-application-generator/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/jpamodeler/jgmongo-application-generator/issues/6/comments","events_url":"https://api.github.com/repos/jpamodeler/jgmongo-application-generator/issues/6/events","html_url":"https://github.com/jpamodeler/jgmongo-application-generator/issues/6","id":182411625,"number":6,"title":"MongoClientProvider","user":{"login":"avbravo","id":625755,"avatar_url":"https://avatars.githubusercontent.com/u/625755?v=3","gravatar_id":"","url":"https://api.github.com/users/avbravo","html_url":"https://github.com/avbravo","followers_url":"https://api.github.com/users/avbravo/followers","following_url":"https://api.github.com/users/avbravo/following{/other_user}","gists_url":"https://api.github.com/users/avbravo/gists{/gist_id}","starred_url":"https://api.github.com/users/avbravo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avbravo/subscriptions","organizations_url":"https://api.github.com/users/avbravo/orgs","repos_url":"https://api.github.com/users/avbravo/repos","events_url":"https://api.github.com/users/avbravo/events{/privacy}","received_events_url":"https://api.github.com/users/avbravo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-12T01:12:49Z","updated_at":"2016-10-12T01:12:49Z","closed_at":null,"body":"**Generate MongoClientProvider in package provider**\r\n\r\n\r\n\r\nimport com.avbravo.jee8jgmongo.util.JSFUtil;\r\n\r\nimport javax.annotation.PostConstruct;\r\nimport javax.ejb.ConcurrencyManagement;\r\nimport javax.ejb.ConcurrencyManagementType;\r\nimport javax.ejb.Lock;\r\nimport javax.ejb.LockType;\r\nimport javax.ejb.Singleton;\r\n\r\nimport com.mongodb.MongoClient;\r\n\r\n@Singleton\r\n@ConcurrencyManagement(ConcurrencyManagementType.CONTAINER)\r\npublic class MongoClientProvider {\r\n    private MongoClient mongoClient = null;\r\n\t\t\r\n\t@Lock(LockType.READ)\r\n\tpublic MongoClient getMongoClient(){\t\r\n\t\treturn mongoClient;\r\n\t}\r\n\t\r\n\t@PostConstruct\r\n\tpublic void init() {\r\n            try {\r\n                String mongoIpAddress = \"x.x.x.x\";\r\n\t\tInteger mongoPort = 11000;\r\n//                mongoClient = new MongoClient(mongoIpAddress, mongoPort);\t\t\r\n                mongoClient = new MongoClient();\r\n            } catch (Exception e) {\r\n                JSFUtil.addErrorMessage(\"init() \"+e.getLocalizedMessage());\r\n            }\r\n\t\t\t\t\r\n\t}\r\n\t\t\r\n}"}}
{"actor":{"display_login":"avbravo"}}