Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ejb-dev] Should it be possible to express @DependsOn with module-name instead of file-name-with-extension?

Hi EJB List

I'm using:
- GlassFish 7.0.25,
- JDK 21.0.7 temurin (probably irrelevant)

I'm doing following - and it is working fine:
- Deploying 1 EAR with 3 EJB jars (a.jar, b.jar, c.jar)
- Each EJB jar uses DD to set module-name (m-a, m-b, m-c)
- Each EJB has @Singleton (AS, BS, CS)
- c.jar/m-c's @Singleton (CS):
  * is @EJB-ing the other singleton from a.jar/m-a:
    @EJB(lookup = "java:app/m-a/AS")
  * is @EJB-ing the other singleton from a.jar/m-a:
    @EJB(name = "m-a/AS")
  * is @EJB-ing the other singleton from a.jar/m-a:
    @EJB(name = "b.jar#AS")
  * is @DependsOn-ing on the other singleton from b.jar/m-b:
    @DependsOn({"b.jar#BS"})

As I said - all that works. (Note: EJB.name with
${module-name}/${bean-name} and ${file-name}#${bean-name} are
supported here.)

What I'd like to do:
- use DDed module-name in @DependsOn instead of file name.

Unfortunately, I can't make it work with none of:
- "m-b/BS" (as in @EJB's name),
- "java:app/m-b/BS" (tried that too, @EJB's lookup, with no luck).

The [1] mentions "illustrates the use of the fully-qualified ejb-name
syntax" (which is working fine indeed). But what is that syntax? I've
seen [2], which is not specifically about @DependsOn but the examples
with ejb-link use both - (file) names with '#' and (module) names with
'/'.

Q1. What is fully-qualified ejb-name syntax?
Q2. Should it be possible to express @DependsOn with module-name
instead of file-name-with-extension?

(I've checked the current platform-tck (766f128ec). I see some tests,
but they all seem to be for within-module cases.)

-- 
Piotrek

1. https://jakarta.ee/specifications/enterprise-beans/4.0/jakarta-enterprise-beans-spec-core-4.0#singleton-session-bean-initialization
2. https://jakarta.ee/specifications/enterprise-beans/4.0/jakarta-enterprise-beans-spec-core-4.0#a4057


Back to the top