You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Eric Charles (JIRA)" <se...@james.apache.org> on 2011/04/28 11:08:03 UTC

[jira] [Created] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Reorganize system configuration files (spring context, xsd)
-----------------------------------------------------------

                 Key: JAMES-1237
                 URL: https://issues.apache.org/jira/browse/JAMES-1237
             Project: JAMES Server
          Issue Type: Improvement
          Components: Deployment Modules
            Reporter: Eric Charles


There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.

We could have the same approach and define a META-INF/james to hold those files

The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)

For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/

In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] [Commented] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JAMES-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031733#comment-13031733 ] 

Stefano Bagnara commented on JAMES-1237:
----------------------------------------

What did changes to make you switch to "must-have" ? I'm still in the "not a good idea" state, so I'd be happy to understand what are the points that moved you.

Most spring code in james server related to imap and mailbox is james-server specific and adding more spring stuff in mailbox and imap won't help reducing the spring code in server.

What are the "demployment options" that this would bring? I don't see what a mailbox-spring and mailbox-guice modules would provide to the end user/developers, and having such modules sounds countrary to the spirit of guice/spring. 

About your examples: cfx, camel, activemq , they embrace spring as their platform and not simply use it as "an optional, agnostic, container". I think this is something to take into consideration. They define impoved syntaxes (DSL) for spring configuration files, adapters for spring types and much more. I don't think that mailbox needs this stuff (and imap doesn't seem to have much more configuration). Currently we are far from using spring this way.. I think you are over-rating the power of adding a mailbox-spring.xml file in the mailbox project. If the goal is to help developers use the mailbox library then the api should be made more easy (there is plenty to do as suggested in the thread I linked previously).

That said, you are active, I'm passive, so you should simply go ahead with your idea. I'm sure we'll better understand the advantages/disadvantages once something is done for real.


> Reorganize system configuration files (spring context, xsd)
> -----------------------------------------------------------
>
>                 Key: JAMES-1237
>                 URL: https://issues.apache.org/jira/browse/JAMES-1237
>             Project: JAMES Server
>          Issue Type: Improvement
>          Components: Deployment Modules
>            Reporter: Eric Charles
>
> There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
> Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.
> We could have the same approach and define a META-INF/james to hold those files
> The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)
> For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/
> In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] [Commented] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Posted by "Eric Charles (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JAMES-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032242#comment-13032242 ] 

Eric Charles commented on JAMES-1237:
-------------------------------------

See [1] for @Inject (still needs to be defined as dependency).
I will implement it in June. Tks.

[1] http://download.oracle.com/javaee/6/api/javax/inject/Inject.html

> Reorganize system configuration files (spring context, xsd)
> -----------------------------------------------------------
>
>                 Key: JAMES-1237
>                 URL: https://issues.apache.org/jira/browse/JAMES-1237
>             Project: JAMES Server
>          Issue Type: Improvement
>          Components: Deployment Modules
>            Reporter: Eric Charles
>
> There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
> Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.
> We could have the same approach and define a META-INF/james to hold those files
> The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)
> For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/
> In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] [Commented] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Posted by "Eric Charles (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JAMES-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031778#comment-13031778 ] 

Eric Charles commented on JAMES-1237:
-------------------------------------

"Adding a class with setters or constructor parameters will allow anyone to use it without caring of wiring (even people not using a DI framework that simply will call "new MainClass()" or "MainClass.newMailbox" or anything you like.. both spring and guice will deal with that easily)"

--> some of our mailbox impl are not that complicated, but even for simple injection, @Inject annotation are used to do the wiring.
--> there are for database access a need for transaction management (with aspect proxies,...): the injection dependencies provide such functions, and the MainClass will have to recreate this which will quickly make it complicated.


> Reorganize system configuration files (spring context, xsd)
> -----------------------------------------------------------
>
>                 Key: JAMES-1237
>                 URL: https://issues.apache.org/jira/browse/JAMES-1237
>             Project: JAMES Server
>          Issue Type: Improvement
>          Components: Deployment Modules
>            Reporter: Eric Charles
>
> There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
> Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.
> We could have the same approach and define a META-INF/james to hold those files
> The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)
> For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/
> In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] [Commented] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JAMES-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031648#comment-13031648 ] 

Stefano Bagnara commented on JAMES-1237:
----------------------------------------

About the "mailbox spring" stuff, we discussed it in the mailing list few months ago and you agreed that "having spring modules is a bit bloated for mailbox and imap". Did you change your mind?
http://www.mail-archive.com/server-dev@james.apache.org/msg31051.html

> Reorganize system configuration files (spring context, xsd)
> -----------------------------------------------------------
>
>                 Key: JAMES-1237
>                 URL: https://issues.apache.org/jira/browse/JAMES-1237
>             Project: JAMES Server
>          Issue Type: Improvement
>          Components: Deployment Modules
>            Reporter: Eric Charles
>
> There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
> Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.
> We could have the same approach and define a META-INF/james to hold those files
> The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)
> For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/
> In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] [Commented] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JAMES-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031764#comment-13031764 ] 

Stefano Bagnara commented on JAMES-1237:
----------------------------------------

"btw, you interact, so you're not that "passive" :) "
words don't count as activity, they can even be counterproductive if the don't bring value, so you are authorized to ignore me as long as I don't put my hands in the code :-)

"to have a library that can be used out-of-the box, without caring which bean must be injected in which other bean. "
I agree with this, but I thought this could be achieved by adding a simple java class that does the wiring. Most of the stuff we wire doesn't have alternative implementations or special configurations. Adding a class with setters or constructor parameters will allow anyone to use it without caring of wiring (even people not using a DI framework that simply will call "new MainClass()" or "MainClass.newMailbox" or anything you like.. both spring and guice will deal with that easily).



> Reorganize system configuration files (spring context, xsd)
> -----------------------------------------------------------
>
>                 Key: JAMES-1237
>                 URL: https://issues.apache.org/jira/browse/JAMES-1237
>             Project: JAMES Server
>          Issue Type: Improvement
>          Components: Deployment Modules
>            Reporter: Eric Charles
>
> There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
> Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.
> We could have the same approach and define a META-INF/james to hold those files
> The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)
> For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/
> In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] [Commented] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Posted by "Eric Charles (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JAMES-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031695#comment-13031695 ] 

Eric Charles commented on JAMES-1237:
-------------------------------------

Yes, from a "nice-to-have", I was on a "maybe-not-needed" after our discussions. Rethinking about it, I am now on a "must-have" state.
I'm thinking to an mailbox-spring extra module to avoid let depend the impl modules on spring.
I'm also thinking to a mailbox-guice module.
This would raise the number of maven modules, but would bring more deployment options.
Any thoughts ?

> Reorganize system configuration files (spring context, xsd)
> -----------------------------------------------------------
>
>                 Key: JAMES-1237
>                 URL: https://issues.apache.org/jira/browse/JAMES-1237
>             Project: JAMES Server
>          Issue Type: Improvement
>          Components: Deployment Modules
>            Reporter: Eric Charles
>
> There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
> Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.
> We could have the same approach and define a META-INF/james to hold those files
> The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)
> For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/
> In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] [Commented] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Posted by "Stefano Bagnara (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JAMES-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032063#comment-13032063 ] 

Stefano Bagnara commented on JAMES-1237:
----------------------------------------

I can't find @Inject annotations in the mailbox source tree.
About transactions I'm not sure I understand your concerns.

I don't see the way a spring or guice module will help too much developers for mailbox (instead I believe there is much to do in this regard in java code instead), but anyway you proposed separated modules so in the worst case it won't hurt. So go ahead, I will be happy to review the code and I hope to be surprised :-)

> Reorganize system configuration files (spring context, xsd)
> -----------------------------------------------------------
>
>                 Key: JAMES-1237
>                 URL: https://issues.apache.org/jira/browse/JAMES-1237
>             Project: JAMES Server
>          Issue Type: Improvement
>          Components: Deployment Modules
>            Reporter: Eric Charles
>
> There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
> Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.
> We could have the same approach and define a META-INF/james to hold those files
> The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)
> For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/
> In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] [Commented] (JAMES-1237) Reorganize system configuration files (spring context, xsd)

Posted by "Eric Charles (JIRA)" <se...@james.apache.org>.
    [ https://issues.apache.org/jira/browse/JAMES-1237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031752#comment-13031752 ] 

Eric Charles commented on JAMES-1237:
-------------------------------------

Most spring code in james server related to imap and mailbox is james-server specific and adding more spring stuff in mailbox and imap won't help reducing the spring code in server.

--> the goal I'm looking for is not to reduce the spring code in server, but to have a library that can be used out-of-the box, without caring which bean must be injected in which other bean.

What are the "demployment options" that this would bring? I don't see what a mailbox-spring and mailbox-guice modules would provide to the end user/developers, and having such modules sounds countrary to the spirit of guice/spring.

--> I rather use guice than spring for dependency injection, but the idea is the same. If I declare in my projet the mailbox-guice dependency, I expect to only have to instanciate the MailboxModule (in guice teminology) and I expect to have access to the mailbox object without having to construct/inject them. Same approach with spring. Maybe "deployment" should be renamed to "injection" in my sentence.

About your examples: cfx, camel, activemq , they embrace spring as their platform and not simply use it as "an optional, agnostic, container". I think this is something to take into consideration. They define impoved syntaxes (DSL) for spring configuration files, adapters for spring types and much more. I don't think that mailbox needs this stuff (and imap doesn't seem to have much more configuration). Currently we are far from using spring this way.. I think you are over-rating the power of adding a mailbox-spring.xml file in the mailbox project. If the goal is to help developers use the mailbox library then the api should be made more easy (there is plenty to do as suggested in the thread I linked previously).

--> I think camel and  activemq can run without spring (not cxf). I was referring to these examples to show a potential place to store the configuration file, not to compare them on the spring usage.
--> I'm with you on mailbox api simplification (https://issues.apache.org/jira/browse/MAILBOX-46), but even simple, an out-of-box injection will help.

That said, you are active, I'm passive, so you should simply go ahead with your idea. I'm sure we'll better understand the advantages/disadvantages once something is done for real. 

--> Maybe I will begin with a guice module to not impact server.
--> btw, you interact, so you're not that "passive" :)


> Reorganize system configuration files (spring context, xsd)
> -----------------------------------------------------------
>
>                 Key: JAMES-1237
>                 URL: https://issues.apache.org/jira/browse/JAMES-1237
>             Project: JAMES Server
>          Issue Type: Improvement
>          Components: Deployment Modules
>            Reporter: Eric Charles
>
> There is a trend for configuration/properties files to be placed in META-INF (look at cxf, camel, maven,... distributions).
> Also, I think the injection of dependent project (mailbox, imap) should not be defined in server, but in the project it self.
> We could have the same approach and define a META-INF/james to hold those files
> The server context could go to META-INF/james/server-spring.xml, and we could move the definitions related to mailbox,imap to their respective project (with the same strategy, in  META-INF/james/mailbox-spring.xml,...)
> For the embedded XSD I'm not sure if thy need to go to META-INF/james/org.apache.activemq,... or META-INF/activemq/
> In all cases, the user can stilll override the defintions at deployment time simply by defining the files in the conf folder (conf is on top of the classpath).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org