Archive for the 'Java' Category

Java Caching System

Caching web pages and other data in distributed environment makes your application faster and better. I was wondering if Java has something for caching web pages for fast response and better performance. Few days back I found Java Caching System (JCS) project on Apache Jakarta Projects website.

JCS is an open source library for creating distributed caching system to speed up your applications. JCS is a general purpose caching system that can be used in web applications, services, and stand alone Java applications. The JCS goes beyond simply caching objects in memory. It provides numerous additional features:

  • Memory management
  • Disk overflow (and defragmentation)
  • Thread pool controls
  • Element grouping
  • Minimal dependencies
  • Quick nested categorical removal
  • Data expiration (idle time and max life)
  • Extensible framework
  • Fully configurable runtime parameters
  • Region data separation and configuration
  • Fine grained element configuration options
  • Remote synchronization
  • Remote store recovery
  • Non-blocking “zombie” (balking facade) pattern
  • Lateral distribution of elements via HTTP, TCP, or UDP
  • UDP Discovery of other caches
  • Element event handling
  • Remote server chaining (or clustering) and failover

I will be exploring the API in coming weeks and publish a small tutorial about how to use them in web application.

Java Foreach Loop

Java 5 introduced foreach loop, a much needed feature since it was first relaeased. Java foreach loop provides code simplicity, readability and eliminates the repetition of code that we write for type casting and assignments, when we are iterating arrays and collection objects.

When used with generics nothing is more apealing loop than foreach. I was reading an article “What Java foreach loop can do?“, which describes every thing a developer needs to know about for eachloop.

Open Source Java

Today, the SUN Microsystems, Inc has released the first Java code under version 2 of the General Public License (GPLv2), which governs Linux and other open source products. According to Sun, this move will promote Java and make it easier to bundle with Linux.

Sun is now the biggest contributor to the open-source community. Already Sun has released open-source implementations of its Solaris Operating System, NetBeans, Project Looking Glass, Project JXTA, Jini, OpenOffice, OpenSPARC, and Java EE technologies and is continuing on its path to open all of its middleware.

Commenting on the development, Rich Green, Executive Vice President of Software, Sun, said, this is a milestone for the whole industry, and that not only are they making an influential and widely-used software platform for the Web available under open source, but that they are paving the way for a paradigm shift in how software is enhanced and developed.

By open sourcing its Java implementations, Sun will open new market opportunities, fuel innovation, and drive broader adoption of this Web 2.0 platform while minimizing fragmentation in the mobile community by delivering a consistent application platform across devices.

While additions to software available under GPL have to also use the license, Sun is making an exception in the case of Java Standard Edition (Java SE). Meaning, programmers creating applications using Java SE will not be required to use the GPL license, and can instead opt for any other license for their applications. Also, Sun will continue to offer commercial licenses that give other software vendors legal indemnification and official standards certification.

All in all, Sun’s move comes as a pleasant surprise, considering the company has continually resisted calls to open source Java, citing fears that such an action would cause incompatibilities among “forked” versions of the code.

Read full story: Open Source Java

JNODE – Open Source Java Operating System

Jnode is an open source Java operating system. It was started when JDK 1.0.2 released, Ewout Prangsma (the founder of JNode) dreamed of building a Java Virtual Machine in Java. It should be a system that was not only a VM, but a complete runtime environment that does not need any other form of operating system.

Ewout made various attempts to develop this OS. He first developed a JBS; the Java Bootable System. It became a somewhat functional system, but had far too much native code, in C and assembler, in it. So he started working on a new JBS system, called JBS2 and finally JNode. which doesn’t have C code, but has only a little bit of assembly code. In may on 2003 Ewout came public with JNode and development proceeded ever faster from that point on.

Hardware Requirements:

To be able to run JNode, you’re hardware should be at least equal to or better then:

  • Pentium class CPU with Page Size Extensions (PSE) feature
  • 256Mb RAM

more on hardware requirements

Performance:

Performance of an OS is critical. That’s why many have suggested that an OS cannot be written in Java. JNode will not be the fastest OS around for quite some time, but it is and will be a proof that it can be done in Java. To make JNode as fast as possible, we’ll concentrate on doing things as smart as possible, but still to do it in Java.

more on performance

DST Changes will affect Java application

Daylight Saving Time (DST) is a system of handling the changing amounts of daylight throughout the year. The goal of DST is to maximize the daylight hours available during typical waking hours.

The United States has planned a change to its DST observance beginning in 2007. The Energy Policy Act of 2005 mandates that DST will start on the second Sunday in March and end on the first Sunday in November. In 2007, the start and stop dates will be March 11 and November 4, respectively. These dates are different from previous DST start and stop dates. In 2006, the dates were the first Sunday in April (April 2, 2006) and the last Sunday in October (October 29, 2006).

The Java Runtime Environment (JRE) stores rules about DST observance all around the globe. Older JREs will have outdated rules that will be superseded by the Energy Policy Act of 2005. As a result, applications running on an older JRE may report incorrect time from March 11, 2007 through April 2, 2007 and from October 29, 2007 through November 4, 2007.

If you are concerned about application failures that may result from these DST changes, you should update your Java Runtime Environment. The following Java platform versions have correct time rules to handle the DST changes that will affect U.S. time zones in 2007. You can download any of the following Java platform versions to resolve this DST issue:

Read all at Sun Developers Network

Next Page »