1 22 package org.jboss.ejb.plugins; 23 24 import org.jboss.ejb.EntityEnterpriseContext; 25 import org.jboss.invocation.Invocation; 26 27 28 37 public class EntityCreationInterceptor extends AbstractInterceptor 38 { 39 public Object invokeHome(Invocation mi) 40 throws Exception 41 { 42 Object retVal = getNext().invokeHome(mi); 44 45 EntityEnterpriseContext ctx = 48 (EntityEnterpriseContext) mi.getEnterpriseContext(); 49 if(ctx != null && ctx.getId() != null) 50 { 51 mi.setId(ctx.getId()); 54 55 getNext().invoke(mi); 59 } 60 61 return retVal; 62 } 63 64 public Object invoke(Invocation mi) 65 throws Exception 66 { 67 return getNext().invoke(mi); 69 } 70 } 71 72 | Popular Tags |