Tuesday Sep 24, 2013

Session Report: JSR 341: Expression Language 3.0

Ed Burns, Consulting Member of Technical Staff, and Kinman Chung, Principle Member of Technical Staff, both at Oracle, presented a session on Monday in which they described new features in JSR 341, Expression Language (EL) 3.0. They discussed the APIs for the use of EL in standalone environments and EL syntax for new operators, plus lambda expressions, and support for collection objects, all the while offering copious code illustrations.

Burns remarked that he was pleased that Java Champion and JavaOne Rock Star Adam Bien had referred to EL 3.0 as “the hidden gem of Java EE”. “I don’t know how hidden it is,” said Burns, “but I think it’s a gem.”

He discussed the origins of EL, which has a long and active history in the Java platform. EL began in 2004 as part of the Java Standard Tag Library (JSTL 1.0), moved to JSP 2.0 in 2006, and became an independent specification with JSR 341 in 2011. It is used in JSF, CDI, and Avatar. Now, 9 years after its inception, it is an independent specification that is heavily used in JSF.   

Burns observed that the presence of EL is the key differentiator between Java server and non-java server stacks. “Java server-based web frameworks are likely to use EL,” said Burns. “When you show someone who is not familiar with EL how easy it is to move things together from disparate parts of your application, it’s very compelling.”

The most important feature that EL 3 brings is lambda expressions – developers do not have to wait until Java SE 8 is released. It all runs on Java EE 7, which requires Java SE 7 -- which means that it is currently available. Burns gave a brief discussion of lambda expressions, which basically behave like an anonymous function -- lambdas in EL are EL expressions. They offer full access to the EL environment within the body of the EL lambda expression, something not available from Java SE lambdas. “You won’t be able to refer to other EL things from a plain old SE lambda expression,” said Burns.

The goal of EL 3 is to provide greater expressive power for applications and to use it outside of Java EE. Burns and Chung provided an overview of collection operations and explained EL’s support for stand-alone environments. EL 3 is easy to use outside of Java EE and provides standard data structures: ELContext; ELResolvers; and local variable and function repositories.

They explained that it enables direct EL operations and has: EL expression evaluation; Bean definition; and Function definition. They emphasized that other key parts of Java EE can also be used standalone, such as: Bean Validation; Persistence (JPA); and Contexts and Dependency Injection (CDI). They encouraged developers to consider the possibilities for cloud deployment in: Defining functions and variables and defining beans.

They spent the rest of the session illustrating their key points with a healthy dose of code.

Links and Downloads:
* JSR 341: http://www.jcp.org/en/jsr/detail?id=341
    Download spec and API javadocs

* Project home: https://java.net/projects/el-spec/
   Report spec bugs or RFE for el.next

* RI: https://java.net/projects/uel/
   Maven artifacts available from Maven Central
   Download source and report RI bugs

* Integrated in Glassfish 4.0: https://glassfish.java.net/

You can listen to this session in early October on Parleys.com.

Friday Sep 13, 2013

Simon Ritter Prepares to Show off Java SE 8 at JavaOne

Oracle’s Simon Ritter has more tricks up his sleeve with cars and hand-tracking devices.[Read More]

Wednesday Sep 11, 2013

Internet of Things with Partners

Oracle, Eurotech, Hitachi Communication Technologies America and Hitachi Consulting Collaborate to Present a Live, Conference Attendee People Counter Solution

A joint initiative between Oracle, Eurotech, Hitachi Communication Technologies America (Hitachi CTA) and Hitachi Consulting has led to the creation of a new demonstration of the Internet of Things (IoT) concept: “IoT in Motion – Driving Business Value from Edge Device to Application”. The people counter solution is based on a unique blend of cutting-edge Eurotech hardware, Hitachi SuperJ® Applications Ecosystem, Oracle Java SE Embedded, Oracle Fusion Middleware and Oracle Business Intelligence products and will be showcased at the JavaOne and Oracle OpenWorld San Francisco 2013 conferences, running September 22-26.

IoT in Motion will also be shown on a running basis throughout JavaOne and Oracle OpenWorld 2013 at:

  • Java DEMOgrounds and OTN Lounge at JavaOne (#5207)
  • Eurotech booth at JavaOne (#5616)
  • Hitachi CTA booth at JavaOne (#5507)
  • Hitachi Consulting booth at Oracle OpenWorld (#1901 Moscone South)

JavaOne 2013 Session ID: CON7824 - The Enterprise of Things: Extending the Enterprise from the Data Center to Devices on Thursday, September 26 from 12:30-1:30 p.m. in the Hotel Nikko, Monterey I/II

  • 17 Eurotech People Counters will be installed at a variety of locations at JavaOne and Oracle OpenWorld including:
  • Moscone North, Hall D – JavaOne and Oracle OpenWorld keynotes
  • Java Exhibition Hall (Hilton San Francisco Union Square)
  • JavaOne registration area (Hilton San Francisco Union Square)
  • Java DEMOgrounds and OTN Lounge at JavaOne (#5207)
  • Eurotech booth at JavaOne (#5616)
  • Hitachi CTA booth at JavaOne (#5507)
  • Hitachi Consulting booth at the Oracle OpenWorld exhibition hall (#1901 Moscone South)

Oracle Press Release: Industry Leading Companies to Showcase How Customers Can Achieve Business Value from the Internet of Things at JavaOne and Oracle OpenWorld San Francisco 2013

Wednesday Jul 03, 2013

Devoxx Belgium - CFP Closes On July 5th

The biggest Java conference in Europe is taking place in Antwerp, Belgium from November 11 to 15, 2013. The conference is designed by developers for developers and attracts renowned international speakers.

The review committee looks for passionate speakers who are technically knowledgeable and not afraid to speak in front of a full room of Devoxxians.

The speakers can increase CFP acceptance rate by submitting one or more talks for Tools in Action, Quickie, BOF, University session, Conference and Hands On Labs sessions.

Thursday Jun 27, 2013

An Overview of Batch Processing in Java EE 7

Up on otn/java is a new article by Oracle senior software engineer Mahesh Kannan, titled “An Overview of Batch Processing in Java EE 7.0,” which explains the new batch processing capabilities provided by JSR 352 in Java EE 7. Kannan explains that “Batch processing is used in many industries for tasks ranging from payroll processing; statement generation; end-of-day jobs such as interest calculation and ETL (extract, load, and transform) in a data warehouse; and many more. Typically, batch processing is bulk-oriented, non-interactive, and long running—and might be data- or computation-intensive. Batch jobs can be run on schedule or initiated on demand. Also, since batch jobs are typically long-running jobs, check-pointing and restarting are common features found in batch jobs.”

JSR 352 defines the programming model for batch applications plus a runtime to run and manage batch jobs. The article covers feature highlights, selected APIs, the structure of Job Scheduling Language, and explains some of the key functions of JSR 352 using a simple payroll processing application. The article also describes how developers can run batch applications using GlassFish Server Open Source Edition 4.0.

Kannan summarizes the article as follows:

“In this article, we saw how to write, package, and run simple batch applications that use chunk-style steps. We also saw how the checkpoint feature of the batch runtime allows for the easy restart of failed batch jobs. Yet, we have barely scratched the surface of JSR 352. With the full set of Java EE components and features at your disposal, including servlets, EJB beans, CDI beans, EJB automatic timers, and so on, feature-rich batch applications can be written fairly easily.”

Check out the article here.

Friday Jun 21, 2013

JCP Survey!

The London Java Community (LJC), which is an Executive Committee member of the Java Community Process (JCP), is asking Java developers to participate in a JCP survey titled "What should the JCP be doing?

The JCP is the mechanism that decides on future standards related to Java technology. Those standards give users like you a choice of technologies to develop with and more independence from vendor solutions.  

The JCP cares about community feedback and has successfully encouraged community participation using transparent tracking processes. Take the survey, your feedback matters. 

Tuesday Apr 30, 2013

Everything on the NetBeans Platform

NetBeans Principal Product Manager Geertjan Wielenga describes a myriad of software tools and applications in his blog in fields as diverse as biology, security, airport management, data analysis, data modeling, radiology, home automation, retail, and equipment safety - all of them created on the Netbeans Platform: 
  • Alphalogic, an easy to use tool with high level integration, control and monitoring for engineering systems and security systems 
  • Platypus Application Designer, a tool to develop the structure of database applications, reusable SQL queries and client/server applications
  • Sypherlink Harvester, a tool collecting metadata, database statistics, sample data and more in relational and non-relational data sources
  • Total Airport Management (TAM) 
  • Summit Management Systems, an data acquisition and floor plant monitoring tools for assembly processes
  • Integrated Service Technology, a testing and analysis solution for integrated circuits 
  • DigiMed, a radiology software for hospitals in Mexico 
  • Ksenia, a security system configuration software 
  • Vimar, a home automation management software 
  • Phyloviz, a visualization software tool for Phylogenetics
  • Delcam Crispin, a footwear CAD/CAM software 
  • Autopsy, a digital forensics platform
  • Sristy Technologies, a software solutions to analyze seismic data, drilling, completion and reservoirs for the energy sector
  • HEIDE, a multiprocessor microcontroller platform 
  • SIEUFERD, a universal user interface for relational databases 
  • Polaris Slipstream, an extensive data modeling application designed for NASA Mission visualization
  • MammoControl DIANNA, a tools analyzing and transmitting managraphy images for the German Breast Cancer Screening Program 
  • IGS-Bio, a motion capture software application
  • Klinika Medical Assistant, a EMR software used in the Philipines 
  • A series of software from Satlantic, an ocean technology company 
  • Mongkie, an integrated network visualization platform for biological data 
  • 4Vending, a vending machine management solution 
  • Piraso, an open source debugger and analyzer tool 
  • SafetyMach, a European safety requirement software 
Check his blog for details on each project. 


Monday Apr 08, 2013

Technical Article: Java EE 7 and JAX-RS 2.0

A new article by Java Champion Adam Bien, titled “Java EE 7 and JAX-RS 2.0” is up on otn/java. The article demonstrates how Java EE 7 with JAX-RS 2.0 has several new useful features which further simplify development, and lead to the creation of more sophisticated Java SE/EE RESTful applications.

Using a Java-friendly, but simplistic JAX-RS 2.0 example Bien takes the reader through aspects, request interception, client and configuration issues and much more. He concludes the article as follows:

“Interestingly, JAX-RS does not even require a full-fledged application server. After fulfilling the specified Context Types, a JAX-RS 2.0–compliant API can be anything. However, the combination with EJB 3.2 brings asynchronous processing, pooling (and so throttling), and monitoring. Tight integration with Servlet 3+ comes with efficient asynchronous processing of @Suspended responses through AsyncContext support and CDI runtime brings eventing. Also Bean Validation is well integrated and can be used for validation of resource parameters. Using JAX-RS 2.0 together with other Java EE 7 APIs brings the most convenient (=no configuration) and most productive (=no re-invention) way of exposing objects to remote systems.”

Check out the article here.

Wednesday Nov 21, 2012

Get Started with JavaFX 2 and Scene Builder

Up on otn/java is a very useful article by Oracle Java/Middleware/Core Tech Engineer Mark Heckler, titled, “How to Get Started (FAST!) with JavaFX 2 and Scene Builder.”  Heckler, who has development experience in numerous environments, shows developers how to develop a JavaFX application using Scene Builder “in less time than it takes to drink a cup of coffee, while learning your way around in the process”.

He begins with a warning and a reassurance: “JavaFX is a new paradigm and can seem a bit imposing when you first take a look at it. But remember, JavaFX is easy and fun. Let's give it a try.”

Next, after showing readers how to download and install JDK/JavaFX and Scene Builder, he informs the reader that they will “create a simple JavaFX application, create and modify a window using Scene Builder, and successfully test it in under 15 minutes.”

Then readers download some NetBeans files:
EasyJavaFX.java contains the main application class. We won't do anything with this class for our example, as its primary purpose in life is to load the window definition code contained in the FXML file and then show the main stage/scene. You'll keep the JavaFX terms straight with ease if you relate them to the theater: a platform holds a stage, which contains scenes.

SampleController.java is our controller class that provides the ‘brains’ behind the graphical interface. If you open the SampleController, you'll see that it includes a property and a method tagged with @FXML. This tag enables the integration of the visual controls and elements you define using Scene Builder, which are stored in an FXML (FX Markup Language) file.

Sample.fxml is the definition file for our sample window. You can right-click and Edit the filename in the tree to view the underlying FXML -- and you may need to do that if you change filenames or properties by hand - or you can double-click on it to open it (visually) in Scene Builder.”

Then Scene Builder enters the picture and the task is soon done.

Check out the article here.

Sunday Sep 30, 2012

The Java Specialist: An Interview with Java Champion Heinz Kabutz

Dr. Heinz Kabutz is well known for his Java Specialists’ Newsletter, initiated in November 2000, where he displays his acute grasp of the intricacies of the Java platform for an estimated 70,000 readers; for his work as a consultant; and for his workshops and trainings at his home on the Island of Crete where he has lived since 2006 -- where he is known to curl up on the beach with his laptop to hack away, in between dips in the Mediterranean.

Kabutz was born of German parents and raised in Cape Town, South Africa, where he developed a love of programming in junior high school through his explorations on a ZX Spectrum computer. He received a B.S. from the University of Cape Town, and at 25, a Ph.D., both in computer science.

He will be leading a two-hour hands-on lab session, HOL6500 – “Finding and Solving Java Deadlocks,” at this year’s JavaOne that will explore what causes deadlocks and how to solve them.

Q: Tell us about your JavaOne plans.

A: I am arriving on Sunday evening and have just one hands-on-lab to do on Monday morning. This is the first time that a non-Oracle team is doing a HOL at JavaOne under Oracle's stewardship and we are all a bit nervous about how it will turn out. Oracle has been immensely helpful in getting us set up. I have a great team helping me: Kirk Pepperdine, Dario Laverde, Benjamin Evans and Martijn Verburg from jClarity, Nathan Reynolds from Oracle, Henri Tremblay of OCTO Technology and Jeff Genender of Savoir Technologies.

Monday will be hard work, but after that, I will hopefully get to network with fellow Java experts, attend interesting sessions and just enjoy San Francisco. Oh, and my kids have already given me a shopping list of things to get, like a GoPro Hero 2 dive housing for shooting those nice videos of Crete. (That's me at the beginning diving down.)

Q: What sessions are you attending that we should know about?

A: Sometimes the most unusual sessions are the best. I avoid the "big names". They often are spread too thin with all their sessions, which makes it difficult for them to deliver what I would consider deep content. I also avoid entertainers who might be good at presenting but who do not say that much.

In 2010, I attended a session by Vladimir Yaroslavskiy where he talked about sorting. Although he struggled to speak English, what he had to say was spectacular. There was hardly anybody in the room, having not heard of Vladimir before. To me that was the highlight of 2010. Funnily enough, he was supposed to speak with Joshua Bloch, but if you remember, Google cancelled. If Bloch has been there, the room would have been packed to capacity.

Q: Give us an update on the Java Specialists’ Newsletter.

A: The Java Specialists' Newsletter continues being read by an elite audience around the world. The apostrophe in the name is significant.  It is a newsletter for Java specialists. When I started it twelve years ago, I was trying to find non-obvious things in Java to write about. Things that would be interesting to an advanced audience.

As an April Fool's joke, I told my readers in Issue 44 that subscribing would remain free, but that they would have to pay US$5 to US$7 depending on their geographical location. I received quite a few angry emails from that one. I would have not earned that much from unsubscriptions. Most readers stay for a very long time.

After Oracle bought Sun, the Java community held its breath for about two years whilst Oracle was figuring out what to do with Java. For a while, we were quite concerned that there was not much progress shown by Oracle. My newsletter still continued, but it was quite difficult finding new things to write about. We have probably about 70,000 readers, which is quite a small number for a Java publication. However, our readers are the top in the Java industry. So I don't mind having "only" 70000 readers, as long as they are the top 0.7%.

Java concurrency is a very important topic that programmers think they should know about, but often neglect to fully understand. I continued writing about that and made some interesting discoveries. For example, in Issue 165, I showed how we can get thread starvation with the ReadWriteLock. This was a bug in Java 5, which was corrected in Java 6, but perhaps a bit too much. Whereas we could get starvation of writers in Java 5, in Java 6 we could now get starvation of readers. All of these interesting findings make their way into my courseware to help companies avoid these pitfalls.

Another interesting discovery was how polymorphism works in the Server HotSpot compiler in Issue 157 and Issue 158. HotSpot can inline methods from interfaces that have only one implementation class in the JVM. When a new subclass is instantiated and called for the first time, the JVM will undo the previous optimization and re-optimize differently.

Here is a little memory puzzle for your readers:

public class JavaMemoryPuzzle {
  private final int dataSize =
      (int) (Runtime.getRuntime().maxMemory() * 0.6);

  public void f() {
    {
      byte[] data = new byte[dataSize];
    }
    byte[] data2 = new byte[dataSize];
  }

  public static void main(String[] args) {
    JavaMemoryPuzzle jmp = new JavaMemoryPuzzle();
    jmp.f();
  }
}


When you run this you will always get an OutOfMemoryError, even though the local variable data is no longer visible outside of the code block.

So here comes the puzzle, that I'd like you to ponder a bit. If you very politely ask the VM to release memory, then you don't get an OutOfMemoryError:

public class JavaMemoryPuzzlePolite {
  private final int dataSize =
      (int) (Runtime.getRuntime().maxMemory() * 0.6);

  public void f() {
    {
      byte[] data = new byte[dataSize];
    }

    for(int i=0; i<10; i++) {
      System.out.println("Please be so kind and release memory");
    }
    byte[] data2 = new byte[dataSize];
  }

  public static void main(String[] args) {
    JavaMemoryPuzzlePolite jmp = new JavaMemoryPuzzlePolite();
    jmp.f();
    System.out.println("No OutOfMemoryError");
  }
}


Why does this work? When I published this in my newsletter, I received over 400 emails from excited readers around the world, most of whom sent me the wrong explanation. After the 300th wrong answer, my replies became unfortunately a bit curt. Have a look at Issue 174 for a detailed explanation, but before you do, put on your thinking caps and try to figure it out yourself.

Q: What do you think Java developers should know that they currently do not know?

A: They should definitely get to know more about concurrency. It is a tough subject that most programmers try to avoid. Unfortunately we do come in contact with it. And when we do, we need to know how to protect ourselves and how to solve tricky system errors.

Knowing your IDE is also useful. Most IDEs have a ton of shortcuts, which can make you a lot more productive in moving code around. Another thing that is useful is being able to read GC logs. Kirk Pepperdine has a great talk at JavaOne that I can recommend if you want to learn more. It's this: CON5405 – “Are Your Garbage Collection Logs Speaking to You?”

Q: What are you looking forward to in Java 8?

A: I'm quite excited about lambdas, though I must confess that I have not studied them in detail yet. Maurice Naftalin's Lambda FAQ is quite a good start to document what you can do with them. I'm looking forward to finding all the interesting bugs that we will now get due to lambdas obscuring what is really going on underneath, just like we had with generics.

I am quite impressed with what the team at Oracle did with OpenJDK's performance. A lot of the benchmarks now run faster.

Hopefully Java 8 will come with JSR 310, the Date and Time API. It still boggles my mind that such an important API has been left out in the cold for so long.

What I am not looking forward to is losing perm space. Even though some systems run out of perm space, at least the problem is contained and they usually manage to work around it. In most cases, this is due to a memory leak in that region of memory. Once they bundle perm space with the old generation, I predict that memory leaks in perm space will be harder to find. More contracts for us, but also more pain for our customers.

Originally published on blogs.oracle.com/javaone.

About

Insider News from the Java Team at Oracle!

duke
javeone logo
Links


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
5
6
7
12
13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today