Hi,
I would like to run the Services Layer in a Different JVM and probably on a different Physical Machine and it has no Web Interface ( We don't want to run it in a Web Container as we don't need that overhead)..
Now this is the program i am using to launch the Spring Container and keep it running until the JVM goes down
Code:
public static void main(String[] args) {
ServicesLauncher servicesLauncher = null;
servicesLauncher = new ServicesLauncher();
Thread t = new Thread(servicesLauncher);
t.setDaemon(true);
System.out.println("Starting the Spring Container as a Daemon thread");
t.start();
}
public void run(){
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(this.getConfigFiles());
System.out.println("Loaded the Spring Container with "+ applicationContext.getBeanDefinitionCount()+" Beans");
}
This is partial as it doesn't hnadle proper shutdown of the Spring Container and restart..
I am not sure whether we need to take advantage of Spring JMX featues and expose the above class as Spring JMX Bean..( Spring JMX Bean to manage the life cycle of another Spring Container !!!)
Thanks
Sateesh