Context ctx = new InitialContext();
Object objhome =
ctx.lookup("java:comp/env/ejb/CalledByReference");
ByReferenceStatelessSessionHome home = (ByReferenceStatelessSessionHome) PortableRemoteObject.narrow(objhome, ByReferenceStatelessSessionHome.class);
ByReferenceStatelessSession session = home.create();
ClassWithProperty property = new ClassWithProperty();
property.setX(1000);
long initTime = System.currentTimeMillis();
for (int i=0;i<iterations;i++)
{
session.doTestByReference(property);
if (property.getX()==1000)
{
throw new RuntimeException("Property was not changed in a call-by-reference operation");
}