Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Caching Home/Remote refernces across the firewall

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In my project, I'd be accessing EJB(stateless)across the firewall, i.e. EJBs would be deployed in some other server.I'd access this server through network.Moreover there will be firewall.Communication between two networks is possible by opening ports.
My question is :
1. Can i cache home or remote reference once i get it from other server across the network?
Pls note that there are no security credentials on the EJB's. So there is no authentication.
Cheers.
Sandeep.
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you may need the Service Locator pattern. This allows you to cache home objects for reuse, and to reuse a remote object with the help of its Handle (getHandle() from EJBObject).
If you can access the EJB across the firewall there should no problem using this pattern.
See http://java.sun.com/blueprints/patterns/ServiceLocator.html
 
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandeep,
Dave is correct about the pattern to use. However, regardless of whether you use the pattern or not, you may get problems with the firewall (it depends how its been setup). Some firewalls are set up to prevent RMI access. You need to speak to your network guys to make sure you firewall is configured correctly for your application.
Ray Gill - SCJP, SCWCD
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Sandeep Lodhia:
Hi,
In my project, I'd be accessing EJB(stateless)across the firewall, i.e. EJBs would be deployed in some other server.I'd access this server through network.Moreover there will be firewall.Communication between two networks is possible by opening ports.
My question is :
1. Can i cache home or remote reference once i get it from other server across the network?
Pls note that there are no security credentials on the EJB's. So there is no authentication.
Cheers.
Sandeep.


You can cache the reference to home interface (why you want to cache the remote interface reference ?) but because you call the (RMI based) remote interface from outside the firewall, you should have to explictly set in the (app or rmi) server to use the DNS name instead of IP address.
For weblogic specific changes , check this out
http://edocs.bea.com/wls/docs61/ejb/EJB_design.html#1026610
 
    Bookmark Topic Watch Topic
  • New Topic