The arguments and results of the methods of the local client view are passed “by reference”.....the Bean Provider must be careful that the state of one enterprise bean is not assigned as the state of another. In general, the references that are passed across invocations of the local client view cannot be used outside of the immediate call chain and must never be stored as part of the state of another enterprise bean.
So why does this contradicts with what i have said before . I think i have got it wrong some where for sure . Any help on this topic will be really appreciated .A reference to the no-interface view may be passed as a parameter or return value of any Local business interface or no-interface view method.
OCJP-90%,OCPWCD-95%
First of all i am not understanding what does immediate call chain mean in that context . I am assuming its trying to say that when i am calling a local business method , since the parameters i pass are pass by reference the local business method should not pass it to some other business method .
A reference to the no-interface view may be passed as a parameter or return value of any Local business interface or no-interface view method.
This means I can give a reference to myself (a sort of 'this' in a POJO) as a parameter.
The reference of an EJB cannot be changed inside a method so there is problem there
OCJP-90%,OCPWCD-95%
Frits Walraven wrote:
OCJP-90%,OCPWCD-95%
after all you are in a method which has been invoked by some instance of EchoBean right so why not use the this keyword ??
might be some technical thing which i do not know ??
When interacting with a reference to the no-interface view, the client must not make any assumptions regarding the internal implementation of the reference, such as any instance-specific state that may be present in the reference. Although the reference object is type-compatible with the corresponding bean class type, there is no prescribed relationship between the internal implementation of the reference and the implementation of the bean instance.
Frits Walraven wrote:
Watch out that with a No Interface View the getBusinessObject(EchoBean.class) returns a class-type that is the same as the class itself (normally if the EJB has a business interface it would return the interface's class)
When interacting with a reference to the no-interface view, the client must not make any assumptions regarding the internal implementation of the reference, such as any instance-specific state that may be present in the reference. Although the reference object is type-compatible with the corresponding bean class type, there is no prescribed relationship between the internal implementation of the reference and the implementation of the bean instance.
OCJP-90%,OCPWCD-95%
Ohkie it does return class type just beacause it does not have an interface right ?
So does it says that the reference i get to an object (either through dependecy injection or lookup) , that object's type will be same as of class type but the internal implementation will be different ! means that the container might be creating a class at runtime which has a same name as the actual bean class but this class will be like a proxy / stub which will be performing all the networking complexities ! right ??
OCJP-90%,OCPWCD-95%
OCJP-90%,OCPWCD-95%
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
|