javax.naming.Reference ref=new javax.naming.Reference(
cdi.getConnectionFactoryClass(),
"com.sun.enterprise.resource.naming.ConnectorObjectFactory",
null);
RefAddr addr = new SerializableObjectRefAddr(PoolInfo.class.getName(), poolInfo);
ref.add(addr);
addr = new StringRefAddr("rarName", cdi.getRarName() );
ref.add(addr);
RefAddr resAddr = new SerializableObjectRefAddr(ResourceInfo.class.getName(), resourceInfo);
ref.add(resAddr);
try{
namingService.publishObject(resourceInfo, ref, true);
_registry.addResourceInfo(resourceInfo);