• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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'.
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic