1 18 19 package org.objectweb.jac.core; 20 21 import java.io.InputStream ; 22 import java.io.IOException ; 23 import java.io.ObjectInputStream ; 24 25 46 47 public class JacObjectInputStream extends ObjectInputStream { 48 49 53 54 public JacObjectInputStream(InputStream is) throws IOException { 55 super(is); 56 enableResolveObject(true); 57 } 58 59 60 74 75 protected Object resolveObject(Object obj) throws IOException { 76 77 Object o = null; 78 79 if (obj instanceof SerializedJacObject) { 80 81 try { 82 o = Class.forName( ((SerializedJacObject)obj).getJacObjectClassName() ) 85 .newInstance(); 86 87 if (o instanceof AspectComponent) { 88 return o; 89 } 90 91 } catch (Exception e) { 94 e.printStackTrace(); 95 } 96 97 return ((ACManager)ACManager.get()).whenDeserialized( 98 (SerializedJacObject)obj,(Wrappee)o); 99 100 } else if(obj instanceof SerializedMethodItem) { 102 return ((SerializedMethodItem)obj).getMethod(); 103 } 104 return obj; 105 } 106 107 108 } 109 110 111 112 | Popular Tags |