About Question enthuware.oce-ejbd.v6.2.357 :
Moderators: Site Manager, fjwalraven
About Question enthuware.oce-ejbd.v6.2.357 :
From the code displayed in the page my understanding is that the XLocal bean is Remote, while the answer claims it is local.
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.357 :
@Remote has been changed to @Local
Thanks for reporting.
BTW, we sincerely appreciate you reporting the mistakes here but if you sign up (or report them by email), we can track your reports and refund your order.
-Paul
Thanks for reporting.
BTW, we sincerely appreciate you reporting the mistakes here but if you sign up (or report them by email), we can track your reports and refund your order.
-Paul
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Thu Dec 06, 2012 1:36 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.357 :
I have doubts about correctness of the answer. The value variable of public class Data is declered private so this variable should be accesible in XBean class only trought public getter and setter. Because of the lack of response 'compilation exception' I chose 'The value cannot be determined.'
Please correct me if I am wrong
Please correct me if I am wrong
Code: Select all
public class Data {
[b]private [/b]int value = 0; //private declaration
//public getter and setter for value
}
@Local
public interface XLocal{
void processData(Data d);
}
@Stateless
public class XBean implements XLocal{
//... other business methods
public void processData(Data d){
[b]d.value[/b] = 20; //invalid access
}
}
@Stateless
@Local(YLocal.class)
public class YBean {
@EJB
XLocal xbean;
public void businessMethodY(){
Data d = new Data();
d.setValue(10);
xbean.processData(d);
System.out.println(d.getValue()); // <-------- LINE 100
}
}
-
- Site Admin
- Posts: 10046
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.357 :
You are right. This has been changed to use the setter now.
thank you for your feedback!
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 45 guests