• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

2) JPilot Mock Exam Question - Help Needed!

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When programming business methods, which technique should be avoided to ensure bean portability across all EJB 2.0 containers? Answer One.

A. Using the java.net.Socket class.
B. Using inner classes.
C. Using the 'final' modifier for fields.
D. Passing 'this' as an argument.

Tool Anser is : D
This is EJB program restriction.
According to the Qesttion it should be A is the correct answer.


Could some one can conform on the same?

Thanks,
Seenu
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We can use java.net.Socket for being a network client but we cannot use java.net.ServerSocket to listen for connections as a server.

Hence Option D is the only correct answer.

Refer to EJB Specification section 24.1.2 page 494-495


� An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or
use a socket for multicast.

The EJB architecture allows an enterprise bean instance to be a network socket client, but it does not
allow it to be a network server. Allowing the instance to become a network server would conflict with
the basic function of the enterprise bean-- to serve the EJB clients.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic