Java Technology Update
Enhanced for Loop
The enhanced for Loop eliminates the problems associated with using iterators and index variables when iterating over collections and arrays.
|
Facility |
Explanation |
|
Autoboxing/Unboxing |
Eliminates the requirement for manual conversion between primitive types and wrapper types. |
|
Typesafe Enums |
This object oriented enumerated type facility allows enumerated types to be created with arbitrary methods and fields. |
|
Varargs |
Eliminates the need for manually boxing up argument lists into an array when invoking methods that accept variable-length argument lists. |
|
Class Data Sharing |
This features has been designed to reduce application startup time and footprint. |
|
Garbage Collector Ergonomics |
The parallel collector has been enhanced to monitor and adapt to the memory needs of the application. |
|
Server-Class Machine Detection |
The launcher can attempt to detect whether the application is running on a "server-class" machine. |
|
Thread Priority Changes |
Thread priority mapping has been changed allowing Java threads and native threads that do not have explicitly set priorities to compete on an equal footing. |
|
Fatal Error Handling |
This mechanism has been enhanced to provide improved diagnostic output and reliability. |
SYS-ED Java training uses examples, code snippets, and
exercises to demonstrate and teach the
utilization of the Enhanced Loop and its limitations in different base operating environments.
New Java Language
Features
There are a variety of new Java language features:
- Annotation processing which is used for turning off
compiler warnings at a class or method level; they also are
useful in other situations.
- Enums as a major improvement over ints in
terms of type safety.
- Utilization of varargs for cleaning
up ugly code.
- Use of covariant returns in order to
avoid casts when an implementation's return type is known to be more
specific than the APIs.
- Using Covariant Return Types which allows
the creation of methods in a subclass that returns an object whose type is a
subtype of that returned by the method it overrides.
- Utilization of generic methods, in addition to generic types.
SYS-ED's workshops explain and demonstrate:
- How annotations work best for frameworks
like EJB and web
services, when behavior is not directly modified. This will be valuable when adding boilerplate code.
- How to correctly pass in many instances of
the same object type to a method, without knowing at compile time how many
instances there will be.
- How type safety is a major improvement over ints.
- How
mistakes can be prevented in which one type of enum will be used in place of another.
Java for CICS
Java is also increasingly being utilized in the
IBM mainframe environment. However, there are issues when running Java
applications under CICS Transaction Server and coding using
WSAD (first generation) and
Rational Z (new).
SYS-ED's workshops explain and demonstrate:
- That the profile directory must be specified
in the SIT parameter JVMPROFILEDIR.
- That the SIT parameter points to a directory
containing the profile files specified in the Java program definition. CICS
passes values in the profile to the JVM: Java Virtual Machine when a
transaction invokes a Java program.
- The important values in the profiles such as
the directory for CICS Java classes, directory for Java, LIBPATH for
additional executables, file names for STDOUT and STDERR ( in place of the
default), and CLASSPATH for the Java programs to be run.
- Creating separate CICS class directories for
each maintenance level of CICS, then build a process to change the
CICS_DIRECTORY parameter in the JVM profiles.
- CICS does not support the 64 bit JVM and when
the 64 bit JVM is the default the, the 31 bit JVM will have to be placed in
its directory in the profile.
- That case must be preserved when changing the
SIT: system initialization table or SIT overrides.