You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by he...@apache.org on 2002/08/01 18:56:08 UTC

cvs commit: jakarta-turbine-fulcrum/src/java/org/apache/fulcrum BaseServiceBroker.java

henning     2002/08/01 09:56:08

  Modified:    src/java/org/apache/fulcrum BaseServiceBroker.java
  Log:
  - Forward port from Turbine: Check classname properties not only for
    beginning and end but for first and third part.
  
  - Typo
  
  Revision  Changes    Path
  1.3       +7 -8      jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/BaseServiceBroker.java
  
  Index: BaseServiceBroker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/BaseServiceBroker.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BaseServiceBroker.java	24 Jul 2002 09:53:44 -0000	1.2
  +++ BaseServiceBroker.java	1 Aug 2002 16:56:08 -0000	1.3
  @@ -305,9 +305,6 @@
        */
       protected void initMapping()
       {
  -        int pref = SERVICE_PREFIX.length();
  -        int suff = CLASSNAME_SUFFIX.length();
  -
           /*
            * These keys returned in an order that corresponds
            * to the order the services are listed in
  @@ -325,11 +322,13 @@
           while(keys.hasNext())
           {
               String key = (String)keys.next();
  +            String [] keyParts = StringUtils.split(key, ".");
   
  -            if(key.startsWith(SERVICE_PREFIX) && key.endsWith(CLASSNAME_SUFFIX))
  +            if ((keyParts.length == 3) 
  +                && (keyParts[0] + ".").equals(SERVICE_PREFIX) 
  +                && ("." + keyParts[2]).equals(CLASSNAME_SUFFIX))
               {
  -                String serviceKey = key.substring(pref, key.length() - suff);
  -                notice ("Added Mapping for Service: " + serviceKey);
  +                String serviceKey = keyParts[1];
   
                   if (! mapping.containsKey(serviceKey))
                   {
  @@ -516,7 +515,7 @@
   
       /**
        * Shuts down all Turbine services, releasing allocated resources and
  -     * returning them to their initial (uninitailized) state.
  +     * returning them to their initial (uninitialized) state.
        */
       public void shutdownServices()
       {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>