Detecting Sharing

I was just reading through some of the javadoc regarding sharing:

http://download.java.net/media/jogl/builds/archive/jsr-231-beta5/javadoc_public/overview-summary.html#SHARING

In light of this, how do I know if two objects have been shared? If my first GLDrawable creates a texture with name 2, does this mean a second GLDrawable will never create a texture with name 2 until the first GLDrawable releases texture 2? How does my second drawable determine what is shared and what is not?

If sharing is successfully enabled between two OpenGL contexts (GLContexts in the JSR-231 spec) then all objects which are defined as being shared across contexts will be visible to both contexts. It does mean that e.g. the texture namespace is shared between the two. Some extensions define new object types which are also affected by sharing. Sharing is an all-or-nothing property between two contexts; it doesn’t affect some objects but not others. JOGL will raise a GLException upon creation of the second GLContext if there was a failure while setting up sharing between the two contexts.