I am doing this in spring based portlets which are in different war files each. I am having custom services which I have written in a single project along with TestContainer.java . When portlet A access
Code:
TestContainer.getContext().getBean("bean1");
and bean1 internally calls TestContainer.getJobService();
sample code for Bean1 is
Code:
public class Bean1 {
public AccountDeatils getAccountDetails(int accountId) throws TimeoutException, JMSException,
{
JobService jobService = getJobService();
return jobService.getAccountDetails(accountId);
}
private JobService getJobService() {
return (JobService) TestContainer.getJobService();
}
}
AccountDetails get populated through external JMSService.
My use case is that both Portlet A and Portlet B are trying to access same service that is bean1.getAccountDetails(1) but both are showing different data. My question is whether both portlet are accessing same object or different object of AccountDetails. If they are accessing different Object then how to make them access same object.