quickie about visibility

Nic Ferrier nferrier@tapsellferrier.co.uk
Tue Jan 22 18:35:00 GMT 2002


Sorry about all these, I'm just asking them as they occur to me...

Is a C++ method allowed to call a C++ method which is not visible to
Java through a class reference?

For example:


class T
{

  public native void someX ();
}


CNI::

void
::someX ()
{
   ::S s = new ::S ();
   s->privMethod ();
}



class S
{
}

CNI::

void
privMethod ()
{
   // do nothing.
}


T::someX creates a new S and then calls a method that is only visible
to the C++ layer.

I need to do this because I have some types that I'm trying to hide
from Java, I need to expose them across class boundaries though so I
was going to have the CNI of one class set them on another via a C++
method not visible to the Java code.


Anyone got any idea how to do this?


Nic



More information about the Java mailing list