Archive for февруари, 2010

Clone Java objects

Since objects in Java are manipulated through reference variables, there is no direct way to copy an object. Classes that want copying functionality must implement clone() method to do so. This guide shows how to make a Java class Cloneable and perform cloning. A class to be cloned: class Person { private String firstName; private [...]

How to speed up EJB lookups

J2EE applications usually invoke the same EJBs several times. EJB lookups are expensive, a possible way to reduce that overhead is to cache the bean home. There are many ways to do that, the following example is not the best but maybe the simplest: uses the singleton design pattern. import javax.naming.NamingException; import javax.naming.InitialContext; import javax.rmi.PortableRemoteObject; [...]

Задвижван с помощта на WordPress | Compare Cell Phone Plans at iCellPhonePlans.com | Thanks to Cheap Palm Pixi, Bromoney and Wordpress Themes