protected void addRemoteObject( byte channel, short objectId, String name, ClassInfo typeInfo ) {
        if( log.isLoggable(Level.FINEST) ) {
            log.finest("addRemoveObject(" + objectId + ", " + name + ", " + typeInfo + ")");
        }
        remote.lock.writeLock().lock();
        try {
            Object existing = remote.byName.get(name);
            if( existing != null ) {
                throw new RuntimeException("Object already registered for:" + name);
            }
            
            RemoteObjectHandler remoteHandler = new RemoteObjectHandler(this, channel, objectId, typeInfo);
 
            Object remoteObject = Proxy.newProxyInstance(getClass().getClassLoader(),
                                                         new Class[] {typeInfo.getType()},
                                                         remoteHandler);
                                                                    
            remote.byName.put(name, remoteObject); 
            remote.byId.put(objectId, remoteObject);
        } finally {
            remote.lock.writeLock().unlock();
        } 
    }
Looks up a remote object by name and returns a local proxy to the remote object 
 that was shared on the other end of the network connection.  If this is called 
 from a client then it is accessing a shared object registered on the server.  
 If this is called from the server then it is accessing a shared object registered 
 on the client.
jme3-networking/src/main/java/com/jme3/network/service/rmi/RmiRegistry.java