Restrict Access to certain packages inside a JAR file
C Deepak
Greenhorn
Joined: Dec 12, 2007
Posts: 4
posted
0
Hi,
I have a set of POJOs packaged in a jar file added as a library in {JBOSS_HOME}/server/default/lib directory. Is there any way to restrict access to certain packages inside JAR by external applications?
Or, if I can do that by packaging my files as .ear file, how do I do that?
Basically, I want to ensure that any external application (.war, .ear etc) is allowed to access only certain classes inside the jar file where as other classes inside jar are used for doing the requested operation.
Thanks in advance,
Cheers, Deepak
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35253
7
posted
0
There may be more elegant ways, but one method is to look at the current stacktrace -which you can get via "new Exception().getStackTrace()"-, and examine it to make sure only the correct clients are calling it.