Re: [jSPF] prepared for 0.9.8 release

2010-06-09 Thread Norman Maurer
Hi Stefano,

thx for preparing. I will have look if we need something adjusted for
james-trunk (I don't think so).

Bye,
Norman


2010/6/8 Stefano Bagnara apa...@bago.org:
 Hi all,

 I removed the stage and fixed the multi module build of jspf 0.9.8.
 Checked the licenses/notice and the resulting packages. Everything
 should be ready for a release.

 Norman, can you take care of releasing?

 Stefano

 PS: if there is any change we can make in jspf to improve support in
 james trunk just let me know so we can add the changes before
 releasing (so we won't need another release before james 3M1 release).

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



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



Re: [IMAP] Cut a milestone ?

2010-06-09 Thread Tim-Christian Mundt

Hi!

There is this one change of the database layout which should be decided 
upon before releasing, I think. Messing with code after the release is 
fine, but changing the database would be bad. I'm talking about Normans 
idea to unite the Message and Membership interfaces/classes = tables. 
The original idea of separating those was not to pass the whole mime 
message around when just the flags are needed. Moreover, the Membership 
part would serve as a reference to the Message so that a copy would just 
mean another reference to the same mail.


The question: does the increased complexity really pay off? I think 
saving space is not really an argument because it's not really common to 
have duplicates (at least in my experience). And loading the whole 
message would not mean the contents but only a stream handler, not a 
memory killer, right?


Regards
Tim

Eric Charles:
Running here without any problem jpa (embedded derby) + jdbc 
domainlist + spamassassin + forwarding mailet.

When do you think to release?
Tks,
Eric

On 06/07/2010 04:51 PM, Norman Maurer wrote:

Thx mate..

I deployed fresh trunk and everything seems to work so far without 
problems :)


Bye,
Norman

Ps: I'm using JCR Mailbox

2010/6/7 Eric Charleseric.char...@u-mangate.com:
  

Hi,
I will deploy a fresh trunk this night just to make sure everything 
is still

ok (cfr last commits in protocol,..).
The last snapshot I took is 2 weeks-old and is really stable.

Tks,
Eric


On 06/07/2010 04:40 PM, Norman Maurer wrote:


Hi all,

I think all the stuff in the imap library is now very usable. I think
we should cut a milestone and then cut one of james server. Anything
you guys want to get refactored before ?

Bye,
Norman

Ps: Even if we discover a bug later we can cut just another one..
Release often, Release early (urgh...)

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


   


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


 

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

   



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




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



Re: [IMAP] Cut a milestone ?

2010-06-09 Thread Norman Maurer
Right,

I think we should at least be sure to not change the layout anymore. I
don't have a strong opinion on the double storage vs. single storage.
If we don't need the single storage we could just merge Document and
MailboxMembership interface.

Bye,
Norman


2010/6/9 Tim-Christian Mundt d...@tim-erwin.de:
 Hi!

 There is this one change of the database layout which should be decided upon
 before releasing, I think. Messing with code after the release is fine, but
 changing the database would be bad. I'm talking about Normans idea to unite
 the Message and Membership interfaces/classes = tables. The original idea
 of separating those was not to pass the whole mime message around when just
 the flags are needed. Moreover, the Membership part would serve as a
 reference to the Message so that a copy would just mean another reference to
 the same mail.

 The question: does the increased complexity really pay off? I think saving
 space is not really an argument because it's not really common to have
 duplicates (at least in my experience). And loading the whole message
 would not mean the contents but only a stream handler, not a memory killer,
 right?

 Regards
 Tim

 Eric Charles:

 Running here without any problem jpa (embedded derby) + jdbc domainlist +
 spamassassin + forwarding mailet.
 When do you think to release?
 Tks,
 Eric

 On 06/07/2010 04:51 PM, Norman Maurer wrote:

 Thx mate..

 I deployed fresh trunk and everything seems to work so far without
 problems :)

 Bye,
 Norman

 Ps: I'm using JCR Mailbox

 2010/6/7 Eric Charleseric.char...@u-mangate.com:


 Hi,
 I will deploy a fresh trunk this night just to make sure everything is
 still
 ok (cfr last commits in protocol,..).
 The last snapshot I took is 2 weeks-old and is really stable.

 Tks,
 Eric


 On 06/07/2010 04:40 PM, Norman Maurer wrote:


 Hi all,

 I think all the stuff in the imap library is now very usable. I think
 we should cut a milestone and then cut one of james server. Anything
 you guys want to get refactored before ?

 Bye,
 Norman

 Ps: Even if we discover a bug later we can cut just another one..
 Release often, Release early (urgh...)

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




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




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




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



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



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



Build failed in Hudson: hupa-trunk #156

2010-06-09 Thread Apache Hudson Server
See http://hudson.zones.apache.org/hudson/job/hupa-trunk/156/

--
[...truncated 411 lines...]
A 
client/src/main/java/org/apache/hupa/client/mvp/NameAwareWidgetDisplay.java
A client/src/main/java/org/apache/hupa/client/HupaMessages.java
A client/src/main/java/org/apache/hupa/client/dnd
A 
client/src/main/java/org/apache/hupa/client/dnd/PagingScrollTableRowDragController.java
A client/src/main/java/org/apache/hupa/client/widgets
A 
client/src/main/java/org/apache/hupa/client/widgets/MessageHeaders.java
A client/src/main/java/org/apache/hupa/client/widgets/EnableButton.java
A client/src/main/java/org/apache/hupa/client/widgets/IMAPTreeItem.java
A client/src/main/java/org/apache/hupa/client/widgets/CommandsBar.java
A 
client/src/main/java/org/apache/hupa/client/widgets/ConfirmDialogBox.java
A 
client/src/main/java/org/apache/hupa/client/widgets/DragRefetchPagingScrollTable.java
A client/src/main/java/org/apache/hupa/client/widgets/HasDialog.java
A client/src/main/java/org/apache/hupa/client/widgets/MyDialogBox.java
A client/src/main/java/org/apache/hupa/client/HupaConstants.java
A 
client/src/main/java/org/apache/hupa/client/HupaConstants_es.properties
A client/src/main/java/org/apache/hupa/client/Hupa.java
A client/src/main/java/org/apache/hupa/client/gin
A client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java
A client/src/main/java/org/apache/hupa/client/gin/HupaGinjector.java
A client/src/main/resources
A client/src/main/resources/log4j.properties
A client/src/main/webapp
A client/src/main/webapp/WEB-INF
A client/src/main/webapp/WEB-INF/web.xml
A client/src/site
A client/src/site/site.xml
A client/war
A client/war/Hupa.html
A client/war/Hupa.css
A client/war/images
AUclient/war/images/hupa-logo-64.jpg
AUclient/war/images/hupa-logo-48.jpg
AUclient/war/images/hupa-spinning.gif
AUclient/war/images/ajax-loader.gif
AUclient/war/images/hupa-logo-original-transparent.jpg
AUclient/war/images/hupa-logo-32.jpg
AUclient/war/images/hupa-logo-original.jpg
A client/war/WEB-INF
A client/war/WEB-INF/web.xml
A client/war/WEB-INF/classes
AUclient/war/favicon.ico
A client/pom.xml
 U.
At revision 952916
no revision recorded for http://svn.apache.org/repos/asf/james/hupa/trunk in 
the previous build
Parsing POMs
[trunk] $ java -cp 
/export/home/hudson/hudson-slave/maven-agent.jar:/home/hudson/tools/maven/apache-maven-2.0.10/boot/classworlds-1.1.jar
 hudson.maven.agent.Main /home/hudson/tools/maven/apache-maven-2.0.10 
/export/home/hudson/hudson-slave/slave.jar 
/export/home/hudson/hudson-slave/maven-interceptor.jar 43073
channel started
===[HUDSON REMOTING CAPACITY]===   Executing Maven:  -B -f 
http://hudson.zones.apache.org/hudson/job/hupa-trunk/ws/trunk/pom.xml clean 
compile emma:emma[INFO] Scanning for projects...

[INFO] Reactor build order: 
[INFO]   hupa-parent
[INFO]   hupa-shared
[INFO]   hupa-server
[INFO]   hupa-widgets
[INFO]   hupa
[INFO] Searching repository for plugin with prefix: 'emma'.
[INFO] artifact org.codehaus.mojo:emma-maven-plugin: checking for updates from 
central
[INFO] 
[INFO] Building hupa-parent
[INFO]task-segment: [clean, compile, emma:emma]
[INFO] 
[INFO] [clean:clean]
[INFO] No goals needed for project - skipping
[INFO] Preparing emma:emma
[HUDSON] Archiving 
http://hudson.zones.apache.org/hudson/job/hupa-trunk/ws/trunk/pom.xml to 
/export/home/hudson/hudson/jobs/hupa-trunk/modules/org.apache.hupa$hupa-parent/builds/2010-06-09_09-16-51/archive/org.apache.hupa/hupa-parent/0.0.1-SNAPSHOT/pom.xml
[INFO] [emma:instrument]
[INFO] Not executing EMMA, as the project is not a Java classpath-capable 
package
[INFO] [emma:emma]
[INFO] Not generating EMMA report as the metadata file (coverage.em) could not 
be found
[INFO] 
[INFO] Building hupa-shared
[INFO]task-segment: [clean, compile, emma:emma]
[INFO] 
[INFO] [clean:clean]
[INFO] [resources:resources]
[WARNING] Using platform encoding (ISO646-US actually) to copy filtered 
resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory 
http://hudson.zones.apache.org/hudson/job/hupa-trunk/ws/trunk/shared/src/main/resources
[INFO] [gwt:resources {execution: default}]
[INFO] auto discovered modules [org.apache.hupa.Shared]
[INFO] 85 source files copied from GWT module org.apache.hupa.Shared
[INFO] [compiler:compile]
[INFO] Compiling 84 source 

svn commit: r952922 - in /james/server/trunk: pom.xml stage/

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 09:33:45 2010
New Revision: 952922

URL: http://svn.apache.org/viewvc?rev=952922view=rev
Log:
Remove stage folder, cleanup pom.xml

Removed:
james/server/trunk/stage/
Modified:
james/server/trunk/pom.xml

Modified: james/server/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pom.xml?rev=952922r1=952921r2=952922view=diff
==
--- james/server/trunk/pom.xml (original)
+++ james/server/trunk/pom.xml Wed Jun  9 09:33:45 2010
@@ -38,8 +38,7 @@
 modulecore-api/module
 moduleuser-api/module
 moduleuser-function/module
-moduleuser-library/module
-
+moduleuser-library/module
 moduledomain-api/module
 modulecore-library/module
 modulemanagement/module
@@ -212,7 +211,7 @@
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-netty-socket/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
@@ -286,103 +285,103 @@
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-javamail-util/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-common-util/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-common-util/artifactId
   typetest-jar/type
   scopetest/scope
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-user-api/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-user-api/artifactId
   typetest-jar/type
   scopetest/scope
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-core-api/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james.protocols/groupId
   artifactIdprotocols-api/artifactId
-  version1.1-SNAPSHOT/version
+  version${protocols.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-core-api/artifactId
   typetest-jar/type
   scopetest/scope
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-domain-api/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-core-library/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-management/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-user-library/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdjames-server-user-library/artifactId
-  version3.0-SNAPSHOT/version
+  version${pom.version}/version
   scopetest/scope
   typetest-jar/type
 /dependency
 dependency
   groupIdorg.apache.james.protocols/groupId
   artifactIdprotocols-smtp/artifactId
-  version1.1-SNAPSHOT/version
+  version${protocols.version}/version
 /dependency
 dependency
   groupIdorg.apache.james.protocols/groupId
   artifactIdprotocols-smtp/artifactId
-  version1.1-SNAPSHOT/version
+  version${protocols.version}/version
   typetest-jar/type
   scopetest/scope
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdapache-james-imap-memory/artifactId
-  version0.1-M2-SNAPSHOT/version
+  version${imap.version}/version
   scopetest/scope
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdapache-james-imap-mailbox/artifactId
-  version0.1-M2-SNAPSHOT/version
+  version${imap.version}/version
 /dependency
 dependency
   groupIdorg.apache.james/groupId
   artifactIdapache-james-imap-decode/artifactId
-  version0.1-M2-SNAPSHOT/version
+  version${imap.version}/version
   exclusions
 exclusion
   

svn commit: r952957 - in /james/imap/trunk/jcr/src/main: java/org/apache/james/imap/jcr/ java/org/apache/james/imap/jcr/user/ java/org/apache/james/imap/jcr/user/model/ resources/org/apache/james/imap

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 11:03:08 2010
New Revision: 952957

URL: http://svn.apache.org/viewvc?rev=952957view=rev
Log:
Store the subscriptions in the directly in the users node as multi value 
property.

Modified:

james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java

james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java

james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/model/JCRSubscription.java
james/imap/trunk/jcr/src/main/resources/org/apache/james/imap/jcr/imap.cnd

Modified: 
james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java?rev=952957r1=952956r2=952957view=diff
==
--- 
james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java
 (original)
+++ 
james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java
 Wed Jun  9 11:03:08 2010
@@ -35,7 +35,6 @@ import org.apache.james.imap.store.trans
  */
 public abstract class AbstractJCRMapper extends AbstractTransactionalMapper 
implements JCRImapConstants {
 public final static String MAILBOXES_PATH =  mailboxes;
-public final static String SUBSCRIPTIONS_PATH =  subscriptions;
 
 private final Log logger;
 private final MailboxSessionJCRRepository repository;

Modified: 
james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
URL: 
http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java?rev=952957r1=952956r2=952957view=diff
==
--- 
james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
 (original)
+++ 
james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
 Wed Jun  9 11:03:08 2010
@@ -24,7 +24,9 @@ import java.util.List;
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
 import javax.jcr.RepositoryException;
+import javax.jcr.Value;
 import javax.jcr.query.Query;
 import javax.jcr.query.QueryManager;
 import javax.jcr.query.QueryResult;
@@ -65,7 +67,20 @@ public class JCRSubscriptionMapper exten
 
 Node node = sub.getNode();
 if (node != null) {
-node.remove();
+Property prop = 
node.getProperty(JCRSubscription.MAILBOXES_PROPERTY);
+Value[] values = prop.getValues();
+ListString newValues = new ArrayListString();
+for (int i = 0; i  values.length; i++) {
+String m = values[i].getString();
+if (m.equals(sub.getMailbox()) == false) {
+newValues.add(m);
+}
+}
+if (newValues.isEmpty() == false) {
+prop.setValue(newValues.toArray(new 
String[newValues.size()]));
+} else {
+prop.remove();
+}
 }
 } catch (PathNotFoundException e) {
 // do nothing
@@ -83,14 +98,14 @@ public class JCRSubscriptionMapper exten
  */
 public Subscription findFindMailboxSubscriptionForUser(String user, String 
mailbox) throws SubscriptionException {
 try {
-String queryString = // + SUBSCRIPTIONS_PATH + 
//element(*,jamesMailbox:subscription)[@ + JCRSubscription.USERNAME_PROPERTY 
+ =' + user + '] AND [@ + JCRSubscription.MAILBOX_PROPERTY +=' + mailbox 
+ '];
+String queryString = // + MAILBOXES_PATH + 
//element(*,jamesMailbox:user)[@ + JCRSubscription.USERNAME_PROPERTY + =' + 
user + '] AND [@ + JCRSubscription.MAILBOXES_PROPERTY +=' + mailbox + '];
 
 QueryManager manager = 
getSession().getWorkspace().getQueryManager();
 QueryResult result = manager.createQuery(queryString, 
Query.XPATH).execute();
 
 NodeIterator nodeIt = result.getNodes();
 if (nodeIt.hasNext()) {
-JCRSubscription sub = new JCRSubscription(nodeIt.nextNode(), 
getLogger());
+JCRSubscription sub = new JCRSubscription(nodeIt.nextNode(), 
mailbox, getLogger());
 return sub;
 }
 
@@ -113,14 +128,20 @@ public class JCRSubscriptionMapper exten
 public ListSubscription findSubscriptionsForUser(String user) throws 
SubscriptionException {
 ListSubscription subList = new ArrayListSubscription();
 try {
-String queryString = // + SUBSCRIPTIONS_PATH + 
//element(*,jamesMailbox:subscription)[@ + JCRSubscription.USERNAME_PROPERTY 
+ =' + user + '];
+String queryString = // + 

svn commit: r952959 - /james/imap/trunk/jcr/target/

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 11:07:04 2010
New Revision: 952959

URL: http://svn.apache.org/viewvc?rev=952959view=rev
Log:
target folder should not be in trunk

Removed:
james/imap/trunk/jcr/target/


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



svn commit: r952960 - /james/imap/trunk/jcr/

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 11:09:01 2010
New Revision: 952960

URL: http://svn.apache.org/viewvc?rev=952960view=rev
Log:
ignore target folder

Modified:
james/imap/trunk/jcr/   (props changed)

Propchange: james/imap/trunk/jcr/
--
--- svn:ignore (added)
+++ svn:ignore Wed Jun  9 11:09:01 2010
@@ -0,0 +1 @@
+target



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



svn commit: r952969 - in /james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl: AbstractAsyncServer.java AbstractChannelPipelineFactory.java AbstractSSLAwareChannelPipelineFactory.

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 12:00:38 2010
New Revision: 952969

URL: http://svn.apache.org/viewvc?rev=952969view=rev
Log:
Make code in impl module more reusable (PROTOCOLS-3)

Modified:

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractSSLAwareChannelPipelineFactory.java

Modified: 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java?rev=952969r1=952968r2=952969view=diff
==
--- 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java
 (original)
+++ 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java
 Wed Jun  9 12:00:38 2010
@@ -22,7 +22,14 @@ import java.net.InetSocketAddress;
 import java.util.concurrent.Executors;
 
 import org.jboss.netty.bootstrap.ServerBootstrap;
+import org.jboss.netty.channel.Channel;
+import org.jboss.netty.channel.ChannelHandlerContext;
+import org.jboss.netty.channel.ChannelPipelineCoverage;
 import org.jboss.netty.channel.ChannelPipelineFactory;
+import org.jboss.netty.channel.ChannelStateEvent;
+import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
+import org.jboss.netty.channel.group.ChannelGroup;
+import org.jboss.netty.channel.group.DefaultChannelGroup;
 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
 
 /**
@@ -31,11 +38,6 @@ import org.jboss.netty.channel.socket.ni
  */
 public abstract class AbstractAsyncServer {
 
-
-protected int connPerIP = 0;
-
-protected int connectionLimit = 0;
-
 private int backlog = 250;
 
 private int port;
@@ -44,32 +46,65 @@ public abstract class AbstractAsyncServe
 
 private ServerBootstrap bootstrap;
 
-   private boolean started;
+private boolean started;
 
 private String ip;
+
+private ChannelGroup channels = new DefaultChannelGroup();
 
-public AbstractAsyncServer(String ip, int port) {
+
+/**
+ * Set the ip on which the Server should listen on
+ * 
+ * @param ip
+ */
+public void setIP(String ip) {
+if (started) throw new IllegalStateException(Can only be set when the 
server is not running);
 this.ip = ip;
+}
+
+
+/**
+ * Set the port on which the Server should listen on
+ * 
+ * @param ip
+ */
+public void setPort(int port) {
+if (started) throw new IllegalStateException(Can only be set when the 
server is not running);
 this.port = port;
 }
-   
+
 /**
  * Start the server
  * 
+ * @throws Exception 
+ * 
  */
-public synchronized final void start() {
-if (started)
-throw new IllegalStateException(Server running allready);
+public synchronized void start() throws Exception {
+if (started) throw new IllegalStateException(Server running already);
+
+if (port  1) throw new RuntimeException(Please specify a port to 
which the server should get bound!);
 
 bootstrap = new ServerBootstrap(new 
NioServerSocketChannelFactory(Executors.newCachedThreadPool(), 
Executors.newCachedThreadPool()));
+ChannelPipelineFactory factory = createPipelineFactory();
+
+// add the channel group handler
+factory.getPipeline().addFirst(channelGroupHandler, new 
ChannelGroupHandler());
+
 // Configure the pipeline factory.
-bootstrap.setPipelineFactory(createPipelineFactory());
+bootstrap.setPipelineFactory(factory);
 
 // Bind and start to accept incoming connections.
 bootstrap.setOption(backlog, backlog);
 bootstrap.setOption(reuseAddress, true);
-
-bootstrap.bind(new InetSocketAddress(ip, port));
+Channel serverChannel;
+if (getIP() == null) {
+serverChannel = bootstrap.bind(new InetSocketAddress(port));
+} else {
+serverChannel = bootstrap.bind(new InetSocketAddress(ip, port));
+}
+  
+channels.add(serverChannel);
 started = true;
 
 }
@@ -77,13 +112,22 @@ public abstract class AbstractAsyncServe
 /**
  * Stop the server
  */
-public synchronized final void stop() {
+public synchronized void stop() {
+channels.close().awaitUninterruptibly();
 bootstrap.releaseExternalResources();
 started = false;
 }
 
 
 
+/**
+ * Return the ip on which the server listen for connections
+ * 
+ * @return ip
+ */
+public String getIP() {
+return ip;
+}
 
 

svn commit: r952970 - in /james/server/trunk: ./ imapserver/src/main/java/org/apache/james/imapserver/netty/ netty-socket/ netty-socket/src/main/java/org/apache/james/socket/netty/ netty-socket/src/ma

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 12:01:49 2010
New Revision: 952970

URL: http://svn.apache.org/viewvc?rev=952970view=rev
Log:
Reuse code from protocols-impl 

Added:

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/AbstractConfigurableAsyncServer.java
  - copied, changed from r952106, 
james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/AbstractAsyncServer.java
Removed:

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/AbstractAsyncServer.java

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/AbstractChannelPipelineFactory.java

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/AbstractChannelUpstreamHandler.java

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/AbstractNettySession.java

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/AbstractResponseEncoder.java

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/AbstractSSLAwareChannelPipelineFactory.java

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/ChannelAttributeSupport.java

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/LineHandlerUpstreamHandler.java

james/server/trunk/netty-socket/src/main/java/org/apache/james/socket/netty/TimeoutHandler.java

james/server/trunk/netty-socket/src/main/java/org/jboss/netty/handler/connection/

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/mina/

james/server/trunk/remotemanager/src/main/java/org/apache/james/remotemanager/mina/

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/mina/
Modified:

james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java
james/server/trunk/netty-socket/pom.xml
james/server/trunk/pom.xml
james/server/trunk/pop3server/pom.xml

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/NioPOP3Server.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ChannelUpstreamHandler.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3NettySession.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/POP3ResponseEncoder.java
james/server/trunk/remotemanager/pom.xml

james/server/trunk/remotemanager/src/main/java/org/apache/james/remotemanager/netty/NettyRemoteManagerSession.java

james/server/trunk/remotemanager/src/main/java/org/apache/james/remotemanager/netty/NioRemoteManager.java

james/server/trunk/remotemanager/src/main/java/org/apache/james/remotemanager/netty/RemoteManagerChannelUpstreamHandler.java

james/server/trunk/remotemanager/src/main/java/org/apache/james/remotemanager/netty/RemoteManagerResponseEncoder.java
james/server/trunk/smtpserver/pom.xml

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/NioSMTPServer.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPChannelUpstreamHandler.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPNettySession.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/SMTPResponseEncoder.java

james/server/trunk/smtpserver/src/test/java/org/apache/james/smtpserver/NioSMTPServerTest.java

Modified: 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java?rev=952970r1=952969r2=952970view=diff
==
--- 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java
 (original)
+++ 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java
 Wed Jun  9 12:01:49 2010
@@ -29,7 +29,7 @@ import org.apache.james.imap.api.process
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.encode.ImapEncoder;
 import org.apache.james.imap.main.ImapRequestStreamHandler;
-import org.apache.james.socket.netty.AbstractAsyncServer;
+import org.apache.james.socket.netty.AbstractConfigurableAsyncServer;
 import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelPipelineFactory;
 import org.jboss.netty.handler.connection.ConnectionLimitUpstreamHandler;
@@ -40,7 +40,7 @@ import org.jboss.netty.handler.ssl.SslHa
  * NIO IMAP Server which use Netty
  *
  */
-public class NioImapServer extends AbstractAsyncServer implements 
ImapConstants{
+public class NioImapServer extends AbstractConfigurableAsyncServer implements 
ImapConstants{
 
 private static final String 

svn commit: r952974 - /james/protocols/trunk/pom.xml

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 12:05:40 2010
New Revision: 952974

URL: http://svn.apache.org/viewvc?rev=952974view=rev
Log:
cleanup

Modified:
james/protocols/trunk/pom.xml

Modified: james/protocols/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=952974r1=952973r2=952974view=diff
==
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Wed Jun  9 12:05:40 2010
@@ -36,8 +36,9 @@
 moduleapi/module
 modulesmtp/module
 moduleimpl/module
+!-- 
 modulesmtp-impl/module
-
+--
 !-- 
 modulepop3/module
 --
@@ -174,17 +175,17 @@
   dependency
 groupIdorg.apache.james.protocols/groupId
 artifactIdprotocols-smtp/artifactId
-version1.1-SNAPSHOT/version
+version${pom.version}/version
   /dependency
   dependency
 groupIdorg.apache.james.protocols/groupId
 artifactIdprotocols-api/artifactId
-version1.1-SNAPSHOT/version
+version${pom.version}/version
   /dependency
   dependency
 groupIdorg.apache.james.protocols/groupId
 artifactIdprotocols-impl/artifactId
-version1.1-SNAPSHOT/version
+version${pom.version}/version
   /dependency
   dependency
 groupIdcommons-logging/groupId



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



svn commit: r953133 - in /james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl: AbstractAsyncServer.java AbstractChannelPipelineFactory.java AbstractSSLAwareChannelPipelineFactory.

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 19:56:10 2010
New Revision: 953133

URL: http://svn.apache.org/viewvc?rev=953133view=rev
Log:
We need to add the ChannelGroupHandler in the factory so it is added on each 
connection. This should fix the waiting connections (JAMES-1014)

Added:

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/ChannelGroupHandler.java
Modified:

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java

james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractSSLAwareChannelPipelineFactory.java

Modified: 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java?rev=953133r1=953132r2=953133view=diff
==
--- 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java
 (original)
+++ 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractAsyncServer.java
 Wed Jun  9 19:56:10 2010
@@ -23,11 +23,7 @@ import java.util.concurrent.Executors;
 
 import org.jboss.netty.bootstrap.ServerBootstrap;
 import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
-import org.jboss.netty.channel.ChannelPipelineCoverage;
 import org.jboss.netty.channel.ChannelPipelineFactory;
-import org.jboss.netty.channel.ChannelStateEvent;
-import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
 import org.jboss.netty.channel.group.ChannelGroup;
 import org.jboss.netty.channel.group.DefaultChannelGroup;
 import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
@@ -86,11 +82,8 @@ public abstract class AbstractAsyncServe
 if (port  1) throw new RuntimeException(Please specify a port to 
which the server should get bound!);
 
 bootstrap = new ServerBootstrap(new 
NioServerSocketChannelFactory(Executors.newCachedThreadPool(), 
Executors.newCachedThreadPool()));
-ChannelPipelineFactory factory = createPipelineFactory();
+ChannelPipelineFactory factory = createPipelineFactory(channels);
 
-// add the channel group handler
-factory.getPipeline().addFirst(channelGroupHandler, new 
ChannelGroupHandler());
-
 // Configure the pipeline factory.
 bootstrap.setPipelineFactory(factory);
 
@@ -145,7 +138,7 @@ public abstract class AbstractAsyncServe
  * 
  * @return factory
  */
-protected abstract ChannelPipelineFactory createPipelineFactory();
+protected abstract ChannelPipelineFactory 
createPipelineFactory(ChannelGroup group);
 
 /**
  * Set the read/write timeout for the server. This will throw a {...@link 
IllegalStateException} if the
@@ -185,17 +178,4 @@ public abstract class AbstractAsyncServe
 return timeout;
 }
 
-/**
- * Add channels to the channel group after the channel was opened
- *
- */
-@ChannelPipelineCoverage(all)
-private final class ChannelGroupHandler extends 
SimpleChannelUpstreamHandler {
-public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent 
e) {
-// Add all open channels to the global group so that they are
-// closed on shutdown.
-channels.add(e.getChannel());
-}
-
-}
 }

Modified: 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java
URL: 
http://svn.apache.org/viewvc/james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java?rev=953133r1=953132r2=953133view=diff
==
--- 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java
 (original)
+++ 
james/protocols/trunk/impl/src/main/java/org/apache/james/protocols/impl/AbstractChannelPipelineFactory.java
 Wed Jun  9 19:56:10 2010
@@ -18,13 +18,13 @@
  /
 package org.apache.james.protocols.impl;
 
-import static org.jboss.netty.channel.Channels.*;
-
+import static org.jboss.netty.channel.Channels.pipeline;
 
 import org.apache.james.protocols.api.Response;
 import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelPipelineFactory;
 import org.jboss.netty.channel.ChannelUpstreamHandler;
+import org.jboss.netty.channel.group.ChannelGroup;
 import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
 import org.jboss.netty.handler.codec.frame.Delimiters;
 import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
@@ -44,11 +44,12 @@ public abstract class 

svn commit: r953134 - in /james/server/trunk: imapserver/src/main/java/org/apache/james/imapserver/netty/ pop3server/src/main/java/org/apache/james/pop3server/netty/ remotemanager/src/main/java/org/ap

2010-06-09 Thread norman
Author: norman
Date: Wed Jun  9 19:56:44 2010
New Revision: 953134

URL: http://svn.apache.org/viewvc?rev=953134view=rev
Log:
We need to add the ChannelGroupHandler in the factory so it is added on each 
connection. This should fix the waiting connections (JAMES-1014)

Modified:

james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java

james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/NioPOP3Server.java

james/server/trunk/remotemanager/src/main/java/org/apache/james/remotemanager/netty/NioRemoteManager.java

james/server/trunk/smtpserver/src/main/java/org/apache/james/smtpserver/netty/NioSMTPServer.java

Modified: 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java?rev=953134r1=953133r2=953134view=diff
==
--- 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java
 (original)
+++ 
james/server/trunk/imapserver/src/main/java/org/apache/james/imapserver/netty/NioImapServer.java
 Wed Jun  9 19:56:44 2010
@@ -29,9 +29,11 @@ import org.apache.james.imap.api.process
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.encode.ImapEncoder;
 import org.apache.james.imap.main.ImapRequestStreamHandler;
+import org.apache.james.protocols.impl.ChannelGroupHandler;
 import org.apache.james.socket.netty.AbstractConfigurableAsyncServer;
 import org.jboss.netty.channel.ChannelPipeline;
 import org.jboss.netty.channel.ChannelPipelineFactory;
+import org.jboss.netty.channel.group.ChannelGroup;
 import org.jboss.netty.handler.connection.ConnectionLimitUpstreamHandler;
 import org.jboss.netty.handler.connection.ConnectionPerIpLimitUpstreamHandler;
 import org.jboss.netty.handler.ssl.SslHandler;
@@ -90,11 +92,14 @@ public class NioImapServer extends Abstr
 }
 
 @Override
-protected ChannelPipelineFactory createPipelineFactory() {
+protected ChannelPipelineFactory createPipelineFactory(final ChannelGroup 
group) {
 return new ChannelPipelineFactory() {
+private ChannelGroupHandler groupHandler = new 
ChannelGroupHandler(group);
 
 public ChannelPipeline getPipeline() throws Exception {
 ChannelPipeline pipeline = pipeline();
+pipeline.addLast(groupHandler, groupHandler);
+
 pipeline.addLast(connectionLimit, new 
ConnectionLimitUpstreamHandler(NioImapServer.this.connectionLimit));
 
 pipeline.addLast(connectionPerIpLimit, new 
ConnectionPerIpLimitUpstreamHandler(NioImapServer.this.connPerIP));

Modified: 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/NioPOP3Server.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/NioPOP3Server.java?rev=953134r1=953133r2=953134view=diff
==
--- 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/NioPOP3Server.java
 (original)
+++ 
james/server/trunk/pop3server/src/main/java/org/apache/james/pop3server/netty/NioPOP3Server.java
 Wed Jun  9 19:56:44 2010
@@ -29,6 +29,7 @@ import org.apache.james.protocols.impl.A
 import org.apache.james.socket.netty.AbstractConfigurableAsyncServer;
 import org.jboss.netty.channel.ChannelPipelineFactory;
 import org.jboss.netty.channel.ChannelUpstreamHandler;
+import org.jboss.netty.channel.group.ChannelGroup;
 import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
 
 /**
@@ -108,15 +109,15 @@ public class NioPOP3Server extends Abstr
 }
 
 @Override
-protected ChannelPipelineFactory createPipelineFactory() {
-return new POP3ChannelPipelineFactory(getTimeout(), connectionLimit, 
connPerIP);
+protected ChannelPipelineFactory createPipelineFactory(ChannelGroup group) 
{
+return new POP3ChannelPipelineFactory(getTimeout(), connectionLimit, 
connPerIP, group);
 }
 
 private final class POP3ChannelPipelineFactory extends 
AbstractSSLAwareChannelPipelineFactory {
 
 public POP3ChannelPipelineFactory(int timeout, int maxConnections,
-int maxConnectsPerIp) {
-super(timeout, maxConnections, maxConnectsPerIp);
+int maxConnectsPerIp, ChannelGroup group) {
+super(timeout, maxConnections, maxConnectsPerIp, group);
 }
 
 @Override

Modified: 
james/server/trunk/remotemanager/src/main/java/org/apache/james/remotemanager/netty/NioRemoteManager.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/remotemanager/src/main/java/org/apache/james/remotemanager/netty/NioRemoteManager.java?rev=953134r1=953133r2=953134view=diff