For an example look in "our"
javax.management.modelmbean.DescriptorSupport

   private void readObject(ObjectInputStream ois)
      throws IOException, ClassNotFoundException
   {
      ObjectInputStream.GetField getField = ois.readFields();
      HashMap serMap = (HashMap) getField.get("descriptor", null);
      if (serMap == null)
         throw new StreamCorruptedException("Null descriptor?");

      // replace the keys with FieldName objects
      fieldMap = Collections.synchronizedMap(new HashMap());
      Iterator it = serMap.entrySet().iterator();
      while (it.hasNext())
      {
         Map.Entry entry = (Map.Entry) it.next();
         FieldName key = new FieldName((String)entry.getKey());
         fieldMap.put(key, entry.getValue());
      }
   } 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Alexey Loubyansky
> Sent: 17 May, 2006 18:35
> To: jboss-development@lists.sourceforge.net
> Subject: Re: [JBoss-dev] KeyGeneratorFactory serialVersionUID
> 
> Dimitris Andreadis wrote:
> > We certainly need to maintain compatibility between the 4.x (and 
> > 3.2.x) versions, so the serialVersionUID must be the same, 
> although I 
> > don't know why this Mbean needs to be serializable in the 
> first place.
> 
> It should be serializable because an instance is bound to the 
> JNDI. But actually is supposed to be used locally.
> 
> > And since you are just adding fields, implementing Externalizable 
> > should not really be needed, you could initialize any 
> missing field in 
> > readObject(ObjectInputStream), I think.
> 
> But how would I know that a field is missing?
> 
> Thanks,
> 
> alex
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web 
> services, security?
> Get stuff done quickly with pre-integrated technology to make 
> your job easier Download IBM WebSphere Application Server 
> v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&;
> dat=121642
> _______________________________________________
> JBoss-Development mailing list
> JBoss-Development@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jboss-development
> 


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to