What is the meaning of @ejb annotation in java? -
this question has answer here:
- what @ejbs annotation do? 4 answers
what @ejb annotation in java?
pls tell exact meaning of @ejb annotation in java.
the @ejb annotation (and @resource, @webserviceref, etc.) serves 2 purposes:
it declares reference in component namespace. example, @ejb(name="myejb") creates reference java:comp/env/myejb. if annotate field , not specify name, creates reference java:comp/env/com.example.myclass/myfield. if annotation declared on field or setter method, container performs injection when component created. how reference resolved varies, independent of whether reference being resolved lookup("java:comp/env/myejb") or due injection:
if ee 6+ used, lookup attribute requires jndi lookup resolve target. application servers support mappedname, specified vendor specific. implemented performing lookup. application servers support bindings @ deployment time. implemented performing lookup. if no other binding information provided , bean interface (beaninterface or field type) implemented single ejb in application, ejb specification requires fall that. if no other binding information provided , #4 cannot work, application servers attempt perform lookup in server namespace based on ref name (for example, java:comp/env/myejb might cause lookup of myejb in server namespace).
Comments
Post a Comment