Re: Discussion: SecurityContext

Bill Shannon

Using JNDI-style names for resource names would be confusing.

What's the use case for this method in general, and for using this method with a resource that's in another module?

Arjan Tijms wrote on 05/31/17 03:51 PM:


On Thu, Jun 1, 2017 at 12:28 AM, Bill Shannon <bill.shannon@...> wrote:
As I read the spec, the resource name is relative to the web module.  If you're not in a web container, what names can you use?  If your app has two war files, which web module is the name relative to?  Presumably the one you're running in, which means it's not useful if you're not running in a web container.  Well, unless the EJB module is exposing web services of some sort.

You're absolutely right, good catch!

Okay, I was wrong here then. When called from another container or "entry point" into the application (not sure what you would call inflow into a JCA connector exactly), you cannot just call that method.

For a next spec release I could imagine a JNDI like namespace prefix, with java:app/[module name] querying for a specific module in the application and java:module being the default for the current module (which would then throw an IllegalArgumentException if called from an EJB module).


From an EJB:


Queries for /admin for app1 and app2


Throws IllegalArgumentException 


From web module app1


Queries for /admin for app1, where /admin must be treated equal to java:module/admin


Queries for /admin for app1 and app2, where java:app/app1/admin must be treated equal to java:module/admin


Kind regards,
Arjan Tijms


Join to automatically receive all group messages.