Can anyone recommend a simple way to force Spring to automatically call
FTPServer.start()  when Spring gets an instance of it through
BeanFactory?  Keep in mind, FTPServer is not registered with Spring
through the applicationContext, but rather using the <server> </server>
element configuration file.  

 

I have found plenty of solutions which work only if FTPServer has been
configured within applicationContext.xml.  But of course, the
recommended and the Only Documented way to register FTPServer in Spring
is using a separate <server></server>  XML file, separate from
applicationContext.xml.  This is the way it is instantiated in my Spring
app, too.  So I need to find out how to get Spring to automatically call
its .start() method after auto-instantiation.

 

 

Why is this necessary?  Because of the way Spring works, and the fact
that FTPServer is a standalone Server application-not an HttpServlet.
Therefore, something has to call .start() on the Server---but you can't
just write a main() method to do it, because there is no way to command
a main() method to be executed by Spring when it is deployed to and run
on an Application server.  You get to deploy an EAR file to a remote
server.  From there, Spring and the remote server call all the shots.
So  there has to be some configuration to tell Spring to call .start()
on the instance of FtpServer it automatically instantiates.  If you know
Spring, you'll know why.

 

How do I configure this call to start()?  A main() method is useless,
deployed.

Reply via email to