>FtpServer is certainly registered in the Spring application context,
>using the custom XML elements or the standard Spring elements.
>However, as you point out, we do not support starting FtpServer using
>the custom elements (and I don't think we should as I think it's a bad
>idea, more on that further down). However, if using the regular Spring
><bean> element you could likely call start() as the init-method. I
>haven't tried it though.

 

So I guess that's a "no".

 

So you are saying ultimately, I will just call a main() method to
construct and start FTPServer in a deployed envrironment?  That's fine,
if so.

 

I can just write a shell script to call it, starting FTPServer deployed
on the server (Glassfish).  It just seemed redundant to use Spring, if
I'll be calling a main() method, anyway. But no big deal.

 

________________________________

From: Sisk, Brad 
Sent: Tuesday, October 14, 2008 5:40 PM
To: '[email protected]'
Subject: Any simple way to make Spring auto-call start() on FtpServer
when it is registered using the <server> tags?

 

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