Hot melt glue available at most hobby shops. I believe he just put it in hot water to release the glue from the metal. None the less a VERY clever project.
I was privileged to visit the National Museum in Taipei, Taiwan and they have ivory balls on display that are similar but much more intricate carving, almost like lace. There were 30 balls inside balls all carved by hand. Probably a lifetime of work for one craftsman to amuse the emperor.