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 [...]
Archive for февруари, 2010
How to speed up EJB lookups
февруари 5th, 2010
admin 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; [...]
RSS Feed
Twitter

Posted in

