aspose file tools
The moose likes JBoss and the fly likes Restrict Access to certain packages inside a JAR file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » JBoss
Reply Bookmark "Restrict Access to certain packages inside a JAR file" Watch "Restrict Access to certain packages inside a JAR file" New topic
Author

Restrict Access to certain packages inside a JAR file

C Deepak
Greenhorn

Joined: Dec 12, 2007
Posts: 4
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
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.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Restrict Access to certain packages inside a JAR file
 
Similar Threads
JPA2 and Glassfish: persistence unit not found
Problems redeploying EAR file with Third Party libs
JBoss class path issue
quick question on excluding certain files from javac...
Ejb ClassLoader