dlr 01/08/15 14:19:31
Modified: src/core/java/org/apache/fulcrum BaseService.java
BaseServiceBroker.java
BaseUnicastRemoteService.java Service.java
ServiceBroker.java ServiceManager.java
src/services/java/org/apache/fulcrum/velocity
TurbineVelocityService.java
src/services/java/org/apache/fulcrum/xmlrpc
TurbineXmlRpcService.java
Log:
Switched from Velocity's deprecated Configuration class to Commons
ExtendedProperties.
Revision Changes Path
1.7 +5 -6
jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseService.java
Index: BaseService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseService.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -u -r1.6 -r1.7
--- BaseService.java 2001/08/10 11:46:22 1.6
+++ BaseService.java 2001/08/15 21:19:31 1.7
@@ -56,10 +56,9 @@
import java.util.Properties;
import java.util.List;
+
+import org.apache.commons.collections.ExtendedProperties;
import org.apache.log4j.Category;
-//!! this must go away we want to use a configuration
-// interface.
-import org.apache.velocity.runtime.configuration.Configuration;
/**
* This class is a generic implementation of <code>Service</code>.
@@ -69,7 +68,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Leonard Richardson</a>
- * @version $Id: BaseService.java,v 1.6 2001/08/10 11:46:22 knielsen Exp $
+ * @version $Id: BaseService.java,v 1.7 2001/08/15 21:19:31 dlr Exp $
*/
public abstract class BaseService
implements Service
@@ -94,7 +93,7 @@
/**
* Configuration for this service.
*/
- protected Configuration configuration;
+ protected ExtendedProperties configuration;
/**
* The name of this Service.
@@ -214,7 +213,7 @@
*
* @return The Configuration of this Service.
*/
- public Configuration getConfiguration()
+ public ExtendedProperties getConfiguration()
{
if (name == null)
{
1.5 +12 -14
jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseServiceBroker.java
Index: BaseServiceBroker.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseServiceBroker.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- BaseServiceBroker.java 2001/08/10 11:46:22 1.4
+++ BaseServiceBroker.java 2001/08/15 21:19:31 1.5
@@ -65,10 +65,8 @@
import java.util.Properties;
import java.util.Stack;
import org.apache.fulcrum.ServiceException;
+import org.apache.commons.collections.ExtendedProperties;
import org.apache.log4j.Category;
-//!! this has to go away. we want to use a Configuration
-// interface.
-import org.apache.velocity.runtime.configuration.Configuration;
// NOTE:
// initClass is taking the name of the service now not
@@ -85,8 +83,8 @@
* <li>Maintaining service name to class name mapping, allowing
* plugable service implementations.</li>
*
- * <li>Providing <code>Services</code> with a <code>Configuration</code>
- * based on system wide configuration mechanism.</li>
+ * <li>Providing <code>Services</code> with a configuration based on
+ * system wide configuration mechanism.</li>
*
* </ul>
*
@@ -94,14 +92,14 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: BaseServiceBroker.java,v 1.4 2001/08/10 11:46:22 knielsen Exp $
+ * @version $Id: BaseServiceBroker.java,v 1.5 2001/08/15 21:19:31 dlr Exp $
*/
public abstract class BaseServiceBroker implements ServiceBroker
{
/**
* Mapping of Service names to class names.
*/
- protected Configuration mapping = new Configuration();
+ protected ExtendedProperties mapping = new ExtendedProperties();
/**
* A repository of Service instances.
@@ -113,7 +111,7 @@
* The configuration should be set by the application
* in which the services framework is running.
*/
- protected Configuration configuration;
+ protected ExtendedProperties configuration;
/**
* A prefix for <code>Service</code> properties in
@@ -176,9 +174,9 @@
* about all services in the care of this service
* manager.
*
- * @param Configuration
+ * @param configuration Broker configuration.
*/
- public void setConfiguration(Configuration configuration)
+ public void setConfiguration(ExtendedProperties configuration)
{
this.configuration = configuration;
}
@@ -186,9 +184,9 @@
/**
* Get the configuration for this service manager.
*
- * @return Configuration
+ * @return Broker configuration.
*/
- public Configuration getConfiguration()
+ public ExtendedProperties getConfiguration()
{
return configuration;
}
@@ -744,11 +742,11 @@
}
/**
- * Returns the Configuration for the specified service.
+ * Returns the configuration for the specified service.
*
* @param name The name of the service.
*/
- public Configuration getConfiguration( String name )
+ public ExtendedProperties getConfiguration( String name )
{
return configuration.subset(SERVICE_PREFIX + name);
}
1.4 +3 -3
jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseUnicastRemoteService.java
Index: BaseUnicastRemoteService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/BaseUnicastRemoteService.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- BaseUnicastRemoteService.java 2001/08/10 11:46:22 1.3
+++ BaseUnicastRemoteService.java 2001/08/15 21:19:31 1.4
@@ -56,8 +56,8 @@
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
+import org.apache.commons.collections.ExtendedProperties;
import org.apache.log4j.Category;
-import org.apache.velocity.runtime.configuration.Configuration;
/**
* A base implementation of an {@link java.rmi.server.UnicastRemoteObject}
@@ -69,7 +69,7 @@
extends UnicastRemoteObject
implements Service
{
- protected Configuration configuration;
+ protected ExtendedProperties configuration;
private boolean isInitialized;
private String name;
private ServiceBroker serviceBroker;
@@ -87,7 +87,7 @@
*
* @return The configuration of this service.
*/
- public Configuration getConfiguration()
+ public ExtendedProperties getConfiguration()
{
if (name == null)
{
1.8 +3 -3
jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/Service.java
Index: Service.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/Service.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -u -r1.7 -r1.8
--- Service.java 2001/08/10 11:46:22 1.7
+++ Service.java 2001/08/15 21:19:31 1.8
@@ -54,8 +54,8 @@
* <http://www.apache.org/>.
*/
+import org.apache.commons.collections.ExtendedProperties;
import org.apache.log4j.Category;
-import org.apache.velocity.runtime.configuration.Configuration;
/**
* <code>Services</code> are <code>Initables</code> that have a name,
@@ -68,7 +68,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Leonard Richardson</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: Service.java,v 1.7 2001/08/10 11:46:22 knielsen Exp $
+ * @version $Id: Service.java,v 1.8 2001/08/15 21:19:31 dlr Exp $
*/
public interface Service
{
@@ -156,7 +156,7 @@
*
* @return The Configuration of this Service.
*/
- public Configuration getConfiguration();
+ public ExtendedProperties getConfiguration();
/**
* Given a relative paths, gets the real path.
1.3 +4 -3
jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/ServiceBroker.java
Index: ServiceBroker.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/ServiceBroker.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -u -r1.2 -r1.3
--- ServiceBroker.java 2001/08/10 11:46:22 1.2
+++ ServiceBroker.java 2001/08/15 21:19:31 1.3
@@ -56,8 +56,9 @@
import java.util.List;
import java.util.Hashtable;
+
+import org.apache.commons.collections.ExtendedProperties;
import org.apache.log4j.Category;
-import org.apache.velocity.runtime.configuration.Configuration;
/**
* Classes that implement this interface can act as a broker for
@@ -80,7 +81,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: ServiceBroker.java,v 1.2 2001/08/10 11:46:22 knielsen Exp $
+ * @version $Id: ServiceBroker.java,v 1.3 2001/08/15 21:19:31 dlr Exp $
*/
public interface ServiceBroker
{
@@ -168,7 +169,7 @@
* @param name The name of the service.
* @return Configuration of the requested service.
*/
- public Configuration getConfiguration( String name );
+ public ExtendedProperties getConfiguration( String name );
/**
* Set an object for use in the services.
1.3 +6 -6
jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/ServiceManager.java
Index: ServiceManager.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/core/java/org/apache/fulcrum/ServiceManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -u -r1.2 -r1.3
--- ServiceManager.java 2001/08/10 11:46:22 1.2
+++ ServiceManager.java 2001/08/15 21:19:31 1.3
@@ -54,8 +54,8 @@
* <http://www.apache.org/>.
*/
+import org.apache.commons.collections.ExtendedProperties;
import org.apache.log4j.Category;
-import org.apache.velocity.runtime.configuration.Configuration;
/**
* Classes that implement this interface can act as a mamager for
@@ -66,7 +66,7 @@
* of the manager.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ilkka Priha</a>
- * @version $Id: ServiceManager.java,v 1.2 2001/08/10 11:46:22 knielsen Exp $
+ * @version $Id: ServiceManager.java,v 1.3 2001/08/15 21:19:31 dlr Exp $
*/
public interface ServiceManager
extends ServiceBroker
@@ -80,9 +80,9 @@
/**
* Get the configuration for this service manager.
*
- * @return Configuration
+ * @return Manager configuration.
*/
- public Configuration getConfiguration();
+ public ExtendedProperties getConfiguration();
/**
* Set the configuration object for the services broker.
@@ -90,9 +90,9 @@
* about all services in the care of this service
* manager.
*
- * @param Configuration
+ * @param configuration Manager configuration.
*/
- public void setConfiguration(Configuration configuration);
+ public void setConfiguration(ExtendedProperties configuration);
/**
* Set the application root.
1.5 +4 -3
jakarta-turbine-fulcrum/src/services/java/org/apache/fulcrum/velocity/TurbineVelocityService.java
Index: TurbineVelocityService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/services/java/org/apache/fulcrum/velocity/TurbineVelocityService.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- TurbineVelocityService.java 2001/08/10 11:46:25 1.4
+++ TurbineVelocityService.java 2001/08/15 21:19:31 1.5
@@ -91,7 +91,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Sean Legassick</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: TurbineVelocityService.java,v 1.4 2001/08/10 11:46:25 knielsen Exp
$
+ * @version $Id: TurbineVelocityService.java,v 1.5 2001/08/15 21:19:31 dlr Exp $
*/
public class TurbineVelocityService
extends BaseTemplateEngineService
@@ -383,7 +383,8 @@
}
else if (path.startsWith("absolute:"))
{
- path = path.substring ("absolute:".length(), path.length());
+ path = path.substring ("absolute:".length(),
+ path.length());
}
else if (!path.startsWith("jar:"))
{
@@ -398,7 +399,7 @@
try
{
- Velocity.setConfiguration(getConfiguration());
+ Velocity.setExtendedProperties(getConfiguration());
Velocity.init();
}
catch(Exception e)
1.4 +10 -6
jakarta-turbine-fulcrum/src/services/java/org/apache/fulcrum/xmlrpc/TurbineXmlRpcService.java
Index: TurbineXmlRpcService.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/services/java/org/apache/fulcrum/xmlrpc/TurbineXmlRpcService.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- TurbineXmlRpcService.java 2001/08/10 11:46:25 1.3
+++ TurbineXmlRpcService.java 2001/08/15 21:19:31 1.4
@@ -61,6 +61,7 @@
import java.net.URL;
import java.util.Iterator;
import java.util.Vector;
+
import org.apache.fulcrum.BaseService;
import org.apache.fulcrum.InitializationException;
import org.apache.fulcrum.ServiceBroker;
@@ -74,7 +75,7 @@
import org.apache.xmlrpc.secure.SecureWebServer;
import org.apache.xmlrpc.secure.SecurityTool;
-import org.apache.velocity.runtime.configuration.Configuration;
+import org.apache.commons.collections.ExtendedProperties;
/**
* This is a service which will make an xml-rpc call to a remote
@@ -96,7 +97,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: TurbineXmlRpcService.java,v 1.3 2001/08/10 11:46:25 knielsen Exp $
+ * @version $Id: TurbineXmlRpcService.java,v 1.4 2001/08/15 21:19:31 dlr Exp $
*/
public class TurbineXmlRpcService
extends BaseService
@@ -133,7 +134,7 @@
// and the URL https connection handler that is
// used in XmlRpcClient.
- Configuration secureServerOptions =
+ ExtendedProperties secureServerOptions =
getConfiguration().subset("secure.server.option");
Iterator i = secureServerOptions.getKeys();
@@ -173,7 +174,8 @@
}
// Turn on paranoia for the webserver if requested.
- boolean stateOfParanoia = getConfiguration().getBoolean("paranoid",
false);
+ boolean stateOfParanoia =
+ getConfiguration().getBoolean("paranoid", false);
if (stateOfParanoia)
{
@@ -188,7 +190,8 @@
// Set the list of clients that can connect
// to the xmlrpc server. The accepted client list
// will only be consulted if we are paranoid.
- Vector acceptedClients =
getConfiguration().getVector("acceptClient");
+ Vector acceptedClients =
+ getConfiguration().getVector("acceptClient");
for (int i = 0; i < acceptedClients.size(); i++)
{
@@ -205,7 +208,8 @@
// Set the list of clients that can connect
// to the xmlrpc server. The denied client list
// will only be consulted if we are paranoid.
- Vector deniedClients = getConfiguration().getVector("denyClient");
+ Vector deniedClients =
+ getConfiguration().getVector("denyClient");
for (int i = 0; i < deniedClients.size(); i++)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]