Announcement Announcement Module
Collapse
No announcement yet.
How to get existing spring context in java class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get existing spring context in java class

    Hello ,
    I have a java class in which I need to get spring context loaded in a web server . How can I get it?
    I have below Components in my application.

    | Program exe -->calls |-->main method -->starts- -->embedded jetty server -->loads war-creates--> spring container. |
    | | | |
    |__Window Service___|_________________________JAR___________ ______|____________WAR_______________|

    I tried to make above as descriptive as I can.
    So problem is when I shuts down the windows service , the dospose mthods of few spring clasess doesnt get called. however shutdown hook method in embedded jetty server gets called. I have used java service wrapper to wrap exe as windows service. So how will I get spring context in embeded jetty server class and if I get spring context in this class, can I dospose the objects in spring container?
    Last edited by anispringian; Apr 30th, 2013, 12:30 PM. Reason: modified
Working...
X