logo       


[PATCH] ElementAttributes.copy(): msg#00053

Subject: [PATCH] ElementAttributes.copy()
Hello All,
 
I was attempting to create an implementation of IElementEventHandler and
I noticed that events are currently not being sent properly.  I tracked
down the problem to the copy() method of ElementAttributes where the
event handlers are not being copied.
 
Here is a patch which should fix the problem.  Would someone with CVS
commit privileges please look this over?
 
Cheers,
 
Mike
 
 
Index: src/java/org/apache/jcs/engine/ElementAttributes.java
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/Eleme
ntAttributes.java,v
retrieving revision 1.5
diff -u -r1.5 ElementAttributes.java
--- src/java/org/apache/jcs/engine/ElementAttributes.java 15 Apr 2004
19:22:49 -0000 1.5
+++ src/java/org/apache/jcs/engine/ElementAttributes.java 20 Apr 2004
20:32:02 -0000
@@ -23,12 +23,11 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
-
 import java.util.ArrayList;
-
-import
org.apache.jcs.engine.control.event.behavior.IElementEventHandler;
+import java.util.Iterator;
 
 import org.apache.jcs.engine.behavior.IElementAttributes;
+import
org.apache.jcs.engine.control.event.behavior.IElementEventHandler;
 
 /**
  *  Element attribute descriptor class.
@@ -163,6 +162,7 @@
             attr.setIsRemote( this.getIsRemote() );
             attr.setIsSpool( this.getIsSpool() );
             attr.setMaxLifeSeconds( this.getMaxLifeSeconds() );
+            attr.addElementEventHandlers( this.eventHandlers );
             return attr;
         }
         catch ( Exception e )
@@ -230,6 +230,7 @@
         this.mls = mls;
     }
 
+
     /**
      *  Gets the {3} attribute of the ElementAttributes object
      *
@@ -473,6 +474,26 @@
     }
 
     /**
+     *  Sets the eventHandlers of the IElementAttributes object
+     *
+     *@param <mailto:*@param>   eventHandlers  The new {3} value
+     */
+    public void addElementEventHandlers( ArrayList eventHandlers )
+    {
+        if ( eventHandlers == null )
+        {
+            return;
+        }
+        
+        for ( Iterator iter = eventHandlers.iterator(); iter.hasNext();
)
+        {
+            addElementEventHandler( (IElementEventHandler)iter.next()
);
+        }
+    }
+   
+
+    
+    /**
      *  Gets the elementEventHandlers. Returns null if none exist.
Makes
      *  checking easy.
      *
@@ -483,8 +504,7 @@
     {
         return this.eventHandlers;
     }
-
-
+    
     /**
      *  For logging and debugging the element IElementAttributes.
      *
Index: src/java/org/apache/jcs/engine/behavior/IElementAttributes.java
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-jcs/src/java/org/apache/jcs/engine/behav
ior/IElementAttributes.java,v
retrieving revision 1.5
diff -u -r1.5 IElementAttributes.java
--- src/java/org/apache/jcs/engine/behavior/IElementAttributes.java 15
Apr 2004 19:22:53 -0000 1.5
+++ src/java/org/apache/jcs/engine/behavior/IElementAttributes.java 20
Apr 2004 20:32:02 -0000
@@ -209,6 +209,13 @@
      *@param <mailto:*@param>   eventHandler  The feature to be added
to the ElementEventHandler
      */
     public void addElementEventHandler( IElementEventHandler
eventHandler );
+    
+    /**
+     *  Sets the eventHandlers of the IElementAttributes object
+     *
+     *@param <mailto:*@param>   eventHandlers  The new {3} value
+     */
+    public void addElementEventHandlers( ArrayList eventHandlers );
 
     /**
      *  Gets the elementEventHandlers.

Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe