You wrote:

 

"Something like this worked for me:
 
package my.ftp
 
import org.apache.ftpserver.FtpServer;
import org.springframework.beans.factory.DisposableBean;
 
public class FtpWrapper implements DisposableBean  {
 
    private FtpServer server;
 
    private FtpWrapper() { }
 
    public void setFTPServer(FtpServer server)
    {
        this.server = server;
        init();
    }
 
    private void init() {
        try {
            server.start();  "
       ...etc...
 
  I appreciate your suggestion, Ralph. But if I'm not mistaken, it looks
like you've posted a solution for a standalone Java app-not the Spring
approach to bean instantiation. For example, your solution directly
instantiates FtpServer the way a main() method would-rather than using
the Spring BeanFactory or ApplicationContext approach.  
 
As I originally posted, I already know how to launch FTPServer using
Java. That's not what I'm asking about. My question was about how one
does the same thing in a deployed Spring application. Spring.  In
Spring, you are not supposed to directly instantiate any object-but
rather let Spring instantiate them by calling Spring's BeanFactory
methods.
 
However, for the BeanFactory instantiation to work, one has to have the
proper XML configuration file written. THIS is the question I was
asking:  What is the XML I have to write to force Spring to
automatically call FtpServer.start()?
 
See, I need to know how to make SPRING call server.start()---using XML.
I 'm not asking how to write a Java method call.

 

Reply via email to