avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/lookup FortressServiceSelector.java
Date Thu, 07 Nov 2002 23:46:04 GMT
donaldp     2002/11/07 15:46:04

  Modified:    fortress/src/java/org/apache/excalibur/fortress/lookup
                        FortressServiceSelector.java
  Log:
  Touchups.
  
  Revision  Changes    Path
  1.11      +7 -15     jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/lookup/FortressServiceSelector.java
  
  Index: FortressServiceSelector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/lookup/FortressServiceSelector.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FortressServiceSelector.java	3 Oct 2002 03:21:14 -0000	1.10
  +++ FortressServiceSelector.java	7 Nov 2002 23:46:03 -0000	1.11
  @@ -95,16 +95,13 @@
               throw new IllegalArgumentException( "hint cannot be null" );
           }
   
  -        ComponentHandler handler = (ComponentHandler)m_components.get( m_role, hint );
  -
  +        final ComponentHandler handler = (ComponentHandler)m_components.get( m_role, hint
);
           if( null == handler )
           {
               throw new ServiceException( m_role + "/" + hint.toString(),
                                           "The hint does not exist in the ComponentSelector"
);
           }
   
  -        final Object component;
  -
           try
           {
               if( !handler.isInitialized() )
  @@ -112,9 +109,10 @@
                   handler.initialize();
               }
   
  -            component = handler.get();
  -
  +            final Object component = handler.get();
               m_extManager.executeAccessExtensions( component, m_context );
  +            m_used.put( component, handler );
  +            return component;
           }
           catch( ServiceException ce )
           {
  @@ -125,10 +123,6 @@
               throw new ServiceException( m_role + "/" + hint.toString(),
                                           "Could not return a reference to the Component",
e );
           }
  -
  -        m_used.put( component, handler );
  -
  -        return component;
       }
   
       public boolean isSelectable( Object hint )
  @@ -138,8 +132,6 @@
   
       public void release( Object component )
       {
  -        final ComponentHandler handler;
  -
           try
           {
               m_extManager.executeReleaseExtensions( component, m_context );
  @@ -149,8 +141,8 @@
               // REVISIT(MC): we need to log this somewhere
           }
   
  -        handler = (ComponentHandler)m_used.remove( component );
  -
  +        final ComponentHandler handler =
  +            (ComponentHandler)m_used.remove( component );
           handler.put( component );
       }
   }
  
  
  

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


Mime
View raw message