@SuppressWarnings("unchecked")
    public void startHostingOnConnection( HostedConnection hc ) {
        if( log.isLoggable(Level.FINEST) ) {
            log.log(Level.FINEST, "startHostingOnConnection:{0}", hc);
        }
        RmiRegistry rmi = new RmiRegistry(hc, rpcService.getRpcConnection(hc), 
                                          rmiId, defaultChannel); 
        hc.setAttribute(ATTRIBUTE_NAME, rmi);
        
        // Register any global shares
        for( Map.Entry<String, GlobalShare> e : globalShares.entrySet() ) {
            GlobalShare share = e.getValue();
            rmi.share(share.channel, e.getKey(), share.object, share.type); 
        }
    }
Sets up RMI hosting services for the hosted connection allowing
 getRmiRegistry() to return a valid RmiRegistry object.
 This method is called automatically for all new connections if
 autohost is set to true.
jme3-networking/src/main/java/com/jme3/network/service/rmi/RmiHostedService.java