Win a copy of High Performance Python for Data Analytics this week in the Python 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
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

From Zaikin's notes

 
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Excerpt from Zaikin's notes:


An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast. Enterprise bean instance is allowed be a network socket client.



Network socket client? Does this mean that an EJB can use java.net.Socket to send messages.
 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

This is what the EJB FAQ to say on this matter:

Enterprise beans can be network socket clients, and so they can use other network resources (including other enterprise bean servers) to do their jobs. Just as with a database connection, don't hang on to open client sockets across method calls; instead, open them, communicate through the socket, and close it before returning from the method.

Thanks

Ravi
[ February 11, 2005: Message edited by: Ravindra Janapareddy ]
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check page no 625 of HFEJB for the things which seem bad but aren't!

Reproduced here-
1. java.net.socket - a plain old client SOckets are fine. You just can't listen on a ServerSocket.

2. Extend another class from your bean class - normal java inheritance is OK for a bean class

3. Mark a bean field static and final - in fact that's the only way you're supposed to mark a static field.

Regards,
Leena
 
Keerthi P
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand that an EJB can send messages through Sockets but cannot listen on a ServerSocket to receive messages. My doubt was not on understanding this but on the term 'Network Socket client'. It was unclear whether it means ejb-may-use-sockets-to-send-messages. Now I understood 'Network Socket client' means 'use socket to send messages as a client'.
 
if you think brussel sprouts are yummy, you should try any other food. And this 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
reply
    Bookmark Topic Watch Topic
  • New Topic