You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2007/05/29 04:28:47 UTC
svn commit: r542379 - in /directory/apacheds/trunk:
core/src/main/java/org/apache/directory/server/core/configuration/
protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/
Author: erodriguez
Date: Mon May 28 19:28:46 2007
New Revision: 542379
URL: http://svn.apache.org/viewvc?view=rev&rev=542379
Log:
Changes to remove core dependency from protocol-shared:
o Added new ServiceConfigurationException to remove dependency on core ConfigurationException.
o Moved port number validation from ConfigurationUtil to ServiceConfiguration.
o Modified ServiceConfiguration to not extend core Configuration.
Added:
directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfigurationException.java (with props)
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java
directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java?view=diff&rev=542379&r1=542378&r2=542379
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java Mon May 28 19:28:46 2007
@@ -121,19 +121,6 @@
}
- /**
- * Throws a {@link ConfigurationException} if the specified port number
- * is out of range.
- */
- public static void validatePortNumber( int port )
- {
- if ( port < 0 || port > 65535 )
- {
- throw new ConfigurationException( "Invalid port number: " + port );
- }
- }
-
-
private ConfigurationUtil()
{
}
Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java?view=diff&rev=542379&r1=542378&r2=542379
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java Mon May 28 19:28:46 2007
@@ -21,13 +21,9 @@
import java.util.Dictionary;
-import java.util.Hashtable;
import javax.naming.spi.InitialContextFactory;
-import org.apache.directory.server.core.configuration.Configuration;
-import org.apache.directory.server.core.configuration.ConfigurationUtil;
-
/**
* Base class shared by all protocol providers for configuration.
@@ -35,7 +31,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public abstract class ServiceConfiguration extends Configuration
+public abstract class ServiceConfiguration
{
/** The prop key const for the port. */
public static final String IP_PORT_KEY = "ipPort";
@@ -319,7 +315,7 @@
*/
public void setIpPort( int ipPort )
{
- ConfigurationUtil.validatePortNumber( ipPort );
+ validatePortNumber( ipPort );
this.ipPort = ipPort;
}
@@ -360,11 +356,15 @@
}
- public Hashtable<String, Object> toJndiEnvironment()
+ /**
+ * Throws a {@link ServiceConfigurationException} if the specified port number
+ * is out of range.
+ */
+ protected void validatePortNumber( int port )
{
- Hashtable<String, Object> env = new Hashtable<String, Object>();
- env.put( JNDI_KEY, this );
-
- return env;
+ if ( port < 0 || port > 65535 )
+ {
+ throw new ServiceConfigurationException( "Invalid port number: " + port );
+ }
}
}
Added: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfigurationException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfigurationException.java?view=auto&rev=542379
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfigurationException.java (added)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfigurationException.java Mon May 28 19:28:46 2007
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.directory.server.protocol.shared;
+
+
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ServiceConfigurationException extends RuntimeException
+{
+ private static final long serialVersionUID = 8298096524637031225L;
+
+
+ /**
+ * Creates a new instance of ServiceConfigurationException.
+ */
+ public ServiceConfigurationException()
+ {
+ super();
+ }
+
+
+ /**
+ * Creates a new instance of ServiceConfigurationException.
+ *
+ * @param message
+ * @param cause
+ */
+ public ServiceConfigurationException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+
+ /**
+ * Creates a new instance of ServiceConfigurationException.
+ *
+ * @param message
+ */
+ public ServiceConfigurationException( String message )
+ {
+ super( message );
+ }
+
+
+ /**
+ * Creates a new instance of ServiceConfigurationException.
+ *
+ * @param cause
+ */
+ public ServiceConfigurationException( Throwable cause )
+ {
+ super( cause );
+ }
+}
Propchange: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfigurationException.java
------------------------------------------------------------------------------
svn:eol-style = native