avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/lookup FortressServiceManager.java FortressServiceSelector.java
Date Sat, 15 Feb 2003 17:34:16 GMT
bloritsch    2003/02/15 09:34:16

  Modified:    component/src/java/org/apache/avalon/excalibur/component
                        ExcaliburComponentManager.java
               fortress/src/java/org/apache/avalon/fortress/impl/lookup
                        FortressServiceManager.java
                        FortressServiceSelector.java
  Log:
  backport role parsing code and commit fix
  
  Revision  Changes    Path
  1.23      +31 -1     avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManager.java
  
  Index: ExcaliburComponentManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManager.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ExcaliburComponentManager.java	5 Feb 2003 02:28:35 -0000	1.22
  +++ ExcaliburComponentManager.java	15 Feb 2003 17:34:16 -0000	1.23
  @@ -871,4 +871,34 @@
               }
           }
       }
  +
  +    private Lookup parseRole( String role )
  +    {
  +        Lookup lookup = new Lookup();
  +        lookup.role = role;
  +        lookup.hint = AbstractContainer.DEFAULT_ENTRY;
  +
  +        if ( role.endsWith("Selector") )
  +        {
  +            lookup.role = role.substring(0, role.length() - "Selector".length());
  +            lookup.hint = AbstractContainer.SELECTOR_ENTRY;
  +        }
  +
  +        int index = role.lastIndexOf("/");
  +
  +        // needs to be further than the first character
  +        if ( index > 0 )
  +        {
  +            lookup.role = role.substring(0, index);
  +            lookup.hint = role.substring(index + 1);
  +        }
  +
  +        return lookup;
  +    }
  +
  +    private final static class Lookup
  +    {
  +        public String role;
  +        public String hint;
  +    }
   }
  
  
  
  1.4       +3 -3      avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/lookup/FortressServiceManager.java
  
  Index: FortressServiceManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/lookup/FortressServiceManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FortressServiceManager.java	7 Feb 2003 16:08:12 -0000	1.3
  +++ FortressServiceManager.java	15 Feb 2003 17:34:16 -0000	1.4
  @@ -131,7 +131,7 @@
           {
               final ComponentHandler handler = (ComponentHandler)result;
               final Object component = handler.get();
  -            m_used.put( component, handler );
  +            m_used.put( component.toString(), handler );
               return component;
           }
           catch( final ServiceException ce )
  @@ -162,7 +162,7 @@
   
       public void release( final Object component )
       {
  -        final ComponentHandler handler = (ComponentHandler)m_used.remove( component );
  +        final ComponentHandler handler = (ComponentHandler)m_used.remove( component.toString()
);
           if( null == handler )
           {
               if( null == m_parent )
  
  
  
  1.3       +3 -3      avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/lookup/FortressServiceSelector.java
  
  Index: FortressServiceSelector.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/impl/lookup/FortressServiceSelector.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FortressServiceSelector.java	7 Feb 2003 16:08:12 -0000	1.2
  +++ FortressServiceSelector.java	15 Feb 2003 17:34:16 -0000	1.3
  @@ -100,7 +100,7 @@
           {
               final ComponentHandler handler = getHandler( hint );
               final Object component = handler.get();
  -            m_used.put( component, handler );
  +            m_used.put( component.toString(), handler );
               return component;
           }
           catch( final ServiceException ce )
  @@ -123,7 +123,7 @@
       public void release( Object component )
       {
           final ComponentHandler handler =
  -            (ComponentHandler)m_used.remove( component );
  +            (ComponentHandler)m_used.remove( component.toString() );
           if( null != handler )
           {
               handler.put( component );
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message