jon 01/05/31 19:04:53
Modified: src/java/org/apache/turbine/services BaseServiceBroker.java
Log:
provide a way to get the names of the services.
thanks to [EMAIL PROTECTED]
Revision Changes Path
1.31 +25 -3
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.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- BaseServiceBroker.java 2001/05/31 06:44:10 1.30
+++ BaseServiceBroker.java 2001/06/01 02:04:51 1.31
@@ -83,7 +83,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Kevin Burton</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a>
- * @version $Id: BaseServiceBroker.java,v 1.30 2001/05/31 06:44:10 dlr Exp $
+ * @version $Id: BaseServiceBroker.java,v 1.31 2001/06/01 02:04:51 jon Exp $
*/
public abstract class BaseServiceBroker
extends BaseInitableBroker
@@ -176,7 +176,7 @@
{
notice("Initializing all services using: " +
data.getClass().getName());
- Iterator names = mapping.getKeys();
+ Iterator names = getServiceNames();
// throw exceptions
if(report)
{
@@ -253,7 +253,7 @@
{
notice("Shutting down all services!");
- Iterator serviceNames = mapping.getKeys();
+ Iterator serviceNames = getServiceNames();
String serviceName = null;
/*
@@ -279,6 +279,28 @@
notice("Shutting down service: " + serviceName);
shutdownService(serviceName);
}
+ }
+
+ /**
+ * Returns an Iterator over all known service names.
+ *
+ * @return An Iterator of service names.
+ */
+ public Iterator getServiceNames()
+ {
+ return mapping.getKeys();
+ }
+
+ /**
+ * Returns an Iterator over all known service names beginning with
+ * the provided prefix.
+ *
+ * @param prefix The prefix against which to test.
+ * @return An Iterator of service names which match the prefix.
+ */
+ public Iterator getServiceNames(String prefix)
+ {
+ return mapping.getKeys(prefix);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]