Tuesday, November 11, 2008

Transferring Sockets

hat you can do is put a proxy server/load balancer in front of your service. (The proxy service must match your protocol, a HTTP proxy server won't work unless you are proxying HTTP requests)
The proxy would have same the IP address and port of your current service so that the clients connect to the proxy. You can have the proxy server connect to your service passing one requests way and replies the other way. If your service dies, the proxy can create a new connection to another service, or the same service when it restarts and you might be able to hide this from the client (there will be a delay of some order)
Depending on the complexity of your protocol and whether the connection is stateful, this might be easy to do...

Hey GlassFish v3 Prelude Released

Sun GlassFish Enterprise Server v3 Prelude improves productivity with rapid deployment technology and modular architecture based on OSGi. Read the overview and download it now.


Young Developers
Programming is not just for adults anymore! The Young Developer Series teaches Java programming to anyone over 10 years of age, using a tool called Greenfoot:
Wombat Object Basics
Wombat Classes Basics

Wednesday, March 19, 2008

How to embed a True Type font

Some applications, for reasons of esthetics or a required visual style, will embed certain uncommon fonts so that they are always there when needed regardless of whether the font is actually installed on the destination system.

The secret to this is twofold. First the font needs to be placed in the resources by adding it to the solution and marking it as an embedded resource. Secondly, at runtime, the font is loaded via a stream and stored in a PrivateFontCollection object for later use.

This example uses a font which is unlikely to be installed on your system. Alpha Dance is a free True Type font that is available from the Free Fonts Collection. This font was embedded into the application by adding it to the solution and selecting the "embedded resource" build action in the properties.

http://www.xtremevbtalk.com/archive/index.php/t-252347.html



Fonts may have only certain styles which are available and unfortunately, selecting a font style that doesn't exist will throw an exception. To overcome this the font can be interrogated to see which styles are available and only those provided by the font can be used. The following listing demonstrates how the Alpha Dance font is used by checking the available font styles and showing all those that exist. Note that the underline and strikethrough styles are pseudo styles constructed by the font rendering engine and are not actually provided in glyph form.

How to embed a True Type font

Some applications, for reasons of esthetics or a required visual style, will embed certain uncommon fonts so that they are always there when needed regardless of whether the font is actually installed on the destination system.

The secret to this is twofold. First the font needs to be placed in the resources by adding it to the solution and marking it as an embedded resource. Secondly, at runtime, the font is loaded via a stream and stored in a PrivateFontCollection object for later use.

This example uses a font which is unlikely to be installed on your system. Alpha Dance is a free True Type font that is available from the Free Fonts Collection. This font was embedded into the application by adding it to the solution and selecting the "embedded resource" build action in the properties.


Fonts may have only certain styles which are available and unfortunately, selecting a font style that doesn't exist will throw an exception. To overcome this the font can be interrogated to see which styles are available and only those provided by the font can be used. The following listing demonstrates how the Alpha Dance font is used by checking the available font styles and showing all those that exist. Note that the underline and strikethrough styles are pseudo styles constructed by the font rendering engine and are not actually provided in glyph form.

Tuesday, March 4, 2008

Open JDK

What you will find here

Today this project contains two significant components of the JDK:

The remainder of the open-source JDK will be available in the first half of 2007. At that time this project will host the source code for the complete JDK except for a few components that Sun does not have the right to publish in source form under the GPL; pre-built binaries will be provided for those components.

You will also find the jtreg unit-test harness here, for use in running the compiler's unit tests. For now this tool is available only in binary form, but eventually it too will be open-sourced.

OpenJDK-6 source code available

The source code for the JDK 6 project is now available here. To learn more about this new effort please see Joe Darcy's blog; to get involved please join us on the jdk6-dev list.

Draft Developers' Guide available

Iris Clark has posted the first draft of the OpenJDK Developers' Guide. Please send comments to guide-discuss(at)openjdk.java.net

The OpenJDK Community Innovators' Challenge is ON!

Want to do something good for OpenJDK and the community and possibly win a prize for your efforts? The OpenJDK Community Innovators' Challenge is part of Sun's new community awards initiative, giving away up to $1,000,000 in 2008 across six of Sun's key FOSS communities. The Challenge will give away up to $175,000 to worthy developers who enter. For more on this opportunity, please visit here.


Java with MySQL and Developers

MySQL, the world's most popular open-source database, fills an important niche in Sun's software stack. With Sun's reach and resources, MySQL is poised for even wider adoption.

Deep Dive: JXTA on MIDP
SDN staff writer Ed Ort interviews JXTA project architect Mohamed Abdelaziz. Abdelaziz demonstrates how JXTA for MIDP 2.0 allows handheld devices to participate as first-class devices in a JXTA network.

From Java Platform Improvements to Better Teaching: A Conversation With Java Champion Cay Horstmann
Java Champion Cay Horstmann, a computer science professor and author of noted books on Java programming, discusses needed platform improvements, developer challenges, and ways to inspire students.

Student Developers
Where can you find hot technologies, open-source communities, and job opportunities? Sun is looking for students who are ready to innovate and create the future. Learn More

Duke's Choice Awards
We are accepting nominations for the sixth edition of the popular Duke's Choice Awards. Winners will be recognized at the 2008 JavaOne Conference. Submit entries by March 14.

Connect and Participate With GlassFish
Try GlassFish for a chance to win an iPhone. This sweepstakes ends on March 23, 2008.
New Java Enterprise Architect Certification
The much anticipated update to the Java Enterprise Architect Certification is now available. Achieving this advanced and well respected certification can help get you to the next level in your career.

Download Java SE 6 Update N, formerly known as the Consumer JRE, and provide feedback on these exciting features: Direct3D, Java Quick Starter, Nimbus, and Deployment Toolkit. Get the RSS feed.