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-phoenix/src/java/org/apache/avalon/phoenix/components/application BlockListenerSupport.java
Date Sun, 19 May 2002 00:25:22 GMT
donaldp     02/05/18 17:25:22

  Modified:    src/java/org/apache/avalon/phoenix/components/application
                        BlockListenerSupport.java
  Log:
  Add some utility methods that can be used
  to fireEvents for specific entrys
  
  Revision  Changes    Path
  1.5       +34 -0     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockListenerSupport.java
  
  Index: BlockListenerSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockListenerSupport.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BlockListenerSupport.java	11 Dec 2001 10:13:33 -0000	1.4
  +++ BlockListenerSupport.java	19 May 2002 00:25:22 -0000	1.5
  @@ -9,6 +9,7 @@
   
   import org.apache.avalon.phoenix.BlockEvent;
   import org.apache.avalon.phoenix.BlockListener;
  +import org.apache.avalon.phoenix.metadata.BlockMetaData;
   
   /**
    * Manage a set of <code>BlockListener</code> objects and propogate
  @@ -20,6 +21,39 @@
   {
       //Set of listeners. Must be accessed from synchronized code
       private BlockListener[] m_listeners = new BlockListener[ 0 ];
  +
  +    /**
  +     * fire Event indicating that Block represented by
  +     * specific entry has been added.
  +     *
  +     * @param entry the entry
  +     */
  +    void fireBlockAddedEvent( final BlockEntry entry )
  +    {
  +        final BlockMetaData metaData = entry.getMetaData();
  +        final Object proxy = entry.getProxy();
  +        final BlockEvent event =
  +            new BlockEvent( metaData.getName(),
  +                            proxy,
  +                            metaData.getBlockInfo() );
  +        blockAdded( event );
  +    }
  +
  +    /**
  +     * fire Event indicating that Block represented by
  +     * specific entry is being removed.
  +     *
  +     * @param entry the entry
  +     */
  +    void fireBlockRemovedEvent( final BlockEntry entry )
  +    {
  +        final BlockMetaData metaData = entry.getMetaData();
  +        final BlockEvent event =
  +            new BlockEvent( metaData.getName(),
  +                            entry.getProxy(),
  +                            metaData.getBlockInfo() );
  +        blockRemoved( event );
  +    }
   
       /**
        * Add a BlockListener to those requiring notification of
  
  
  

--
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