You can find a white paper on writing a JBI service engine here:
http://java.sun.com/integration/reference/techart/DevelopingAServiceEngineComponent-1-2.pdf
Also, there is a lot of information on JBI and Open ESB here:
http://java.sun.com/integration/
You ask if the Sun JBI container is based on Open ESB - it's actually the other way around: Open ESB is based on the Sun JBI container. The JBI container is a JSR208-compliant implementation, and Open ESB builds upon that implementation to add full ESB capabilities.
hope this helps -
mark