Author: norman
Date: Wed Oct 13 05:38:01 2010
New Revision: 1022002
URL: http://svn.apache.org/viewvc?rev=1022002&view=rev
Log:
just use *DomainListMBean interfaces as marker interface and extend the
"normal" *DomainList interfaces, also remove two methods from DomainList
interface which not belong in there
Modified:
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainList.java
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainListMBean.java
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/ManageableDomainListMBean.java
james/server/trunk/domain-library/src/main/java/org/apache/james/domain/AbstractDomainList.java
james/server/trunk/spoolmanager/src/main/java/org/apache/james/JamesMailServer.java
Modified:
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainList.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainList.java?rev=1022002&r1=1022001&r2=1022002&view=diff
==============================================================================
---
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainList.java
(original)
+++
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainList.java
Wed Oct 13 05:38:01 2010
@@ -42,23 +42,5 @@ public interface DomainList {
*/
public boolean containsDomain(String domain);
- /**
- * Set to true to autodetect the hostname of the host on which
- * james is running, and add this to the domain service
- * Default is true
- *
- * @param autodetect set to false for disable
- */
- public void setAutoDetect(boolean autodetect);
-
-
- /**
- * Set to true to lookup the ipaddresses for each given domain
- * and add these to the domain service
- * Default is true
- *
- * @param autodetectIP set to false for disable
- */
- public void setAutoDetectIP(boolean autodetectIP);
}
Modified:
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainListMBean.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainListMBean.java?rev=1022002&r1=1022001&r2=1022002&view=diff
==============================================================================
---
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainListMBean.java
(original)
+++
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/DomainListMBean.java
Wed Oct 13 05:38:01 2010
@@ -18,24 +18,10 @@
****************************************************************/
package org.apache.james.api.domainlist;
-public interface DomainListMBean {
-
- /**
- * Return an Array of domains which should be used as localdomains. Return
null if no
- * domains were found
- *
- * @return domains
- */
- public String[] getDomains();
-
- /**
- * Return true if the domain exists in the domainlist
- *
- *
- * @param domain the domain
- * @return true if the given domain exists in the service
- */
- public boolean containsDomain(String domain);
-
+/**
+ * JMX MBean for DomainList
+ *
+ */
+public interface DomainListMBean extends DomainList{
}
Modified:
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/ManageableDomainListMBean.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/ManageableDomainListMBean.java?rev=1022002&r1=1022001&r2=1022002&view=diff
==============================================================================
---
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/ManageableDomainListMBean.java
(original)
+++
james/server/trunk/domain-api/src/main/java/org/apache/james/api/domainlist/ManageableDomainListMBean.java
Wed Oct 13 05:38:01 2010
@@ -18,21 +18,11 @@
****************************************************************/
package org.apache.james.api.domainlist;
-public interface ManageableDomainListMBean extends DomainListMBean{
+/**
+ * JMX MBean for manage {...@link ManageableDomainList}
+ *
+ *
+ */
+public interface ManageableDomainListMBean extends DomainListMBean,
ManageableDomainList{
- /**
- * Add domain to the service
- *
- * @param domain domain to add
- * @return true if successfull
- */
- public boolean addDomain(String domain);
-
- /**
- * Remove domain from the service
- *
- * @param domain domain to remove
- * @return true if successfull
- */
- public boolean removeDomain(String domain);
}
Modified:
james/server/trunk/domain-library/src/main/java/org/apache/james/domain/AbstractDomainList.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/domain-library/src/main/java/org/apache/james/domain/AbstractDomainList.java?rev=1022002&r1=1022001&r2=1022002&view=diff
==============================================================================
---
james/server/trunk/domain-library/src/main/java/org/apache/james/domain/AbstractDomainList.java
(original)
+++
james/server/trunk/domain-library/src/main/java/org/apache/james/domain/AbstractDomainList.java
Wed Oct 13 05:38:01 2010
@@ -59,6 +59,8 @@ public abstract class AbstractDomainList
return logger;
}
+
+
/*
* (non-Javadoc)
* @see org.apache.james.api.domainlist.DomainList#getDomains()
@@ -163,16 +165,26 @@ public abstract class AbstractDomainList
return removeDomainInternal(domain);
}
+
/**
- * @see org.apache.james.api.domainlist.DomainList#setAutoDetect(boolean)
+ * Set to true to autodetect the hostname of the host on which
+ * james is running, and add this to the domain service
+ * Default is true
+ *
+ * @param autodetect set to false for disable
*/
public synchronized void setAutoDetect(boolean autoDetect) {
getLogger().info("Set autodetect to: " + autoDetect);
this.autoDetect = autoDetect;
}
+
/**
- * @see org.apache.james.api.domainlist.DomainList#setAutoDetectIP(boolean)
+ * Set to true to lookup the ipaddresses for each given domain
+ * and add these to the domain service
+ * Default is true
+ *
+ * @param autodetectIP set to false for disable
*/
public synchronized void setAutoDetectIP(boolean autoDetectIP) {
getLogger().info("Set autodetectIP to: " + autoDetectIP);
Modified:
james/server/trunk/spoolmanager/src/main/java/org/apache/james/JamesMailServer.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/spoolmanager/src/main/java/org/apache/james/JamesMailServer.java?rev=1022002&r1=1022001&r2=1022002&view=diff
==============================================================================
---
james/server/trunk/spoolmanager/src/main/java/org/apache/james/JamesMailServer.java
(original)
+++
james/server/trunk/spoolmanager/src/main/java/org/apache/james/JamesMailServer.java
Wed Oct 13 05:38:01 2010
@@ -22,7 +22,6 @@
package org.apache.james;
import java.net.UnknownHostException;
-import java.util.List;
import java.util.Locale;
import javax.annotation.PostConstruct;
@@ -130,24 +129,11 @@ public class JamesMailServer
queue = queueFactory.getQueue("spool");
if (conf.getKeys("usernames").hasNext()) {
- throw new ConfigurationException("<usernames> parameter in
James block was removed. Please configure this data in UsersRepository block:
configuration injected for backward compatibility");
+ throw new ConfigurationException("<usernames> parameter in
James block was removed. Please configure this data in UsersRepository block");
}
if (conf.getKeys("servernames").hasNext()) {
- HierarchicalConfiguration serverConf =
conf.configurationAt("servernames");
- if (domains instanceof ManageableDomainList) {
- logger.warn("<servernames> parameter in James block is
deprecated. Please configure this data in domainlist block: configuration
injected for backward compatibility");
- ManageableDomainList dom = (ManageableDomainList) domains;
-
dom.setAutoDetect(serverConf.getBoolean("[...@autodetect]",true));
-
dom.setAutoDetectIP(serverConf.getBoolean("[...@autodetectip]", true));
-
- List<String> serverNameConfs = serverConf.getList(
"servername" );
- for ( int i = 0; i < serverNameConfs.size(); i++ ) {
- dom.addDomain(
serverNameConfs.get(i).toLowerCase(Locale.US));
- }
- } else {
- logger.error("<servernames> parameter is no more supported.
Backward compatibility is provided when using an XMLDomainList");
- }
+ throw new ConfigurationException("<servernames> parameter in
mailserver block was removed. Please configure this data in domainlist block");
}
initializeServernames();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]