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

How to deploy standalone java Api in JBoss

 
Maurice Tambouradj
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a standalone java project which is basically a Snmp trap listener. this application will keep listening in a port. currently this app will be started by calling main method.
how to deploy this project in Jboss. whenever jboss server is started this application should also started and keep listening in a port.

please advice me what should i do for this.


Thanks in advance,
Maurice
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you want to convert this app into a service. Exactly how to do this depends on the version of Boss AS. For 6.x and earlier you would convert it into an MBean. Not sure what the corresponding thing would be in 7.x.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:Not sure what the corresponding thing would be in 7.x.

AS 7.x supports MBeans too although the xsd for -service.xml files has changed slightly (some advanced features have been removed and no longer supported).
 
E Armitage
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EE6 you'll want to look at @Startup and @Singleton but remember that


Why can an enterprise bean not listen to or accept connections on a socket?
Because if an enterprise bean is listening on a socket, it can't be passivated -- it must always be available. 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.
from http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html

Of course you could use container specific strategies to turn off passivation and probably get it to work but the question here is what is the motivation for deploying this into an EJB container?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic