Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB invoking command line utility

 
sanker san
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We need to invoke a command line utility and read the output/error from a stateless session bean. Will there be any problems if we use Runtime.getRuntime().exec(command) to invoke the command line utility. Please advise.
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
other than it being relatively slow,
i don't think doing it in EJB would be any different than doing it in plain java
 
Mike Keith
author
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bill Shirley:
other than it being relatively slow,
i don't think doing it in EJB would be any different than doing it in plain java


...except that EJB containers are not supposed to permit spawning of threads or processes. Most will disallow it, although a few do allow it. It will depend upon the container you are running in and the security tolerance it has. The fact that a thread is being spawned from an EJB will not affect performance, though.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic