Moderator (MDR): MDR-Andrea
Guest-Speaker (SPK): SPK-David
Andrea: Hello and welcome to Java Live. Today we have staff
engineer David Connelly here to discuss new applications and extension features
in JDKTM 1.2. He is also knowledgeable in JDK in general. Go ahead and
begin to send in your questions and we will get started. Thanks for joining.
SPK-David: Fire away...
jmerk54: I heard that 1.2 will allow for more "system"
type operations, port operations, and device operations. If so, would you
elaborate?
SPK-David: Yes, there is a more flexible security model that
allows applications and applets to access additional resources based on the
configuration of a user's policy file. The new security features are described
in more detail on our JDK
1.2 Beta 2 features web page (http://java.sun.com/products/jdk/1.2/docs).
majic: David. Can you give a few examples of new
applications and extension features?
SPK-David: Applications in JDK 1.2 can take advantage of both
installed and downloaded extensions. Through the JAR file manifest, it is
possible for an application or extension to specify dependencies on other JAR
files. These JAR files will be downloaded unless they have been preinstalled,
in which case the installed version is used.
hamiltond: What is the likely availability of the
cryptography extensions for those outside the US and Canada?
SPK-David: I'm not sure about this one. You can send email to
java-security@java.sun.com and they should be able to help you out.
JamieS: I have a servlet question: There are some
extensions to the servlet classes in JDK 1.2, such as Sessions,
that are rather helpful. It seems that servlets have been folded into the JDK
1.2 (beta) package, and the ServletDK is no longer available
separately. Do you know where I can get information about what server providers
(Sun, Netscape, etc.) are supporting the enhanced (1.2) servlet classes, and
what their release schedules are? I could not find this information on the
servlet page. Sorry if this is too far afield.
SPK-David: There is a updated list of servers that support the
servlet API on the JavaServerTM product page. Just follow the link from
http://java.sun.com/products and you
should find the answer to your question there.
JamieS: Because of the way that it was implemented,
the fastest way to iterate through 1.1's Vector class seemed to be
somthing like (as opposed to using an Enumeration):
With the new collection classes, is this still the case, or has
Vector been reimplemented so its Enumeration is the preferred
method for access? Or should I skip the Vector altogether and use the newer
collection classes?
SPK-David: The new collections API equivalent to
Vector is Array. You can iterate through the elements
of an Array object on at a time like your Vector
example or use an Iterator. Both offer probably more or less the
same performance. Array is generally faster than
Vector, since it is unsynchronized by default.
JamieS: Will there be additional 1.2 beta releases
before the final release? Do you know where I can look for an approximate
schedule?
SPK-David: The 1.2 Beta 3 release is due to go out very soon
now (in the next few weeks). Keep an eye on our web page for more details.
kky: Hi. In the package versioning spec, section
1.5.4 & 10 there is mention of a check of implementation version numbers.
I'm just checking how this is used. Am I correct in assuming this is a property
that a programmer uses to determine the current environment version and
not a system property used for determining linking? For example, the
dynamic linker won't use an identity check when looking at program version, but
accepts a greater than or equal check for library version as usual?
SPK-David: Correct. The dynamic linker does not use the
versioning information, but it is only provided as an aid to programmers.
JamieS: In the final 1.2, will there be a nice
mechanism for (essentially) adding a specified JAR to your classpath, or do we
still have to pilfer code from the BeanBox to implement dynamic loading of
classes from JARs?
SPK-David: In the next beta release there will be a new -jar
flag for both Java and JRE that will allow you to execute a JAR file either
from the local disk or an arbitrary URL. The JAR
JamieS: Is there any way to change the "Current
Directory"? I know that I can get this directory with the appropriate System
property, and that setting the System property to a new value has no effect on
the actual current directory. Is there any way to change this directory, or
should we just ensure that we have complete, absolute paths for all files we
use?
SPK-David: There is no standard way to change the current
directory from Java. You would have to do this using native code.
jmerk54: What sort of enhancements have been made to
the JDBC?
SPK-David: I'm not too familiar with JDBC. You can try the
JDK/JRE 1.2 product web page and see what information has been publicized.
JoeSam: What's the approximate final release schedule
at this point? I'm not looking for insde info, just wondering what the time
line is for further changes or major revisions. Along the same lines, will
Swing, the new JNDI and SSL API, etc. be synchronized with the release? It's a
problem, for example, to have Swing 0.6 with 1.2 when 0.7 is out.
SPK-David: I can't really talk about specific release dates
but with the exception of some driver APIs (i.e. extensions, 2D). The APIs are
pretty much stable right now. Both JNDI and SSL are likely to be released as
true extensions once JDK 1.2 is released in FCS form.
JamieS: We're developing some GUI applications, as
well as some services. The services terminate (without a call to Runtime.exit)
when we expect them towhen there are no non-daemon threads live. The GUIs
appear to stick around after we close all windows and kill all of our threads.
Rooting through the current threadgroup indicates that there are several AWT
threads still live. Am I likely doing something wrong (holding onto an AWT
resource I should dispose of), or is the proper way to terminate a GUI app by
using Runtime.exit? Thanks.
SPK-David: I'm not very familiar with the AWT, but in general
it is not necessary to call Runtime.exit() if you've closed all
your threads. This might be a bug in AWT. (Is it 1.1 or 1.2?)
langley: I recently started working with the new
security tools in JDK 1.2. However, I realized that there is currently no
"browser environment" other than the applet viewer to test in. Is there a
release of HotJavaTM or Project Java Activator coming out soon with JDK
1.2 capabilities?
SPK-David: I'm not sure about HotJava, but there should be a
new Project Java Activator version based on 1.2 released soon.
jimheintz: According to JDK 1.2 beta documentation,
JFC will be included with it. Will it replace the AWT completely? Will
PersonalJavaTM when it migrates to 1.2 also have Swing (JFC) components
instead of vanilla AWT components?
SPK-David: Again, Swing and AWT are not my area of expertise,
but I believe that Swing is implemented on top of the new AWT, which also
includes some new 2D features. As for PersonalJava, it's hard to say since that
is a subset of the Java APIs and the 1.2 version has not been spec'd yet.
xqw: What will change in RMI? There was a rumor half
a year ago saying RMI will implement CORBA? Is it true?
SPK-David: I believe that RMI is being reimplemented to use
IDL as the transport layer. Other than that, I'm not sure what its future
relationship to CORBA will be.
JamieS: We have noticed that we get entirely
different background colors between JDK on Windows NT, JDK on Solaris/CDE, and
JDK on Solaris/OpenWindows. The background on NT matches the user's setting for
window background. On Solaris/CDE that seems to match the frame color (gray),
whereas on Solaris/OpenWindows we get an bizarre purple from who knows where.
Are there any plans to "normalize" this behavior?
Also, it is not clear
what SystemColor.window is supposed to match up with in the user's
desktop settings. I assume that it is supposed to be the normal window
background color, but it doesn't always seem to behave that way. Is there a
SystemColor that matches the frame color?
SPK-David: Again, not my area of expertise, but they have
fixed a bunch of AWT-related bugs in 1.2 Beta 3, so check our website again in
a few weeks to see if it has been released.
glv: Are you familiar at all with the new printing
API in JDK 1.2? I've been trying to figure it out, without a lot of success
(the documentation is sparse, and everything's an interface, with no source
code to explain what's going on). I'd like a brief outline of how to use the
Book class and Printable interface to print a document that spans
multiple pages.
SPK-David: I'm not familiar with the new printing API, but I
do know that it's one of the drivers for 1.2 Beta 3. So check again once that
is released to see if the documentation has been improved.
JamieS: (I think I was a little unclear with my JAR
question earlier.) If I wish to specify a JAR to load while my program is
running (it has dynamic extensions, or is a GUI application builder, or some
other reason), what is the best approach to load these classes? Is it still
best to dissect and reimplement portions of the BeanBox to get dynamic JAR
loading?
I do appreciate the -JAR option that you mentioned earlier as
a JRE command-line optionthat's a good idea. It just addresses a slightly
different issue. Sometimes it is not known until the Java is already running
what JAR(s) we want to load.
SPK-David: OK, there is a new class in 1.2 called
java.net.URLClassLoader that extends
java.lang.ClassLoader with the ability to dynamically load JAR
files and classes from arbitrary URLs. You probably want to look at the
documentation for that class, as it would allow you to load JAR files in new
class loader's on the fly.
jmerk54: David, of the features in 1.2, which would
you say offer the most benefit over 1.1x?
SPK-David: There are a whole bunch of improvements in 1.2 over
1.1. It's hard to say which are the most beneficial as it completely depends on what types of applications you are developing, but Swing is certainly one of the major improvements.
Andrea: Well, our time has run out. Thanks to everyone for
joining, especially David. Be sure to join us next week,
for a discussion of PersonalJava with engineer Curtis Sasaki. Take care and
see you all next time.
JamieS: David & Andrea: Thanks for the
information!
Andrea: You're welcome.