You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2009/02/02 13:32:01 UTC

[jira] Created: (FTPSERVER-271) Embedding FtpServer in RC2 nearly impossible

Embedding FtpServer in RC2 nearly impossible
--------------------------------------------

                 Key: FTPSERVER-271
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-271
             Project: FtpServer
          Issue Type: Bug
    Affects Versions: 1.0.0-RC2
            Reporter: Claus Ibsen
            Priority: Critical


Hi

I might be a bit dissapointed now that when the upgrade from M3 to RC3 with an embedded FtpServer is very complicated as you have changed the API too much.

Its hard to set the FTP port number that is a very reasonable configuration to do.

This was baiscally how you could do it in M3 but now you have to fight with a NioListener and no way a public setPort method exsists.
http://mina.apache.org/ftpserver/embedding-ftpserver.html

Could you please reconsider the RC2 to ease the embedding of FtpServer. Its very cool for unit testing other frameworks.

Claus Ibsen, a committer on the Apache Camel project
http://davsclaus.blogspot.com/


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (FTPSERVER-271) Embedding FtpServer in RC2 nearly impossible

Posted by David Latorre <dv...@gmail.com>.
Hello Claus,
 Thanks for the report as  the changes in the initialization and
configuration of FtpServer  may be not obvious for previous users.
Just to avoid confusion, in Niklas example he uses "default" as the listener
name because that is the name of the default listener on port 21,  since the
 listeners are stored in a Hashmap, the previous "default" listener will be
replaced with your new one ...
 I mean, if you changed the listener name to something more significative
you'd have two listeners up! The solution is to use setListeners().

Keep the good work with Camel (a great product!)


2009/2/3 Claus Ibsen (JIRA) <ji...@apache.org>

>
>    [
> https://issues.apache.org/jira/browse/FTPSERVER-271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669875#action_12669875]
>
> Claus Ibsen commented on FTPSERVER-271:
> ---------------------------------------
>
> Thanks Niklas
>
> I was a bit frustrated that setting the port wasn't obvious how to do it.
> Didn't spot the listener factory, and got stuck by the protected setPort on
> the NioListtener.
>
> Thanks for the clarification. We can now upgrade to the RC2 in Camel.
> Thanks again for the prompt answer.
>
> /Claus
>
> > Embedding FtpServer in RC2 nearly impossible
> > --------------------------------------------
> >
> >                 Key: FTPSERVER-271
> >                 URL: https://issues.apache.org/jira/browse/FTPSERVER-271
> >             Project: FtpServer
> >          Issue Type: Bug
> >    Affects Versions: 1.0.0-RC2
> >            Reporter: Claus Ibsen
> >            Priority: Critical
> >
> > Hi
> > I might be a bit dissapointed now that when the upgrade from M3 to RC3
> with an embedded FtpServer is very complicated as you have changed the API
> too much.
> > Its hard to set the FTP port number that is a very reasonable
> configuration to do.
> > This was baiscally how you could do it in M3 but now you have to fight
> with a NioListener and no way a public setPort method exsists.
> > http://mina.apache.org/ftpserver/embedding-ftpserver.html
> > Could you please reconsider the RC2 to ease the embedding of FtpServer.
> Its very cool for unit testing other frameworks.
> > Claus Ibsen, a committer on the Apache Camel project
> > http://davsclaus.blogspot.com/
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Commented: (FTPSERVER-271) Embedding FtpServer in RC2 nearly impossible

Posted by "Niklas Gustavsson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FTPSERVER-271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669717#action_12669717 ] 

Niklas Gustavsson commented on FTPSERVER-271:
---------------------------------------------

While I agree that the API now requires additional steps, calling the nearly impossible might be stretching it a bit to far. Here's a comparison between how to set the port:
// old API
FtpServer server = new FtpServer();
server.getListener("default").setPort(2221);
server.start();

// new API
FtpServerFactory serverFactory = new FtpServerFactory();        
ListenerFactory factory = new ListenerFactory();
factory.setPort(2221);
serverFactory.addListener("default", factory.createListener());
FtpServer server = serverFactory.createServer();        
server.start();

There is clearly more code in the second example, however, I find it more truthful in what it actually provides. For example, in the old API; you could set the port after starting the server (and thus the listener), but it would not change anything.

There was three main reason the API was changed:
* Make the implementation as close to immutable as possible. This is a huge advantage since it allows more efficient implementations and removed lots of concurrency issues we had before
* Removed the need for initialization of various implementation classes. We did a lot of weird lazy inits of stuff before, now we do not have to, again making the code more efficient and safe
* Now works much better with OSGi as our implementations are never exposed in the public API

I'm very grateful for discovering the embedding documentation which was out of date. I've now replaced it with the new page that was already existing.

> Embedding FtpServer in RC2 nearly impossible
> --------------------------------------------
>
>                 Key: FTPSERVER-271
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-271
>             Project: FtpServer
>          Issue Type: Bug
>    Affects Versions: 1.0.0-RC2
>            Reporter: Claus Ibsen
>            Priority: Critical
>
> Hi
> I might be a bit dissapointed now that when the upgrade from M3 to RC3 with an embedded FtpServer is very complicated as you have changed the API too much.
> Its hard to set the FTP port number that is a very reasonable configuration to do.
> This was baiscally how you could do it in M3 but now you have to fight with a NioListener and no way a public setPort method exsists.
> http://mina.apache.org/ftpserver/embedding-ftpserver.html
> Could you please reconsider the RC2 to ease the embedding of FtpServer. Its very cool for unit testing other frameworks.
> Claus Ibsen, a committer on the Apache Camel project
> http://davsclaus.blogspot.com/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FTPSERVER-271) Embedding FtpServer in RC2 nearly impossible

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FTPSERVER-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved FTPSERVER-271.
-----------------------------------

    Resolution: Invalid

> Embedding FtpServer in RC2 nearly impossible
> --------------------------------------------
>
>                 Key: FTPSERVER-271
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-271
>             Project: FtpServer
>          Issue Type: Bug
>    Affects Versions: 1.0.0-RC2
>            Reporter: Claus Ibsen
>            Priority: Critical
>
> Hi
> I might be a bit dissapointed now that when the upgrade from M3 to RC3 with an embedded FtpServer is very complicated as you have changed the API too much.
> Its hard to set the FTP port number that is a very reasonable configuration to do.
> This was baiscally how you could do it in M3 but now you have to fight with a NioListener and no way a public setPort method exsists.
> http://mina.apache.org/ftpserver/embedding-ftpserver.html
> Could you please reconsider the RC2 to ease the embedding of FtpServer. Its very cool for unit testing other frameworks.
> Claus Ibsen, a committer on the Apache Camel project
> http://davsclaus.blogspot.com/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FTPSERVER-271) Embedding FtpServer in RC2 nearly impossible

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FTPSERVER-271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669875#action_12669875 ] 

Claus Ibsen commented on FTPSERVER-271:
---------------------------------------

Thanks Niklas

I was a bit frustrated that setting the port wasn't obvious how to do it. Didn't spot the listener factory, and got stuck by the protected setPort on the NioListtener.

Thanks for the clarification. We can now upgrade to the RC2 in Camel. Thanks again for the prompt answer.

/Claus

> Embedding FtpServer in RC2 nearly impossible
> --------------------------------------------
>
>                 Key: FTPSERVER-271
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-271
>             Project: FtpServer
>          Issue Type: Bug
>    Affects Versions: 1.0.0-RC2
>            Reporter: Claus Ibsen
>            Priority: Critical
>
> Hi
> I might be a bit dissapointed now that when the upgrade from M3 to RC3 with an embedded FtpServer is very complicated as you have changed the API too much.
> Its hard to set the FTP port number that is a very reasonable configuration to do.
> This was baiscally how you could do it in M3 but now you have to fight with a NioListener and no way a public setPort method exsists.
> http://mina.apache.org/ftpserver/embedding-ftpserver.html
> Could you please reconsider the RC2 to ease the embedding of FtpServer. Its very cool for unit testing other frameworks.
> Claus Ibsen, a committer on the Apache Camel project
> http://davsclaus.blogspot.com/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FTPSERVER-271) Embedding FtpServer in RC2 nearly impossible

Posted by "Niklas Gustavsson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FTPSERVER-271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Niklas Gustavsson closed FTPSERVER-271.
---------------------------------------

    Assignee: Niklas Gustavsson

> Embedding FtpServer in RC2 nearly impossible
> --------------------------------------------
>
>                 Key: FTPSERVER-271
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-271
>             Project: FtpServer
>          Issue Type: Bug
>    Affects Versions: 1.0.0-RC2
>            Reporter: Claus Ibsen
>            Assignee: Niklas Gustavsson
>            Priority: Critical
>
> Hi
> I might be a bit dissapointed now that when the upgrade from M3 to RC3 with an embedded FtpServer is very complicated as you have changed the API too much.
> Its hard to set the FTP port number that is a very reasonable configuration to do.
> This was baiscally how you could do it in M3 but now you have to fight with a NioListener and no way a public setPort method exsists.
> http://mina.apache.org/ftpserver/embedding-ftpserver.html
> Could you please reconsider the RC2 to ease the embedding of FtpServer. Its very cool for unit testing other frameworks.
> Claus Ibsen, a committer on the Apache Camel project
> http://davsclaus.blogspot.com/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.