Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB Design questions  RSS feed

 
Olivier Scalbert
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello !
I must write an application used to control several electronic devices accessed via sockets and providing a lot of other services.
As I need Web client interfaces, log utility, persistence, naming service, message services, I think I can use EJB technology. It is also for training and fun!
So I am going to start a little prototype based on jboss.
And of course I have some questions !
In this application, I would like to have a bean acting as a proxy, for each controled device. The problem is that beans are completly managed by the bean container. They can be recycled at anytime. I do not want this because enabling the communication between the proxy and the controled device takes 30 seconds. So, I would like to have all the proxies constructed only one time when the application start.
Is it possible ? Or do I have a serious flaw in my design ?
One of this device needs a nearly continuous socket polling, so I need different threads inside the proxy bean. Is it possible ?
Thanks in advance !
Olivier
 
mini mehta
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Olivier Scalbert:
Hello !
I must write an application used to control several electronic devices accessed via sockets and providing a lot of other services.
As I need Web client interfaces, log utility, persistence, naming service, message services, I think I can use EJB technology. It is also for training and fun!
So I am going to start a little prototype based on jboss.
And of course I have some questions !
In this application, I would like to have a bean acting as a proxy, for each controled device. The problem is that beans are completly managed by the bean container. They can be recycled at anytime. I do not want this because enabling the communication between the proxy and the controled device takes 30 seconds. So, I would like to have all the proxies constructed only one time when the application start.
Is it possible ? Or do I have a serious flaw in my design ?
One of this device needs a nearly continuous socket polling, so I need different threads inside the proxy bean. Is it possible ?
Thanks in advance !
Olivier


I don't think you can do any type of socket programming from a EJB container, except for Client socket i,e u cannot poll containers sockets.
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at JCA(Java Connector Architecture), it may help on some of your requirements.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!