Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Object injection to EJB using Spring

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I understand enough to even ask the question coherently, but here it goes...

Here at work, we are required to use Spring to "inject" our objects into our Stateless Session Beans. We have a base class in our internal framework that we are supposed to extend for all beans that are "configurable using Spring".

I'm familiar with the configuration xml file, and how you list out all the beans in it... but I'm having trouble connecting the dots.

A "Hello World!" type explanation for this would be perfect.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I would suggest looking at that base class. Does it just hold a reference to the ApplicationContext and you are then required to call getBeans() on it yourself to access your Spring Beans. This is probably the implementation. And it probably would be best in the EJB lifecycle method that gets called when the EJB instance is first created. So most likely ejbCreate.

But know that the way you do this is specific to your company and whoever implemented your companies base class, and this is not a Spring class that you are extending, based on what you posted.

Spring does have an AbstractStatelessSessionBean class that you can extend, but it doesn't sound like you guys decided to go that architect/design route. Let us know if it is otherwise.

Mark
 
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic