code: @Override
      public RemoteObjectInstance getRemoteObjectInstance(JavaColonNamespace namespace, String name) throws NamingException {
          RemoteObjectInstance roi = null;
          InjectionBinding<?> binding = getInjectionBinding(namespace, name);
          if (binding != null) {
              Object bindingObject = binding.getRemoteObject();
              if (bindingObject != null) {
                  if (bindingObject instanceof IndirectReference) {
                      bindingObject = resolveIndirectReferences(binding, (IndirectReference) bindingObject, 0);
                  }
                  if (bindingObject instanceof javax.naming.Reference) {
                      SerializationContext sc = serializationService.createSerializationContext();
                      ByteArrayOutputStream baos = new ByteArrayOutputStream();
                      ObjectOutputStream oos = null;
                      try {
                          oos = sc.createObjectOutputStream(baos);
                          oos.writeObject(bindingObject);
                      } catch (IOException ex) {
                          NamingException ne = new NamingException("Unable to serialize naming reference: " + bindingObject);
                          ne.initCause(ex);
                          throw ne;
                      } finally {
                          if (oos != null)
                              try {
                                  oos.close();
                              } catch (IOException ex) {
                              }
                      }
                      roi = roiFactory.create(baos.toByteArray());
                  } else if (bindingObject instanceof Remote) {
                      roi = roiFactory.create((Remote) bindingObject, binding.getInjectionClassTypeName());
                  } else {
                      roi = roiFactory.create(bindingObject);
                  }
              }
          }
          return roi;
      }
docs: /*
  (non-Javadoc)
  
  @see com.ibm.ws.container.service.naming.remote.RemoteJavaColonNamingHelper#getRemoteObjectInstance(com.ibm.ws.container.service.naming.NamingConstants.JavaColonNamespace,
  java.lang.String)