From: <bil...@jb...> - 2005-04-28 00:19:51
|
anonymous wrote : | Ok, let's deal with a fundamental problem first. | | The MC does not necessarily use a ConstructorJoinPoint. | It could use a factory to create the object. See the ConstructorMetaData. | | The AOP container needs to intercept the allocation of the bean by the MC. Whether this is done by a constructor or factory method, it doesn't matter. AOP needs to intercept allocation so that it can put a proxy in place or initialize the InstanceAdvisor (depending whether the class is aspectized or not). What I think we should do is ditch the ClassAdapter stuff and just have an AspectAdapter. An AspectAdapter should be created per bean. This would require a rewrite of your MC because allocation information and the ClassAdapter stuff is embedded within the BeanInfo class which is cached on a per-class basis. I think the AspectAdapter interface should be as follows in live within the kernel/ module: | public interface AspectAdapterFactory { | AspectAdapter createAspectAdapter(Class clazz, BeanMetaData metadata); | } | Yes, AOP Requires the java.lang.Class. Again, I refuse to use ClassInfos because it would require too much refactoring to JBoss AOP and creating ClassInfos with Javassist, is just way too slow. I have no desire to refactor Javassist as well to make it faster. I think you are going way overboard with dependency management here. Requiring too much work for too little reward. The AspectAdapter interface might look something like this: | public interface AspectAdapter { | public List getDependencies(); | public ConstructorJoinpoint getConstructorJoinpoint(ConstructorInfo); | public MethodJoinpoint getFactoryJoinpoint(); | public FieldGetJoinpoint getFieldGetJoinpoint(FieldInfo); | public FieldSetJoinpoint getFieldSetJoinpoint(FieldInfo); | public MethodJonipoint getMethodJoinpoint(MethodInfo); | } | For JBoss AOP at least, the getMethodJoinpoint would not be needed. FieldGet/FieldSet are needed because JBoss AOP wraps field access in a static method call. A separate getFactoryJoinpoint and getConstructorJoinpoint is needed, because again, JBoss AOP needs to be able to intercept allocation to create a proxy or to interact with the aspectized class's object instance's InstanceAdvisor. This is going to require a bunch of refactoring to MC because currently the classadapter is hidden by BeanInfos. Bill View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3875686#3875686 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3875686 |