FAQ
thorhauer 01/03/01 11:10:15

Modified: src/java/org/apache/turbine/services/xmlrpc
TurbineXmlRpcService.java
Log:
adding ServletConfig to the init signature so that xml rpc service is available
when servlet engine starts

Revision Changes Path
1.13 +37 -33 jakarta-turbine/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java

Index: TurbineXmlRpcService.java
===================================================================
RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TurbineXmlRpcService.java 2001/02/24 23:29:14 1.12
+++ TurbineXmlRpcService.java 2001/03/01 19:10:12 1.13
@@ -81,6 +81,10 @@
import helma.xmlrpc.XmlRpcClient;
import helma.xmlrpc.XmlRpcException;

+// Java Servlet Classes
+import javax.servlet.*;
+import javax.servlet.http.*;
+
/**
* This is a service which will make an xml-rpc call to a remote
* server.
@@ -98,7 +102,7 @@
* @author <a href="mailto:magnus@handtolvur.is">Magnús Þór Torfason</a>
* @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
* @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
- * @version $Id: TurbineXmlRpcService.java,v 1.12 2001/02/24 23:29:14 jvanzyl Exp $
+ * @version $Id: TurbineXmlRpcService.java,v 1.13 2001/03/01 19:10:12 thorhauer Exp $
*/
public class TurbineXmlRpcService
extends TurbineBaseService
@@ -123,11 +127,11 @@
/**
* This function initializes the XmlRpcService.
*/
- public void init() throws InitializationException
+ public void init(ServletConfig config) throws InitializationException
{
try
{
- ResourceService resources =
+ ResourceService resources =
((TurbineServices)TurbineServices.getInstance()).
getResources(getName());

@@ -135,16 +139,16 @@

// Set the port for the service
int port = resources.getInt("port", 0);
-
+
if(port != 0)
{
webserver = new WebServer(port);
- }
+ }

// Set the XML driver to the correct SAX parser class
String saxParserClass = resources.getString("parser",
"org.apache.xerces.parsers.SAXParser");
-
+
XmlRpc.setDriver ( saxParserClass );

// Check if there are any handlers to register at startup
@@ -156,12 +160,12 @@
String handlerClass = resources.getString(handler);
registerHandler(handlerName, handlerClass);
}
-
+
/*
* Turn on paranoia for the webserver if requested.
*/
boolean stateOfParanoia = resources.getBoolean("paranoid", false);
-
+
if (stateOfParanoia)
{
webserver.setParanoid(stateOfParanoia);
@@ -172,43 +176,43 @@
* are in a state of paranoia as they will just
* be ignored so there's no point in setting them.
*/
-
+
/*
* 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 = resources.getVector("acceptClient");
-
+
for (int i = 0; i < acceptedClients.size(); i++)
{
String acceptClient = (String) acceptedClients.get(i);
-
+
if (acceptClient != null && ! acceptClient.equals(""))
{
webserver.acceptClient(acceptClient);
Log.info(XmlRpcService.SERVICE_NAME + ": Accepting client -> " + acceptClient);
}
}
-
+
/*
* 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 = resources.getVector("denyClient");
-
+
for (int i = 0; i < deniedClients.size(); i++)
{
String denyClient = (String) deniedClients.get(i);
-
+
if (denyClient != null && ! denyClient.equals(""))
{
webserver.denyClient(denyClient);
Log.info(XmlRpcService.SERVICE_NAME + ": Denying client -> " + denyClient);
}
}
- }
+ }
}
catch (Exception e)
{
@@ -249,7 +253,7 @@
{
webserver.addHandler(handlerName, handler);
}
-
+
server.addHandler(handlerName, handler);
}

@@ -269,12 +273,12 @@
try
{
Object handler = Class.forName(handlerClass).newInstance();
-
+
if(webserver != null)
{
webserver.addHandler(handlerName,handler);
}
-
+
server.addHandler(handlerName,handler);
}
// those two errors must be passed to the VM
@@ -286,10 +290,10 @@
{
throw t;
}
-
- catch( Throwable t )
+
+ catch( Throwable t )
{
- throw new TurbineException("Failed to instantiate "+handlerClass, t);
+ throw new TurbineException("Failed to instantiate "+handlerClass, t);
}
}

@@ -303,8 +307,8 @@
if(webserver != null)
{
webserver.removeHandler(handlerName);
- }
-
+ }
+
server.removeHandler(handlerName);
}

@@ -337,7 +341,7 @@
* @param password the password given by user.
* @return the response body that needs to be sent to the client.
*/
- public byte[] handleRequest(InputStream is, String user, String password)
+ public byte[] handleRequest(InputStream is, String user, String password)
{
return server.execute(is, user, password);
}
@@ -433,7 +437,7 @@
}

/**
- * Switch client filtering on/off.
+ * Switch client filtering on/off.
* @see acceptClient(java.lang.String)
* @see denyClient(java.lang.String)
*/
@@ -443,10 +447,10 @@
}

/**
- * Add an IP address to the list of accepted clients. The parameter can
- * contain '*' as wildcard character, e.g. "192.168.*.*". You must
+ * Add an IP address to the list of accepted clients. The parameter can
+ * contain '*' as wildcard character, e.g. "192.168.*.*". You must
* call setParanoid(true) in order for this to have
- * any effect.
+ * any effect.
*
* @see denyClient(java.lang.String)
* @see setParanoid(boolean)
@@ -455,11 +459,11 @@
{
webserver.acceptClient(address);
}
-
+
/**
- * Add an IP address to the list of denied clients. The parameter can
- * contain '*' as wildcard character, e.g. "192.168.*.*". You must call
- * setParanoid(true) in order for this to have any effect.
+ * Add an IP address to the list of denied clients. The parameter can
+ * contain '*' as wildcard character, e.g. "192.168.*.*". You must call
+ * setParanoid(true) in order for this to have any effect.
*
* @see acceptClient(java.lang.String)
* @see setParanoid(boolean)
@@ -467,5 +471,5 @@
public void denyClient(String address)
{
webserver.denyClient(address);
- }
+ }
}

Search Discussions

  • Dlr at Mar 16, 2001 at 6:19 pm
    dlr 01/03/16 10:19:15

    Modified: src/java/org/apache/turbine/services/xmlrpc
    TurbineXmlRpcService.java
    Log:
    Ilkka Priha wrote:
    >
    The XmlRpc service seems to leave some socket listeners/non-daemon threads
    running when shutting down services.
    Implement Initable's shutdown() interface to shut down the XML RPC web
    server thread.

    Revision Changes Path
    1.17 +19 -1 jakarta-turbine/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java

    Index: TurbineXmlRpcService.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java,v
    retrieving revision 1.16
    retrieving revision 1.17
    diff -u -r1.16 -r1.17
    --- TurbineXmlRpcService.java 2001/03/06 22:40:44 1.16
    +++ TurbineXmlRpcService.java 2001/03/16 18:19:12 1.17
    @@ -101,7 +101,8 @@
    * @author <a href="mailto:magnus@handtolvur.is">Magnús Þór Torfason</a>
    * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    - * @version $Id: TurbineXmlRpcService.java,v 1.16 2001/03/06 22:40:44 chrise Exp $
    + * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
    + * @version $Id: TurbineXmlRpcService.java,v 1.17 2001/03/16 18:19:12 dlr Exp $
    */
    public class TurbineXmlRpcService
    extends TurbineBaseService
    @@ -440,6 +441,9 @@

    /**
    * Switch client filtering on/off.
    + *
    + * @param state Whether to filter clients.
    + *
    * @see #acceptClient(java.lang.String)
    * @see #denyClient(java.lang.String)
    */
    @@ -454,6 +458,8 @@
    * call setParanoid(true) in order for this to have
    * any effect.
    *
    + * @param address The address to add to the list.
    + *
    * @see #denyClient(java.lang.String)
    * @see #setParanoid(boolean)
    */
    @@ -467,11 +473,23 @@
    * contain '*' as wildcard character, e.g. "192.168.*.*". You must call
    * setParanoid(true) in order for this to have any effect.
    *
    + * @param address The address to add to the list.
    + *
    * @see #acceptClient(java.lang.String)
    * @see #setParanoid(boolean)
    */
    public void denyClient(String address)
    {
    webserver.denyClient(address);
    + }
    +
    + /**
    + * Shuts down this service, stopping running threads.
    + */
    + public void shutdown()
    + {
    + // Stop the XML RPC server.
    + webserver.shutdown();
    + setInit(false);
    }
    }




    ---------------------------------------------------------------------
    To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
  • Dlr at Mar 18, 2001 at 2:01 am
    dlr 01/03/17 18:01:38

    Modified: src/java/org/apache/turbine/services/xmlrpc
    TurbineXmlRpcService.java
    Log:
    * Imported classes necessary for a socket connection.
    * Removed unused constructor.
    * Added port instance variable, set during early initialization.
    * Broke long lines at 80 columns.
    * Added Ilkka's suggested hack to break the endless I/O wait in
    helma.xmlrpc.WebServer's call to ServerSocket.accept() (which I've
    submitted a patch to fix).

    Revision Changes Path
    1.18 +29 -15 jakarta-turbine/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java

    Index: TurbineXmlRpcService.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java,v
    retrieving revision 1.17
    retrieving revision 1.18
    diff -u -r1.17 -r1.18
    --- TurbineXmlRpcService.java 2001/03/16 18:19:12 1.17
    +++ TurbineXmlRpcService.java 2001/03/18 02:01:38 1.18
    @@ -61,6 +61,8 @@
    import java.io.InputStream;
    import java.io.IOException;
    import java.net.URL;
    +import java.net.InetAddress;
    +import java.net.Socket;
    import java.net.ConnectException;

    // Turbine classes.
    @@ -102,7 +104,7 @@
    * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
    - * @version $Id: TurbineXmlRpcService.java,v 1.17 2001/03/16 18:19:12 dlr Exp $
    + * @version $Id: TurbineXmlRpcService.java,v 1.18 2001/03/18 02:01:38 dlr Exp $
    */
    public class TurbineXmlRpcService
    extends TurbineBaseService
    @@ -117,12 +119,8 @@
    /** The xmlrpc client. */
    private XmlRpcClient client = null;

    - /**
    - * Constructor.
    - */
    - public TurbineXmlRpcService()
    - {
    - }
    + /** The port to listen on. */
    + private int port = 0;

    /**
    * This function initializes the XmlRpcService.
    @@ -138,7 +136,7 @@
    server = new XmlRpcServer();

    // Set the port for the service
    - int port = resources.getInt("port", 0);
    + port = resources.getInt("port", 0);

    if(port != 0)
    {
    @@ -169,7 +167,8 @@
    if (stateOfParanoia)
    {
    webserver.setParanoid(stateOfParanoia);
    - Log.info(XmlRpcService.SERVICE_NAME + ": In a state of paranoia.");
    + Log.info(XmlRpcService.SERVICE_NAME +
    + ": In a state of paranoia.");

    /*
    * Only set the accept/deny client lists if we
    @@ -191,7 +190,8 @@
    if (acceptClient != null && ! acceptClient.equals(""))
    {
    webserver.acceptClient(acceptClient);
    - Log.info(XmlRpcService.SERVICE_NAME + ": Accepting client -> " + acceptClient);
    + Log.info(XmlRpcService.SERVICE_NAME +
    + ": Accepting client -> " + acceptClient);
    }
    }

    @@ -209,14 +209,16 @@
    if (denyClient != null && ! denyClient.equals(""))
    {
    webserver.denyClient(denyClient);
    - Log.info(XmlRpcService.SERVICE_NAME + ": Denying client -> " + denyClient);
    + Log.info(XmlRpcService.SERVICE_NAME +
    + ": Denying client -> " + denyClient);
    }
    }
    }
    }
    catch (Exception e)
    {
    - throw new InitializationException("XMLRPCService failed to initialize", e);
    + throw new InitializationException
    + ("XMLRPCService failed to initialize", e);
    }

    setInit(true);
    @@ -265,7 +267,7 @@
    *
    * @param handlerName The name the handler is registered under.
    * @param handlerClass The name of the class to use as a handler.
    - * @exception TurbineException encapsulates any exceptions thrown while processing.
    + * @exception TurbineException Couldn't instantiate handler.
    */
    public void registerHandler(String handlerName, String handlerClass)
    throws TurbineException
    @@ -293,7 +295,8 @@

    catch( Throwable t )
    {
    - throw new TurbineException("Failed to instantiate "+handlerClass, t);
    + throw new TurbineException
    + ("Failed to instantiate " + handlerClass, t);
    }
    }

    @@ -488,8 +491,19 @@
    */
    public void shutdown()
    {
    - // Stop the XML RPC server.
    + // Stop the XML RPC server. helma.xmlrpc.WebServer blocks in a call to
    + // ServerSocket.accept() until a socket connection is made.
    webserver.shutdown();
    + try
    + {
    + Socket interrupt = new Socket(InetAddress.getLocalHost(), port);
    + interrupt.close();
    + }
    + catch (Exception ignored)
    + {
    + // Remotely possible we're leaving an open listener socket around.
    + }
    +
    setInit(false);
    }
    }




    ---------------------------------------------------------------------
    To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
  • Jvanzyl at Mar 18, 2001 at 4:58 pm
    jvanzyl 01/03/18 08:58:23

    Modified: src/java/org/apache/turbine/modules/actions
    InitContextsAction.java
    src/java/org/apache/turbine/services BaseServiceBroker.java
    TurbineServices.java
    src/java/org/apache/turbine/services/logging
    PropertiesLoggingConfig.java
    src/java/org/apache/turbine/services/naming
    TurbineNamingService.java
    src/java/org/apache/turbine/services/pull
    TurbinePullService.java
    src/java/org/apache/turbine/services/resources
    ResourceService.java TurbineResourceService.java
    TurbineResources.java
    src/java/org/apache/turbine/services/xmlrpc
    TurbineXmlRpcService.java
    Log:
    - changes made due to the use of the Configuration class. documented
    in the change log in the xdocs directory.

    Revision Changes Path
    1.4 +4 -4 jakarta-turbine/src/java/org/apache/turbine/modules/actions/InitContextsAction.java

    Index: InitContextsAction.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/modules/actions/InitContextsAction.java,v
    retrieving revision 1.3
    retrieving revision 1.4
    diff -u -r1.3 -r1.4
    --- InitContextsAction.java 2001/03/06 04:50:43 1.3
    +++ InitContextsAction.java 2001/03/18 16:58:15 1.4
    @@ -72,7 +72,7 @@
    * Used to initialize JNDI contexts.
    *
    * @author <a href="mailto:greg@shwoop.com">Greg Ritter</a>
    - * @version $Id: InitContextsAction.java,v 1.3 2001/03/06 04:50:43 chrise Exp $
    + * @version $Id: InitContextsAction.java,v 1.4 2001/03/18 16:58:15 jvanzyl Exp $
    */
    public class InitContextsAction extends Action
    {
    @@ -94,11 +94,11 @@
    // used by the InitialContext class to create a new context
    // instance.

    - Enumeration contextKeys = TurbineResources.getKeys("context.");
    + Iterator contextKeys = TurbineResources.getKeys("context.");
    Hashtable contextPropsList = new Hashtable();
    - while( contextKeys.hasMoreElements() )
    + while( contextKeys.hasNext() )
    {
    - String key = (String) contextKeys.nextElement();
    + String key = (String) contextKeys.next();
    int start = key.indexOf(".") + 1;
    int end = key.indexOf(".", start);
    String contextName = key.substring(start, end);



    1.19 +12 -9 jakarta-turbine/src/java/org/apache/turbine/services/BaseServiceBroker.java

    Index: BaseServiceBroker.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/BaseServiceBroker.java,v
    retrieving revision 1.18
    retrieving revision 1.19
    diff -u -r1.18 -r1.19
    --- BaseServiceBroker.java 2001/03/06 06:11:45 1.18
    +++ BaseServiceBroker.java 2001/03/18 16:58:16 1.19
    @@ -57,6 +57,8 @@
    // Java stuff.
    import java.util.*;

    +import org.apache.velocity.runtime.configuration.Configuration;
    +
    /**
    * A generic implementation of a <code>ServiceBroker</code>.
    *
    @@ -75,14 +77,15 @@
    *
    * @author <a href="mailto:burton@apache.org">Kevin Burton</a>
    * @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
    - * @version $Id: BaseServiceBroker.java,v 1.18 2001/03/06 06:11:45 chrise Exp $
    + * @version $Id: BaseServiceBroker.java,v 1.19 2001/03/18 16:58:16 jvanzyl Exp $
    */
    public class BaseServiceBroker
    extends BaseInitableBroker
    implements ServiceBroker
    {
    /** Mapping of Service names to class names. */
    - protected Hashtable mapping = new Hashtable();
    + //protected Hashtable mapping = new Hashtable();
    + protected Configuration mapping = new Configuration();

    /** A repository of Service instances. */
    protected Hashtable services = new Hashtable();
    @@ -152,11 +155,11 @@
    throws InstantiationException, InitializationException
    {
    notice("Initializing all services using: " + data.getClass().getName());
    - Enumeration names = mapping.keys();
    + Iterator names = mapping.getKeys();
    // throw exceptions
    if(report)
    {
    - while(names.hasMoreElements())
    + while(names.hasNext())
    {
    doInitService(data, names);
    }
    @@ -164,7 +167,7 @@
    // eat exceptions
    else
    {
    - while(names.hasMoreElements())
    + while(names.hasNext())
    {
    try
    {
    @@ -189,18 +192,18 @@
    * Internal utility method for use in initServices()
    * to prevent duplication of code.
    */
    - private void doInitService(Object data, Enumeration names)
    + private void doInitService(Object data, Iterator names)
    throws InstantiationException, InitializationException
    {
    - String name = (String)names.nextElement();
    + String name = (String)names.next();
    notice("Initializing service (early): " + name);

    // Make sure the service has it's name and broker
    // reference set before initialization.
    getServiceInstance(name);
    -
    +
    // Perform early initialization.
    - initClass((String)mapping.get(name), data);
    + initClass(mapping.getString(name), data);
    }

    /**



    1.24 +34 -23 jakarta-turbine/src/java/org/apache/turbine/services/TurbineServices.java

    Index: TurbineServices.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/TurbineServices.java,v
    retrieving revision 1.23
    retrieving revision 1.24
    diff -u -r1.23 -r1.24
    --- TurbineServices.java 2001/03/09 15:26:57 1.23
    +++ TurbineServices.java 2001/03/18 16:58:16 1.24
    @@ -59,16 +59,14 @@
    import java.util.*;
    import javax.servlet.ServletConfig;

    -// Apache JServ Utility Classes
    -import org.apache.turbine.util.Configurations;
    -import org.apache.turbine.util.ExtendedProperties;
    -
    // Turbine Utility Classes
    import org.apache.turbine.util.*;
    import org.apache.turbine.services.resources.ResourceService;
    import org.apache.turbine.services.resources.TurbineResources;
    import org.apache.turbine.services.logging.LoggingService;

    +import org.apache.velocity.runtime.configuration.Configuration;
    +
    /**
    * This is a singleton utility class that acts as a Services broker.
    *
    @@ -77,7 +75,7 @@
    * @author <a href="mailto:burton@apache.org">Kevin Burton</a>
    * @author <a href="mailto:krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    - * @version $Id: TurbineServices.java,v 1.23 2001/03/09 15:26:57 ilkka Exp $
    + * @version $Id: TurbineServices.java,v 1.24 2001/03/18 16:58:16 jvanzyl Exp $
    */
    public class TurbineServices
    extends BaseServiceBroker
    @@ -159,15 +157,6 @@
    }

    /**
    - * Creates mapping of Service names to class names.
    - * BaseServiceBroker knows no mappings.
    - */
    - public void initMapping(Hashtable mapping)
    - {
    - this.mapping = mapping;
    - }
    -
    - /**
    * Initialize the primary services (Logging and Resources).
    */
    public void initPrimaryServices(ServletConfig config)
    @@ -200,6 +189,15 @@
    }

    /**
    + * Creates mapping of Service names to class names.
    + * BaseServiceBroker knows no mappings.
    + */
    + public void initMapping(Configuration mapping)
    + {
    + this.mapping = mapping;
    + }
    +
    + /**
    * Creates a mapping between Service names and class names.
    *
    * The mapping is built according to settings present in
    @@ -219,17 +217,30 @@
    {
    int pref = SERVICE_PREFIX.length();
    int suff = CLASSNAME_SUFFIX.length();
    -
    - Enumeration keys = TurbineResources.getKeys();
    - while(keys.hasMoreElements())
    +
    + /*
    + * These keys returned in an order that corresponds
    + * to the order the services are listed in
    + * the TR.props.
    + *
    + * When the mapping is created we use a Configuration
    + * object to ensure that the we retain the order
    + * in which the order the keys are returned.
    + *
    + * There's no point in retrieving an ordered set
    + * of keys if they aren't kept in order :-)
    + */
    + Iterator keys = TurbineResources.getKeys();
    + while(keys.hasNext())
    {
    - String key = (String)keys.nextElement();
    + String key = (String)keys.next();
    if(key.startsWith(SERVICE_PREFIX) && key.endsWith(CLASSNAME_SUFFIX))
    {
    String serviceKey = key.substring(pref, key.length() - suff);
    notice ("Added Mapping for Service: " + serviceKey);
    - mapping.put(serviceKey,
    - TurbineResources.getString(key));
    +
    + if (! mapping.containsKey(serviceKey))
    + mapping.setProperty(serviceKey, TurbineResources.getString(key));
    }
    }
    }
    @@ -267,11 +278,11 @@
    {
    Properties properties = new Properties();

    - Enumeration keys = TurbineResources.getKeys(SERVICE_PREFIX + name + ".");
    + Iterator keys = TurbineResources.getKeys(SERVICE_PREFIX + name + ".");
    int pref = SERVICE_PREFIX.length() + name.length() + 1;
    - while(keys.hasMoreElements())
    + while(keys.hasNext())
    {
    - String key = (String)keys.nextElement();
    + String key = (String)keys.next();
    properties.put(key.substring(pref), TurbineResources.getString(key));
    }




    1.5 +4 -4 jakarta-turbine/src/java/org/apache/turbine/services/logging/PropertiesLoggingConfig.java

    Index: PropertiesLoggingConfig.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/logging/PropertiesLoggingConfig.java,v
    retrieving revision 1.4
    retrieving revision 1.5
    diff -u -r1.4 -r1.5
    --- PropertiesLoggingConfig.java 2001/03/06 06:12:27 1.4
    +++ PropertiesLoggingConfig.java 2001/03/18 16:58:17 1.5
    @@ -66,7 +66,7 @@
    * file.
    *
    * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
    - * @version $Id: PropertiesLoggingConfig.java,v 1.4 2001/03/06 06:12:27 chrise Exp $
    + * @version $Id: PropertiesLoggingConfig.java,v 1.5 2001/03/18 16:58:17 jvanzyl Exp $
    */
    public class PropertiesLoggingConfig implements LoggingConfig
    {
    @@ -114,11 +114,11 @@
    // Just get the resources for the particular facility that
    // we are interested in.
    ResourceService res = props.getResources(name);
    - Enumeration keys = res.getKeys();
    + Iterator keys = res.getKeys();

    - while (keys.hasMoreElements())
    + while (keys.hasNext())
    {
    - String key = (String) keys.nextElement();
    + String key = (String) keys.next();

    if (key.equals(LoggingConfig.CLASSNAME))
    {



    1.6 +4 -4 jakarta-turbine/src/java/org/apache/turbine/services/naming/TurbineNamingService.java

    Index: TurbineNamingService.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/naming/TurbineNamingService.java,v
    retrieving revision 1.5
    retrieving revision 1.6
    diff -u -r1.5 -r1.6
    --- TurbineNamingService.java 2001/03/06 06:12:34 1.5
    +++ TurbineNamingService.java 2001/03/18 16:58:18 1.6
    @@ -68,7 +68,7 @@
    * provides JNDI naming contexts.
    *
    * @author <a href="mailto:greg@shwoop.com">Greg Ritter</a>
    - * @version $Id: TurbineNamingService.java,v 1.5 2001/03/06 06:12:34 chrise Exp $
    + * @version $Id: TurbineNamingService.java,v 1.6 2001/03/18 16:58:18 jvanzyl Exp $
    */
    public class TurbineNamingService
    extends TurbineBaseService
    @@ -95,11 +95,11 @@
    try
    {
    org.apache.turbine.util.Log.info("Initializing JNDI contexts!");
    - Enumeration contextKeys = TurbineResources.getKeys("context.");
    + Iterator contextKeys = TurbineResources.getKeys("context.");
    Hashtable contextPropsList = new Hashtable();
    - while( contextKeys.hasMoreElements() )
    + while( contextKeys.hasNext() )
    {
    - String key = (String) contextKeys.nextElement();
    + String key = (String) contextKeys.next();
    int start = key.indexOf(".") + 1;
    int end = key.indexOf(".", start);
    String contextName = key.substring(start, end);



    1.12 +17 -11 jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePullService.java

    Index: TurbinePullService.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/pull/TurbinePullService.java,v
    retrieving revision 1.11
    retrieving revision 1.12
    diff -u -r1.11 -r1.12
    --- TurbinePullService.java 2001/03/06 06:12:37 1.11
    +++ TurbinePullService.java 2001/03/18 16:58:19 1.12
    @@ -70,6 +70,7 @@
    import org.apache.turbine.services.TurbineServices;
    import org.apache.turbine.services.pool.PoolService;
    import org.apache.turbine.services.pull.ApplicationTool;
    +import org.apache.turbine.services.resources.ResourceService;
    import org.apache.turbine.services.resources.TurbineResources;
    import org.apache.turbine.services.servlet.TurbineServlet;

    @@ -83,7 +84,7 @@
    *
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:sean@informage.net">Sean Legassick</a>
    - * @version $Id: TurbinePullService.java,v 1.11 2001/03/06 06:12:37 chrise Exp $
    + * @version $Id: TurbinePullService.java,v 1.12 2001/03/18 16:58:19 jvanzyl Exp $
    */
    public class TurbinePullService extends TurbineBaseService
    implements PullService
    @@ -285,19 +286,24 @@
    private List getTools(String keyPrefix)
    {
    List classes = new ArrayList();
    -
    +
    + ResourceService toolResources =
    + TurbineResources.getResources(keyPrefix);
    +
    /*
    - * We use the TurbineResource.getOrderedValues() to
    - * do all the dirty work for us :-)
    + * There might not be any tools for this prefix
    + * so return an empty list.
    */
    - List tools = TurbineResources.getOrderedValues(keyPrefix);
    - Iterator it = tools.iterator();
    + if (toolResources == null)
    + {
    + return classes;
    + }
    +
    + Iterator it = toolResources.getKeys();
    while (it.hasNext())
    {
    - String[] tool = (String[]) it.next();
    -
    - String toolName = tool[0];
    - String toolClassName = tool[1];
    + String toolName = (String) it.next();
    + String toolClassName = toolResources.getString(toolName);

    try
    {
    @@ -311,7 +317,7 @@
    */
    classes.add(new ToolData(toolName, toolClassName, toolClass));

    - Log.note("Instantiated tool class " + toolClassName
    + Log.info("Instantiated tool class " + toolClassName
    + " to add to the context as " + toolName);
    }
    catch (Exception e)



    1.9 +4 -39 jakarta-turbine/src/java/org/apache/turbine/services/resources/ResourceService.java

    Index: ResourceService.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/resources/ResourceService.java,v
    retrieving revision 1.8
    retrieving revision 1.9
    diff -u -r1.8 -r1.9
    --- ResourceService.java 2001/03/06 06:12:40 1.8
    +++ ResourceService.java 2001/03/18 16:58:20 1.9
    @@ -55,6 +55,7 @@
    */

    import java.util.Enumeration;
    +import java.util.Iterator;
    import java.util.Vector;

    import javax.servlet.ServletConfig;
    @@ -83,7 +84,7 @@
    * @author <a href="mailto:greg@shwoop.com">Greg Ritter</a>
    * @author <a href="mailto:luta.raphael@networks.vivendi.net">Raphaël Luta</a>
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    - * @version $Id: ResourceService.java,v 1.8 2001/03/06 06:12:40 chrise Exp $
    + * @version $Id: ResourceService.java,v 1.9 2001/03/18 16:58:20 jvanzyl Exp $
    */
    public interface ResourceService extends Service
    {
    @@ -150,25 +151,6 @@

    /**
    * The purpose of this method is to get the configuration resource
    - * with the given name as an Integer.
    - *
    - * @param name The resource name.
    - * @return The value of the resource as an Integer.
    - */
    - public Integer getInteger(String name);
    -
    - /**
    - * The purpose of this method is to get the configuration resource
    - * with the given name as an Integer, or a default value.
    - *
    - * @param name The resource name.
    - * @param def The default value of the resource.
    - * @return The value of the resource as an Integer.
    - */
    - public Integer getInteger(String name,int def);
    -
    - /**
    - * The purpose of this method is to get the configuration resource
    * with the given name as an integer.
    *
    * @param name The resource name.
    @@ -192,7 +174,7 @@
    *
    * @return An Enumeration with all the keys.
    */
    - public Enumeration getKeys();
    + public Iterator getKeys();

    /**
    * Get the list of the keys contained in the configuration
    @@ -201,7 +183,7 @@
    * @param prefix A String prefix to test against.
    * @return An Enumeration of keys that match the prefix.
    */
    - public Enumeration getKeys(String prefix);
    + public Iterator getKeys(String prefix);

    /**
    * The purpose of this method is to get the configuration resource
    @@ -277,21 +259,4 @@
    * @return A ResourceService providing the subset of configuration.
    */
    public ResourceService getResources(String prefix);
    -
    - /**
    - * This method does something special. If you have input like this:
    - * <p>
    - * foo.bar.1=blah blah blah
    - * <p>
    - * The prefix to look for would then be "foo" and it would return
    - * a Vector that contains an ordered set of String[]'s that contain two
    - * Strings. For example:
    - * <p>
    - * String[0] would have "bar" in it (with the prefix and number removed)
    - * String[1] would have "blah blah blah" in it
    - * <p>
    - * Not the most efficient, but it works and should only be executed during
    - * initialization.
    - */
    - public Vector getOrderedValues(String prefix);
    }



    1.29 +36 -255 jakarta-turbine/src/java/org/apache/turbine/services/resources/TurbineResourceService.java

    Index: TurbineResourceService.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/resources/TurbineResourceService.java,v
    retrieving revision 1.28
    retrieving revision 1.29
    diff -u -r1.28 -r1.29
    --- TurbineResourceService.java 2001/03/06 06:12:40 1.28
    +++ TurbineResourceService.java 2001/03/18 16:58:20 1.29
    @@ -63,8 +63,8 @@

    // Turbine stuff.
    import org.apache.turbine.Turbine;
    -import org.apache.turbine.util.Configurations;
    -import org.apache.turbine.util.ExtendedProperties;
    +//import org.apache.turbine.util.Configurations;
    +//import org.apache.turbine.util.ExtendedProperties;
    import org.apache.turbine.services.TurbineBaseService;
    import org.apache.turbine.services.TurbineServices;
    import org.apache.turbine.services.InitializationException;
    @@ -72,6 +72,8 @@
    import org.apache.turbine.util.TurbineConfig;
    import org.apache.turbine.util.TurbineException;

    +import org.apache.velocity.runtime.configuration.Configuration;
    +
    /**
    * <p>This implementation of the <code>resourcesService</code> relies
    * on an external properties file for storing the configuration keys
    @@ -93,14 +95,14 @@
    * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
    * @author <a href="mailto:luta.raphael@networks.vivendi.net">Raphaël Luta</a>
    * @author <a href="mailto:jvanzyl@periapt.com@">Jason van Zyl</a>
    - * @version $Id: TurbineResourceService.java,v 1.28 2001/03/06 06:12:40 chrise Exp $
    + * @version $Id: TurbineResourceService.java,v 1.29 2001/03/18 16:58:20 jvanzyl Exp $
    */
    -public class TurbineResourceService
    - extends TurbineBaseService
    +public class TurbineResourceService extends TurbineBaseService
    implements ResourceService
    {
    /** The container for the generic resources. */
    - private GenericResources generic = null;
    + //private GenericResources generic = null;
    + private Configuration generic = null;

    /**
    * Performs early initialization. Overrides init() method in
    @@ -122,10 +124,10 @@
    {
    init((Properties)data);
    }
    - else if (data instanceof Configurations)
    + else if (data instanceof Configuration)
    {
    - init((Configurations)data);
    - }
    + init((Configuration)data);
    + }
    }

    /**
    @@ -151,14 +153,9 @@
    // shouldn't since WAR files are the future anyways.
    props = ServletUtils.expandRelative(config, props);

    - // Check for errors in locating the props file. if there is
    - // one this method will throw an exception and you should look
    - // in your log file for more information.
    - propertyFileErrorCheck(props);
    -
    try
    {
    - init(new Configurations(new ExtendedProperties(props)));
    + init(new Configuration(props));
    }
    catch (IOException e)
    {
    @@ -176,10 +173,10 @@
    public static void setPropertiesFileName(String propertiesFileName)
    throws TurbineException
    {
    - Hashtable mappings = new Hashtable();
    + Configuration mappings = new Configuration();

    - mappings.put(ResourceService.SERVICE_NAME,
    - TurbineResourceService.class.getName());
    + mappings.setProperty(ResourceService.SERVICE_NAME,
    + TurbineResourceService.class.getName());

    TurbineServices services = (TurbineServices) TurbineServices.getInstance();
    services.initMapping(mappings);
    @@ -198,10 +195,10 @@
    public static void setProperties(Properties properties)
    throws TurbineException
    {
    - Hashtable mappings = new Hashtable();
    + Configuration mappings = new Configuration();

    - mappings.put(ResourceService.SERVICE_NAME,
    - TurbineResourceService.class.getName());
    + mappings.setProperty(ResourceService.SERVICE_NAME,
    + TurbineResourceService.class.getName());

    TurbineServices services = (TurbineServices) TurbineServices.getInstance();
    services.initMapping(mappings);
    @@ -213,7 +210,8 @@
    *
    * @return A GenericResources.
    */
    - protected GenericResources getGeneric()
    + //protected GenericResources getGeneric()
    + protected Configuration getGeneric()
    {
    return generic;
    }
    @@ -223,9 +221,9 @@
    *
    * @param confs A Configurations object.
    */
    - private void init(Configurations confs)
    + private void init(Configuration configuration)
    {
    - generic = new GenericResources(confs);
    + generic = configuration;
    setInit(true);
    }

    @@ -240,42 +238,9 @@
    * @param props A Properties object.
    */
    private void init(Properties props)
    - {
    - ExtendedProperties extProperties = new ExtendedProperties();
    - Enumeration e = props.keys();
    -
    - while (e.hasMoreElements())
    - {
    - String key = (String) e.nextElement();
    - String value = (String) props.get(key);
    - int commaSign = value.indexOf(',');
    - if (commaSign > 0)
    - {
    - StringTokenizer tokenizer = new StringTokenizer(value, ",");
    - Vector v = new Vector(2);
    - while (tokenizer.hasMoreTokens())
    - {
    - String token = tokenizer.nextToken();
    - v.addElement(token);
    - }
    - extProperties.put ( key, v );
    - }
    - else
    - {
    - extProperties.put ( key, value );
    - }
    - }
    - init(new Configurations(extProperties));
    - }
    -
    - /**
    - * Get the Configurations that was used to define this object.
    - *
    - * @return A Configurations object.
    - */
    - public Configurations getConfig()
    {
    - return getGeneric().getConfig();
    + Configuration configuration = Configuration.convertProperties(props);
    + init(configuration);
    }

    /**
    @@ -364,25 +329,7 @@
    * @param name The resource name.
    * @return The value of the resource as an Integer.
    */
    - public Integer getInteger(String name)
    - {
    - return getGeneric().getInteger(name);
    - }
    -
    - /**
    - * The purpose of this method is to get the configuration resource
    - * with the given name as an Integer, or a default value.
    - *
    - * @param name The resource name.
    - * @param def The default value of the resource.
    - * @return The value of the resource as an Integer.
    - */
    - public Integer getInteger(String name,
    - int def)
    - {
    - return getGeneric().getInteger(name, def);
    - }
    -
    +
    /**
    * The purpose of this method is to get the configuration resource
    * with the given name as an integer.
    @@ -415,7 +362,8 @@
    *
    * @return An Enumeration with all the keys.
    */
    - public Enumeration getKeys()
    + //public Enumeration getKeys()
    + public Iterator getKeys()
    {
    return getGeneric().getKeys();
    }
    @@ -427,19 +375,9 @@
    * @param prefix A String prefix to test against.
    * @return An Enumeration of keys that match the prefix.
    */
    - public Enumeration getKeys(String prefix)
    + public Iterator getKeys(String prefix)
    {
    - Enumeration keys = getGeneric().getKeys();
    - Vector matchingKeys = new Vector();
    - while( keys.hasMoreElements() )
    - {
    - Object key = keys.nextElement();
    - if( key instanceof String && ((String) key).startsWith(prefix) )
    - {
    - matchingKeys.addElement(key);
    - }
    - }
    - return matchingKeys.elements();
    + return getGeneric().getKeys(prefix);
    }

    /**
    @@ -533,88 +471,6 @@
    }

    /**
    - * Retrieves an error message from ErrorResources.
    - *
    - * The purpose of this metod is wrapping the raw Exception
    - * into a InitializationException.
    - *
    - * @param id the message identifier
    - * @param params the substituation strings
    - */
    - protected String getErrorMessage( String id, Object params [] )
    - throws InitializationException
    - {
    - try
    - {
    - return ErrorResources.getMessage(id, params);
    - }
    - catch(Exception e)
    - {
    - // hope that doesn't happen very often...
    - throw new InitializationException(
    - "Failed to retrieve error message form ErrorResources");
    - }
    - }
    -
    - /**
    - * This code is used to make sure that the property file is
    - * properly found and initialized. If it isn't, then set
    - * initFailureMessage string to the error and throw a
    - * InitializationException. This code is called from this service
    - * init() method.
    - *
    - * @param props Properties file name.
    - * @exception InitializationException an initialization exception.
    - */
    - protected void propertyFileErrorCheck(String props)
    - throws InitializationException
    - {
    - String initFailureMessage = null;
    - try
    - {
    - ErrorResources.init();
    - }
    - catch(Exception e)
    - {
    - throw new InitializationException("ErrorResources failed to initialize", e);
    - }
    - if ( props == null)
    - {
    - Object params[] = {(Object) TurbineServices.PROPERTIES_PATH_KEY};
    - initFailureMessage = getErrorMessage(
    - ErrorResources.PROPERTIES_INIT_PARAMETER_NOT_FOUND,
    - params);
    - throw new InitializationException(initFailureMessage);
    - }
    - else if(props.length() == 0)
    - {
    - Object params[] = {(Object) TurbineServices.PROPERTIES_PATH_KEY};
    - initFailureMessage = getErrorMessage(
    - ErrorResources.PROPERTIES_INIT_PARAMETER_ZERO_LENGTH_STRING,
    - params);
    - throw new InitializationException(initFailureMessage);
    - }
    - else if(!(new File(props).exists()))
    - {
    - Object params[] = {(Object) props,
    - (Object) TurbineServices.PROPERTIES_PATH_KEY};
    - initFailureMessage = getErrorMessage(
    - ErrorResources.TURBINE_RESOURCE_FILE_DOES_NOT_EXIST,
    - params);
    - throw new InitializationException(initFailureMessage);
    - }
    - else if(!(new File(props).canRead()))
    - {
    - Object params[] = {(Object) props,
    - (Object) System.getProperty("user.name")};
    - initFailureMessage = getErrorMessage(
    - ErrorResources.TURBINE_RESOURCE_FILE_NOT_READABLE,
    - params);
    - throw new InitializationException(initFailureMessage);
    - }
    - }
    -
    - /**
    * The purpose of this method is to extract a subset of configuraton
    * resources sharing a common name prefix. The prefix is stripped
    * from the names of the resulting resources.
    @@ -624,90 +480,15 @@
    */
    public ResourceService getResources(String prefix)
    {
    - Configurations config = getConfig();
    - config = config.getConfigurations(prefix);
    - TurbineResourceService res = new TurbineResourceService();
    - res.init(config);
    - return (ResourceService)res;
    - }
    -
    - /**
    - * This method does something special. If you have input like this:
    - * <p>
    - * foo.bar.1=blah blah blah
    - * <p>
    - * The prefix to look for would then be "foo" and it would return
    - * a Vector that contains an ordered set of String[]'s that contain two
    - * Strings. For example:
    - * <p>
    - * String[0] would have "bar" in it (with the prefix and number removed)
    - * String[1] would have "blah blah blah" in it
    - * <p>
    - * Not the most efficient, but it works and should only be executed during
    - * initialization.
    - *
    - * This method assumes that your properties you are listing
    - * are 1 based!!!!! So you will have something like:
    - *
    - * app.tool.ui.1 = A
    - * app.tool.scarab.2. = B
    - */
    - public Vector getOrderedValues(String prefix)
    - {
    - Hashtable rawData = new Hashtable();
    - // get a list of keys
    - for (Enumeration e = getKeys(); e.hasMoreElements();)
    - {
    - String item = (String) e.nextElement();
    -
    - /*
    - * If it starts with the prefix, and the character
    - * after the prefix is a "." then add it to the hashtable
    - * keyed off of the order number.
    - *
    - * We want all the properties for say:
    - * app.tool.ui.1 = A
    - * app.tool.scarab.2 = B
    - *
    - * But we don't want things like
    - * app.toolbox.handle included in this list.
    - */
    - if (item.startsWith(prefix) &&
    - item.substring(prefix.length()).startsWith("."))
    - {
    - String[] stuff = new String[2];
    - stuff[0] = stripPrefixAndNumber(prefix,item);
    - stuff[1] = getString(item);
    - rawData.put (getNumber(item), stuff);
    - }
    - }
    + Configuration config = getGeneric().subset(prefix);

    - Vector items = new Vector(rawData.size());
    - // put things into the String[] in order
    - for (int i = 1; i <= rawData.size(); i++ )
    + if (config == null)
    {
    - items.add(rawData.get(new Integer(i).toString()));
    + return null;
    }
    - return items;
    - }
    -
    - /**
    - * INPUT: prefilter.1
    - * <p>
    - * OUTPUT: 1
    - */
    - private static final String getNumber(String name)
    - {
    - return (name.substring(name.lastIndexOf(".")+1, name.length()));
    - }
    - /**
    - * INPUT: Prefix=foo key=foo.prefilter.1
    - * <p>
    - * OUTPUT: prefilter
    - */
    - private static final String stripPrefixAndNumber(String prefix, String key)
    - {
    - String newKey = key.substring(prefix.length()+1); //Strip the dot also
    - return (newKey.substring(0, newKey.lastIndexOf(".")));
    +
    + TurbineResourceService res = new TurbineResourceService();
    + res.init(config);
    + return (ResourceService)res;
    }
    }



    1.20 +3 -50 jakarta-turbine/src/java/org/apache/turbine/services/resources/TurbineResources.java

    Index: TurbineResources.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/resources/TurbineResources.java,v
    retrieving revision 1.19
    retrieving revision 1.20
    diff -u -r1.19 -r1.20
    --- TurbineResources.java 2001/03/06 06:12:40 1.19
    +++ TurbineResources.java 2001/03/18 16:58:21 1.20
    @@ -59,7 +59,6 @@
    import javax.servlet.ServletConfig;

    import org.apache.turbine.services.*;
    -import org.apache.turbine.util.Configurations;

    /**
    * <p>This is a static class for defining the default Turbine configuration
    @@ -72,7 +71,7 @@
    * @author <a href="mailto:greg@shwoop.com">Greg Ritter</a>
    * @author <a href="mailto:luta.raphael@networks.vivendi.net">Raphaël Luta</a>
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    - * @version $Id: TurbineResources.java,v 1.19 2001/03/06 06:12:40 chrise Exp $
    + * @version $Id: TurbineResources.java,v 1.20 2001/03/18 16:58:21 jvanzyl Exp $
    */
    public abstract class TurbineResources
    {
    @@ -193,32 +192,6 @@

    /**
    * The purpose of this method is to get the configuration resource
    - * with the given name as an Integer.
    - *
    - * @param name The resource name.
    - * @reurn The value of the resource as an Integer.
    - */
    - public static Integer getInteger(String name)
    - {
    - return getService().getInteger(name);
    - }
    -
    - /**
    - * The purpose of this method is to get the configuration resource
    - * with the given name as an Integer, or a default value.
    - *
    - * @param name The resource name.
    - * @param def The default value of the resource.
    - * @return The value of the resource as an Integer.
    - */
    - public static Integer getInteger(String name,
    - int def)
    - {
    - return getService().getInteger(name, def);
    - }
    -
    - /**
    - * The purpose of this method is to get the configuration resource
    * with the given name as an integer.
    *
    * @param name The resource name.
    @@ -249,7 +222,7 @@
    *
    * @return An Enumeration with all the keys.
    */
    - public static Enumeration getKeys()
    + public static Iterator getKeys()
    {
    return getService().getKeys();
    }
    @@ -261,7 +234,7 @@
    * @param prefix A String prefix to test against.
    * @return An Enumeration of keys that match the prefix.
    */
    - public static Enumeration getKeys(String prefix)
    + public static Iterator getKeys(String prefix)
    {
    return getService().getKeys(prefix);
    }
    @@ -366,25 +339,5 @@
    public static ResourceService getResources(String prefix)
    {
    return getService().getResources(prefix);
    - }
    -
    - /**
    - * This method does something special. If you have input like this:
    - * <p>
    - * foo.bar.1=blah blah blah
    - * <p>
    - * The prefix to look for would then be "foo" and it would return
    - * a Vector that contains an ordered set of String[]'s that contain two
    - * Strings. For example:
    - * <p>
    - * String[0] would have "bar" in it (with the prefix and number removed)
    - * String[1] would have "blah blah blah" in it
    - * <p>
    - * Not the most efficient, but it works and should only be executed during
    - * initialization.
    - */
    - public static Vector getOrderedValues(String prefix)
    - {
    - return getService().getOrderedValues(prefix);
    }
    }



    1.19 +6 -4 jakarta-turbine/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java

    Index: TurbineXmlRpcService.java
    ===================================================================
    RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/services/xmlrpc/TurbineXmlRpcService.java,v
    retrieving revision 1.18
    retrieving revision 1.19
    diff -u -r1.18 -r1.19
    --- TurbineXmlRpcService.java 2001/03/18 02:01:38 1.18
    +++ TurbineXmlRpcService.java 2001/03/18 16:58:22 1.19
    @@ -58,6 +58,8 @@
    import java.util.Vector;
    import java.util.Properties;
    import java.util.Enumeration;
    +import java.util.Iterator;
    +
    import java.io.InputStream;
    import java.io.IOException;
    import java.net.URL;
    @@ -104,7 +106,7 @@
    * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:dlr@finemaltcoding.com">Daniel Rall</a>
    - * @version $Id: TurbineXmlRpcService.java,v 1.18 2001/03/18 02:01:38 dlr Exp $
    + * @version $Id: TurbineXmlRpcService.java,v 1.19 2001/03/18 16:58:22 jvanzyl Exp $
    */
    public class TurbineXmlRpcService
    extends TurbineBaseService
    @@ -150,10 +152,10 @@
    XmlRpc.setDriver ( saxParserClass );

    // Check if there are any handlers to register at startup
    - Enumeration keys = resources.getKeys("handler");
    - while ( keys.hasMoreElements() )
    + Iterator keys = resources.getKeys("handler");
    + while ( keys.hasNext() )
    {
    - String handler = (String)keys.nextElement();
    + String handler = (String)keys.next();
    String handlerName = handler.substring(handler.indexOf(".")+1);
    String handlerClass = resources.getString(handler);
    registerHandler(handlerName, handlerClass);




    ---------------------------------------------------------------------
    To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
    For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdev @
categoriesturbine
postedMar 1, '01 at 7:10p
activeMar 18, '01 at 4:58p
posts4
users3
websiteturbine.apache.org

3 users in discussion

Dlr: 2 posts Thorhauer: 1 post Jvanzyl: 1 post

People

Translate

site design / logo © 2018 Grokbase