{"id":57,"date":"2012-10-17T13:58:31","date_gmt":"2012-10-17T13:58:31","guid":{"rendered":"http:\/\/blogs.sussex.ac.uk\/coursedata\/?p=57"},"modified":"2012-10-17T14:08:02","modified_gmt":"2012-10-17T14:08:02","slug":"new-features-of-java-ee-6-used-in-this-project-part-1","status":"publish","type":"post","link":"https:\/\/blogs.sussex.ac.uk\/coursedata\/2012\/10\/17\/new-features-of-java-ee-6-used-in-this-project-part-1\/","title":{"rendered":"New features of Java EE 6 used in this project (part 1)"},"content":{"rendered":"<p>The XCRI-CAP project has given us the perfect reason to implement some of the new features of Java EE 6. Glassfish application server 3 is one of the first fully compliant Java EE 6 application servers. I&#8217;d like to mention some of the features I&#8217;ve made use of.<\/p>\n<p>The first is the new scheduling feature found in EJB. The XCRI-CAP file is generated every night by populating a separate DB schema that maps to the XCRI-CAP XSD. Once the schema has been populated, the system regenerates the XCRI-CAP file that is used for the feed. In the past we would have had to use a CRON job to be able to set off the process but EJB 3.1 allows the use of the Schedule annotation. The schedule annotation will turn any EJB method into a timed process in a declarative way, using the\u00a0 schedule annotation. Here is the method we use to set off the nightly process:<\/p>\n<p><code><br \/>\n\/**<br \/>\n* Timed process to update schema and re-populate the XCRI-CAP file<br \/>\n*\/<br \/>\n@Override<br \/>\n@Schedule(second = \"0\", minute = \"0\", hour = \"2\", persistent = false)<br \/>\npublic void populateSchema() {<br \/>\nString academicYear = getAcademicYear();<br \/>\nList progs = loadProgProposals(academicYear);<br \/>\npopulateSchema(\"MAIN\", progs, true, false);<br \/>\n}<br \/>\n<\/code><\/p>\n<p>This process runs every night at 2am. More information on scheduling in Java EE 6 can be found here:<\/p>\n<p><a href=\"http:\/\/docs.oracle.com\/javaee\/6\/tutorial\/doc\/bnboy.html\">http:\/\/docs.oracle.com\/javaee\/6\/tutorial\/doc\/bnboy.html<\/a><\/p>\n<p>More to come in part 2.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The XCRI-CAP project has given us the perfect reason to implement some of the new features of Java EE 6. Glassfish application server 3 is one of the first fully compliant Java EE 6 application servers. I&#8217;d like to mention some of the features I&#8217;ve made use of. The first is the new scheduling feature [&hellip;]<\/p>\n","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[169],"tags":[201,200],"_links":{"self":[{"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/posts\/57"}],"collection":[{"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/comments?post=57"}],"version-history":[{"count":5,"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":62,"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/posts\/57\/revisions\/62"}],"wp:attachment":[{"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/media?parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/categories?post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sussex.ac.uk\/coursedata\/wp-json\/wp\/v2\/tags?post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}