Author: bago Date: Fri Oct 6 07:42:13 2006 New Revision: 453615 URL: http://svn.apache.org/viewvc?view=rev&rev=453615 Log: Removed unused context that was created by James and never passed to the only "user": UsersLDAPRepository.
I added a "domain" configuration for the UsersLDAPRepository (at least it is not null) (part of JAMES-654) Modified: james/server/trunk/src/java/org/apache/james/Constants.java james/server/trunk/src/java/org/apache/james/James.java james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java Modified: james/server/trunk/src/java/org/apache/james/Constants.java URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/Constants.java?view=diff&rev=453615&r1=453614&r2=453615 ============================================================================== --- james/server/trunk/src/java/org/apache/james/Constants.java (original) +++ james/server/trunk/src/java/org/apache/james/Constants.java Fri Oct 6 07:42:13 2006 @@ -53,12 +53,6 @@ public static final String HELLO_NAME = "HELLO_NAME"; /** - * Context key used to store the postmaster address for - * this James instance in the context. - */ - public static final String POSTMASTER = "POSTMASTER"; - - /** * Key used to store the component manager for * this James instance in a way accessible by * Avalon aware Mailets. Modified: james/server/trunk/src/java/org/apache/james/James.java URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/James.java?view=diff&rev=453615&r1=453614&r2=453615 ============================================================================== --- james/server/trunk/src/java/org/apache/james/James.java (original) +++ james/server/trunk/src/java/org/apache/james/James.java Fri Oct 6 07:42:13 2006 @@ -30,7 +30,6 @@ import org.apache.avalon.framework.container.ContainerUtil; import org.apache.avalon.framework.context.Context; import org.apache.avalon.framework.context.Contextualizable; -import org.apache.avalon.framework.context.DefaultContext; import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.avalon.framework.logger.Logger; import org.apache.avalon.framework.service.DefaultServiceManager; @@ -104,12 +103,6 @@ private DefaultServiceManager compMgr; //Components shared /** - * TODO: Investigate what this is supposed to do. Looks like it - * was supposed to be the Mailet context. - */ - private DefaultContext context; - - /** * The top level configuration object for this server. */ private Configuration conf; @@ -315,8 +308,6 @@ hostName = "localhost"; } - context = new DefaultContext(); - context.put("HostName", hostName); getLogger().info("Local host is: " + hostName); // Get the domains and hosts served by this instance @@ -363,8 +354,6 @@ } String defaultDomain = (String) serverNames.iterator().next(); - // used by UsersLDAPRepository as default domain. - context.put(Constants.DEFAULT_DOMAIN, defaultDomain); // used by RemoteDelivery for HELO attributes.put(Constants.DEFAULT_DOMAIN, defaultDomain); @@ -386,7 +375,6 @@ postMasterAddress = postMasterAddress + "@" + (domainName != null ? domainName : hostName); } this.postmaster = new MailAddress( postMasterAddress ); - context.put( Constants.POSTMASTER, postmaster ); if (!isLocalServer(postmaster.getHost())) { StringBuffer warnBuffer Modified: james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java?view=diff&rev=453615&r1=453614&r2=453615 ============================================================================== --- james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java (original) +++ james/server/trunk/src/java/org/apache/james/userrepository/UsersLDAPRepository.java Fri Oct 6 07:42:13 2006 @@ -25,13 +25,9 @@ import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; -import org.apache.avalon.framework.context.Context; -import org.apache.avalon.framework.context.ContextException; -import org.apache.avalon.framework.context.Contextualizable; import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.service.Serviceable; -import org.apache.james.Constants; import org.apache.james.services.User; import org.apache.james.services.UsersRepository; @@ -62,7 +58,7 @@ */ public class UsersLDAPRepository extends AbstractLogEnabled - implements UsersRepository, Serviceable, Configurable, Contextualizable, Initializable{ + implements UsersRepository, Serviceable, Configurable, Initializable{ private DirContext ctx; @@ -85,14 +81,6 @@ private String passwordAttr; /** - * @see org.apache.avalon.framework.context.Contextualizable#contextualize(Context) - */ - public void contextualize(Context context) - throws ContextException { - usersDomain = (String)context.get(Constants.DEFAULT_DOMAIN); - } - - /** * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager) */ public void service(ServiceManager compMgr) { @@ -106,6 +94,7 @@ throws ConfigurationException { LDAPHost = conf.getChild("LDAPServer").getValue(); + usersDomain = conf.getChild("domain").getValue("localhost"); rootNodeDN = conf.getChild("LDAPRoot").getValue(); serverRDN = conf.getChild("ThisServerRDN").getValue(); mailAddressAttr @@ -741,10 +730,6 @@ //System.out.println("Problem counting users. "); } return result; - } - - public String getDomains() { - return usersDomain; } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]