Put the protected proxy and the real object into a single package.
The real object's constructor should be package private (default)
access.
Therefore only classes in that package, i.e. the Proxy can instantiate
the real object class.
You would then want to consider putting the files into a jar and using
the sealed package facility to ensure that client code could not be
created in the same package as the proxy.
On Nov 8, 9:14 pm, "
stefan.k...@googlemail.com"