ebook img

Java Magazine 2013 01-02 PDF

8.8 MB·English
by  Oracle
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Java Magazine 2013 01-02

//table of contents / Y T I N U M M O COMMUNITY 62 C 02 Enterprise Java From the Editor Secure Java EE N 04 Authentication O I T Java Nation Implementing login authenti- C A News, people, and events cation using declarative and N programmatic security A I 14 V 68 A JCP Executive Series J Rich Client Q&A with Credit Suisse Integrating Web and EC members on the JCP Java Client Applications H C JAVA TECH with Social Media E T 40 Johan Vos gets social. A V New to Java 76 A J Introduction to Web Mobile and Embedded Service Security from Getting Started with Server to Client JSR 281 The final installment in this Bring IP Multimedia S series from Max Bonbhel Subsystem services to Java- U T enabled devices. 49 U O Java Architect 81 B A Demystifying Mobile and Embedded invokedynamic Swing into Mobile Learn how to use invoke- The Lightweight UI Toolkit dynamic in your code. and Nokia Series 40 phones 20 26 31 36 55 85 Java Architect Polyglot Programmer EMBEDDED TOP 10 Java in Action Java in Action Java Compiler Plug-ins Building Actor-Based REASONS JAVA ARRIVES THE FUTURE in Java 8 Systems Using the Akka EVERYWHERE TO USE JAVA ON A $25 OF MONEY Extend the Java compiler Framework IN EMBEDDED BOARD The Royal with new behavior. Ted Neward wraps up this APPS The inspiration Canadian Mint two-part series. 58 Why Java is the behind the banks on Java Terrence Barr on Java and the Internet Java Architect 92 language of choice Raspberry Pi Card for its digital blog of Things The New javax.cache Fix This currency offering. Caching Standard Take our embedded code The lowdown on javax.cache challenge. COVER ART BY I-HUA CHEN, NICHOLAS PAVKOVIC 01 ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013 //from the editor / Y T I N U M M O C N O I T C T A N I A V A FIND YOUR J JUG HERE H he age of embedded computing is here. Analysts predict that within this decade, we’ll see tens of C E billions of embedded computational devices entering our daily lives. And the possibilities for these “smart” T My local and global JUGs A devices are literally endless: connected vehicles, appliances, utility meters, medical devices, industrial con- are great places to network V A both for knowledge and work. J trollers, and even a contraption that monitors how much alcohol your local bartender pours into your cocktail. My global JUG introduces In this embedded-focused issue, we explore why Java is the best language choice for embedded develop- me to Java developers all ment. In “Embedded Everywhere,” Oracle’s Terrence Barr talks about why Java’s write once, run anywhere over the world. S technology is perfectly positioned for the coming wave of embedded devices. He sees Java in the embedded Régina ten Bruggencate U JDuchess T space creating an open, standardized technology infrastructure. What’s more, Java offers 9 million developers U O who can apply their knowledge to embedded development. Barr talks about getting started with embedded B LEARN MORE A development using a Keil board and also explores what embedded device growth will mean for big data. In “Top Ten Reasons for Using Java in Embedded Apps,” Simon Ritter makes a case for Java as the go-to language for embedded. “We already have a wheel,” he says. “Let’s not keep inventing new ones.” We also bring you two stories of embedded Java in action. In “Java Arrives on a //send us your feedback / $25 Board,” we talk with Raspberry Pi Foundation Cofounder Eben Upton about the low-cost programmable computer and Java’s role. In “The Future of Money,” We’ll review all suggestions for future we explore the emerging world of digital currency and introduce you to the Royal improvements. Canadian Mint’s digital currency, MintChip, which runs on the Java Card platform. Depending on volume, The embedded space presents exciting opportunities for Java developers. It’s a some messages may new year, and a really great time to be a Java developer. not get a direct reply. blog Caroline Kvitka, Editor in Chief BIO PHOTOGRAPH BY BOB ADLER 02 ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013 Y T I N Learn Java U M EDITORIAL PUBLISHING M Editor in Chief Vice President O Caroline Kvitka Jeff Spicer C Community Editors Publisher Cassandra Clark, Sonya Barry, Jennifer Hamilton +1.650.506.3794 Yolande Poirier Audience Development and Java in Action Editor Operations Director N On Demand O Michelle Kovac Karin Kinnear +1.650.506.1985 I T Technology Editors C ADVERTISING SALES Janice Heiss, Tori Wieldt A Contributing Writer Associate Publisher N Kyle Walkenhorst +1.323.340.8585 I Kevin Farnham A Northwest and Central U.S. V Contributing Editors Tom Cometa +1.510.339.2403 A Claire Breen, Blair Campbell, Karen Perkins J Southwest U.S. and LAD DESIGN Shaun Mehr +1.949.923.1660 —Oracle University— Senior Creative Director Northeast U.S. and EMEA/APAC Francisco G Delgadillo Mark Makinney +1.805.709.4745 H Senior Design Director Advertising Sales Assistant C E Suemi Lam Cindy Elhaj +1.626.396.9400 x 201 T Design Director Mailing-List Rentals A Richard Merchán Contact your sales representative. V A Contributing Designers J RESOURCES Jaime Ferrand, Nicholas Pavkovic Oracle Products Production Designers +1.800.367.8674 (U.S./Canada) Sheila Brennan, Kathy Cygnarowicz Oracle Services Complete Classroom Content +1.888.283.0591 (U.S.) S Oracle Press Books U oraclepressbooks.com T U Highest Rated Instructors O B ARTICLE SUBMISSION A If you are interested in submitting an article, please e-mail the editors. Immediate Online Access SUBSCRIPTION INFORMATION Subscriptions are complimentary for qualified individuals who complete the subscription form. Search, Pause & Rewind Anytime MAGAZINE CUSTOMER SERVICE [email protected] Phone +1.847.763.9635 PRIVACY Oracle Publishing allows sharing of its mailing list with selected third parties. If you prefer that your mailing address or e-mail address not be included in this program, contact Customer Service. Copyright © 2013, Oracle and/or its affiliates. All Rights Reserved. No part of this publication may be reprinted or otherwise reproduced without permission from the editors. JAVA MAGAZINE IS PROVIDED ON AN “AS IS” BASIS. ORACLE EXPRESSLY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY Preview Now DAMAGES OF ANY KIND ARISING FROM YOUR USE OF OR RELIANCE ON ANY INFORMATION PROVIDED HEREIN. The information is intended to outline our general product direction. It is intended for information purposes only, and may not be blog incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Oracle and Java are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Java Magazine is published bimonthly with a free subscription price by Oracle, 500 Oracle Parkway, MS OPL-3C, Redwood City, CA 94065-1600. Digital Publishing by Texterity ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013 //java nation / Y T JavaOne Brazil / I N U M M O C Brazil) is a shining example of how to be a positive contributor to Java,” he said. N Oracle’s Georges Saab discussed some O I of the recent and upcoming changes T C to Java. “In addition to the incremental A N improvements to Java 7, we have also I A increased the set of platforms supported V A J by Oracle from Linux, Windows, and Oracle Solaris to now also include Mac OS X and Linux/ARM for ARM-based H PCs such as the Raspberry Pi and emerg- C E T ing ARM-based microservers.” A Oracle’s Staffan Friberg provided an V A overview of some changes coming in J Java 8, including lambda expressions, The Java band entertains the removal of the permanent generation Henrik Stahl crowd at the Community keynote. (PermGen) heap, improved date and S U time APIs, and improved security. T Oracle’s Judson Althoff started his talk U O off with a bang. “The Internet of Things B A JAVAONE is on a collision course with big data, and this is a huge opportunity for devel- opers,” he said. Althoff noted that a car embedded with sensors for fuel effi- LOOKS FORWARD ciency, temperature, and tire pressure Georges Saab can generate a petabyte of data a day. When a “blue screen of death” appeared for the Technical keynote, JavaOne Brazil took place in São Paulo, for Java,” said Oracle’s Henrik Stahl in presenters gladly went on without their Brazil, December 4–6. Latin America is kicking off the Java Strategy and Java slides. What followed was a collection of an important development hub, and it Technical keynotes on the first day of the demos, including JavaFX on a tablet and looks as though JavaOne Brazil, now in conference. He noted that the success of a look at Project Easel in NetBeans. blog its third year, is here to stay. “We con- Java depends on technological innova- Throughout the conference, attendees tinually come back to Latin America tion, strong stewardship from Oracle, chose from dozens of sessions, more because of the dedication the commu- and community participation. “The Latin than half of which were selected by the PHOTOGRAPHS BY LUCIANA AITH, nity has to driving continued innovation American Java community (especially in community, and six hands-on labs. ORQUESTRA DE IMAGENS 04 ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013 //java nation / Y JavaOne Brazil / T I N U M M O C DUKE’S CHOICE LAD WINNERS HONORED N O I At JavaOne Brazil, winners of the TIVIT Software’s Central de Cessão T C first regional Duke’s Choice Awards de Crédito (C3) project is a Java- Geeks Ride Again A N were recognized for their innovative based high-performance scalable I A use of Java. transactional distributed system V A J The winners of the Duke’s that intermediates and manages Choice Awards LAD are TQTVD all credit assignment operations Software, TIVIT Software, and CPqD between financial institutions in H Foundation. While all of the winners Brazil and tracks credit ownership. It C E hail from Brazil, nominations were was developed as a result of BACEN T A received from across the region. (the Central Bank of Brazil) identify- V A Nominees included NeoTropic’s ing irregular credit assignment oper- J Kuwaiba project and Vortexbird’s ations between financial institutions Zathura Code Generator project that created a deficit of R$4.3 billion happening in Colombia. Judges in the Brazilian banking system. Java enthusiasts donned bike S included Yara and Vinicius Senger CPqD Foundation’s SMTVI helmets and Duke’s bike jerseys U T of SouJava Brazil and Alexis Lopez of (Multiplatform Services for Digital on the Saturday before JavaOne U O ColombiaJUG. Interactive TV) project dramatically Brazil for a riding tour of São B A improved the digital literacy of the Paulo. At this now-traditional HERE’S A LOOK AT EACH WINNER: majority of the Brazilian popula- preconference ride, more than TQTVD Software’s AstroTV project tion. This population has insufficient 20 participants enjoyed cycling is the Brazilian middleware compli- financial resources to keep up with from Bicycle Park through down- ant with the Ginga specification that new technological developments; town on street lanes closed off allows full interactivity, extended TV is its only technology resource. for bicyclists. The ride was 30 content programming, and porta- The project included the creation of kilometers, but participants bility. The Java-based Ginga specifi- interactive digital TV applications could opt to take the subway for cation is the intermediate software in the areas of health, retirement, part of the trip. layer that enables the develop- employment, chat, weather, news, Top: TQTVD’s David Britto with Stephen Chin (left), Bruno Souza, and Yara ment of interactive applications for e-commerce, education, and games. PHOTOGRAPH BY TORI WIELDT Senger. Center: TIVIT’s Einar Saukas digital TV independently from the The use of Java technology allowed blog and Fabiano Cury with Souza, Chin, and hardware platform of digital receiv- the design of a distributed, scalable, Senger. Bottom: CPqD Foundation’s ers manufacturers (set-top boxes). and service-based architecture. Sonia Mayumi Kutiishi and Hugo Cesar AstroTV has been embedded in with Souza, Chin, and Senger. more than 3 million devices. 05 PHOTOGRAPHS BY LUCIANA AITH, ORQUESTRA DE IMAGENS ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013 //java nation / Y T I N U DEVOXX attendees to like or dislike sessions. Oracle’s M M Jasper Potts created an interactive schedule O C using JavaFX for attendees’ convenience. 2012 Parleys, the Java e-learning Website, was redesigned with HTML5 and GlassFish, N O and allowed speakers to post their slides TI INNOVATES C online before their talks and then sync the A N soundtracks with the slides. During the I A conference, attendees participated in hands- V A on workshops and enjoyed coding with their J peers in the hackergarten, which hosted Stephen Chin’s NightHacking and a live cod- H ing project called Code Story. C E The keynote was introduced by five danc- T A ing humanoid Nao robots, setting the V A stage for a talk by Oracle’s Nandini Ramani J about technical advances and the latest Java embedded technologies. “Java contin- ues to drive the applications and devices S that enrich our interactivity with the world U T around us,” she said. U O Oracle technologists presented details B Devoxx, the biggest Java conference in of improvements to the Java platform. Joe A Nao robots welcomed Devoxx Europe, hosted 3,400 attendees from 40 Darcy and Dalibor Topic discussed the latest attendees (above); Nandini Ramani talked about the future of Java. countries November 14–16 in Brussels, update to JDK 7 and the upcoming features Belgium. Through word of mouth, it sold out in JDK 8. Jasper Potts, Jonathan Giles, Jim six weeks in advance and had hundreds of Weaver, and Michael Heinricks presented developers on the waiting list. The confer- eight talks on effective client development ence is “for developers, by developers,” and with JavaFX using its UI controls, TableView, that’s the key to its success, according to and Scene Builder. Simon Ritter, Stephen attendees. In 200 technical sessions, 190 Chin, and Daniel Blaukopf talked about well-known Java community experts talked programming and front-end development about the latest products, frameworks, Java on devices with Java embedded. Shaun language improvements, and more. Smith, Marek Potociar, Arun Gupta, Jitendra blog Catch the sights and sounds of Devoxx Conference innovation included a room Kotamraju, and David Delabasse presented 2012. display monitor infrastructure that used the evolution of Java persistence, JSON pro- Oracle Java SE Embedded running on a cessing, JAX-RS, and WebSocket in a series PHOTOGRAPHS COURTESY OF DEVOXX Raspberry Pi and a rating application for of sessions over the three days. 06 ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013 //java nation / Y T I N U M M Tridium Wins Oracle O C Excellence Award N O I T Tridium, which develops solutions for connecting C A devices to the enterprise, has won the 2012 Oracle N Excellence Award for Java Business Innovation. The A I V company’s Java-based Niagara Framework integrates A J diverse systems and devices, regardless of commu- nication protocol, into a unified platform that can be DEVOXX4KIDS easily managed and controlled in real time over the H C internet using a standard Web browser. The frame- E T work facilitates remote energy metering, home auto- A Tridium’s John Sublett V mation, and industrial process management. A The first Devoxx4Kids one-day coding workshops took place (left) with Oracle’s Tridium was recognized for using Java embedded J Judson Althoff October 13 and October 20 in Brussels, Belgium (in Flemish technology and Java SE to create new possibilities and French). One of the speakers was a Nao robot that talked for addressing how devices and systems connect about the fun of learning programming and showed off its and interact with each other, as well as with the core enterprise platform. Its S karate moves. Sixty students age 11 to 14 attended three ses- Niagara Framework has been implemented in varied application environ- U T sions where they programmed Lego Mindstorm and Mars ments across many different business sectors. Tridium has applied Java’s U O Rover robots and coded with Scratch, a drag-and-drop pro- entire platform spectrum, from embedded to enterprise, to create a uniform B A gramming interface to create interactive stories and games. software environment that integrates microdevices with each other and links Stephan Janssen, the organizer behind the popular Devoxx them back to the enterprise applications of which they are components. Java conference, was inspired to organize this event by his son. “My 11-year-old son wanted to learn programming, and I could NightHacking Tour not find any content in Flemish,” he said. He partnered with Tasha Carl, who organized robotic workshops with Greenlight Java Evangelist Stephen Chin recently wrapped up for Girls, an organization encouraging young girls to consider a his three-week NightHacking Tour across Europe on future in science, technology, engineering, or math. a BMW motorcycle. He went to the Devoxx and JFall At the Devoxx keynote in November, Janssen announced conferences and five Java user group events, and in- that Java user groups and developers can use his content and terviewed more than 30 NightHackers in 7 countries. Web infrastructure to replicate Devoxx4Kids in their regions. Highlights of the tour included hacking events in “The workshops were really fun and such a rewarding experi- blog London, England; Munich, Germany; Turin, Italy; and ence,” he said. Oracle’s Yolande Poirier Lyon and Paris, France; and a behind-the-scenes tour So far, Devoxx4Kids events are being organized in the chats with Stephen Chin. at Aldebaran Robotics. Watch all of the interviews. Netherlands, the UK, and France. 07 PHOTOGRAPHS COURTESY OF DEVOXX; TRIDIUM BY ORANGE PHOTOGRAPHY ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013 //java nation / Y embedded / T I N U M M O C M2M HITACHI DEMONSTRATES SMART N O I SENSOR INTEGRATION WITH THE CLOUD T C A Pipelines on the Rise N I A V A Oracle commissioned a recent survey J by machine-to-machine (M2M) mar- ket research firm Beecham Research, H which revealed that development of C E automated M2M data processing pipe- T lines, in which information gathered by A V A remote sensors in embedded devices J is transferred to data centers for fur- ther analysis, is rapidly increasing. The global survey included end users, major S product original-equipment manu- U facturers (OEMs), systems integrators, T U mobile network operators, and M2M O B platform providers. A Most survey respondents viewed M2M data pipelines as being critically At JavaOne 2012, Hitachi’s OSGi SuperJ Engine Framework was deployed to integrate data important. A full 75 percent said their collection from smart sensors (scattered throughout the conference venue) with the cloud. M2M projects are utilized to create new The framework applies Oracle Java SE Embedded to provide the sensors with decision-making services. However, 85 percent noted intelligence and instrument diagnostics. The sensors collected more than 200,000 light, that the large volumes of data that are temperature, humidity, and energy measurements in a two-day period. passed from the remote embedded The raw measurements were preprocessed by the Java Embedded SuperJ Engine applica- devices to the data center create new tion (which ran on a GlobalScale Technologies Mirabox device). The preprocessed results were performance issues. Efficiently filter- transferred to a SeeControl cloud-based global data analysis application, which collated and ing and processing the data to enable processed the data into graphic displays and made them available on the Web. its use for making timely decisions was blog The demonstration was an illustration of the emerging machine-to-machine (M2M) cited as another difficulty. Internet of Things that was a key focus of the very first Java Embedded @ JavaOne conference. View the complete results. ART BY I-HUA CHEN 08 ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013 //java nation / Y T I N U M M O C FEATURED JAVA.NET PROJECT MSRP N Java.net’s Message Session Relay implements all of the requirements O I Protocol (MSRP) project (RFC 4975) of an MSRP peer.” “It’s now ready to T C started out as a 2008 Google Summer be deployed in the real world,” adds A N of Code project. Founder João Antunes Uijldert. I A V wanted to create a library to provide What’s coming up? Uijldert lists A J Jitsi, an open source Java video chat several potential enhancements, application, with file transfer capabil- including integration with the ity via Session Initiation Protocol (SIP, Mobicents JAIN SLEE platform, and H RFC 3261). Antunes preferred creating the development of a C# version of the C E T a full library rather than a Jitsi client, MSRP library. He says that the big- A so the code could be used in any Java gest challenges for this project will be V A J SIP application that requires file trans- the addition of secure communica- fer capability. tion, and possible support of relaying In 2010, Tom Uijldert, of (RFC 4976). And Uijldert is actively ContactMakers, took over MSRP proj- seeking assistance with all this work: S U ect leadership duties. He is currently “Anyone interested in helping out with T the primary developer, and introduced the additional functionality is hereby U O ContactMakers to the features and invited to contact us,” he says. B A capabilities the MSRP library provides. Reflecting on open source and the “The MSRP library provides an ideal MSRP project, Antunes says, “The means for integrating VoIP [Voice over open source spirit is great! With open IP] and chat into a single platform, source, you are making the world go due to its SIP connectivity and forward. Plus, working on an open standards-based programming source project is good for your résumé. model,” he says. As a result, Just sprinkle your code with sufficient This diagram displays the MSRP concept. ContactMakers is currently integrating comments, and apply good coding the library into its call center platform, conventions. That is the best way and they have also become a corpo- for your project to invite third-party rate sponsor of the MSRP project. contributions.” The project has come a long way in blog a very short time. In late November 2012, Version 1.0.4 was released. Antunes says, “Today, the project 09 ORACLE.COM/JAVAMAGAZINE ////////////////////////////////// JANUARY/FEBRUARY 2013

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.