1 package org.openejb.core.ivm.naming; 2 3 import org.openejb.core.DeploymentInfo; 4 import org.openejb.core.ThreadContext; 5 15 public class JndiEncArtifact implements java.io.Serializable { 16 String path = new String (); 17 18 public JndiEncArtifact(IvmContext context){ 19 NameNode node = context.mynode; 20 do{ 21 path = node.atomicName+"/"+path; 22 node = node.parent; 23 }while(node!=null); 24 } 25 public Object readResolve() throws java.io.ObjectStreamException { 26 ThreadContext thrdCntx = ThreadContext.getThreadContext(); 27 DeploymentInfo deployment = thrdCntx.getDeploymentInfo(); 28 javax.naming.Context cntx = deployment.getJndiEnc(); 29 try{ 30 Object obj = cntx.lookup(path); 31 if(obj==null) 32 throw new java.io.InvalidObjectException ("JNDI ENC context reference could not be properly resolved when bean instance was activated"); 33 return obj; 34 }catch(javax.naming.NamingException e){ 35 throw new java.io.InvalidObjectException ("JNDI ENC context reference could not be properly resolved due to a JNDI exception, when bean instance was activated"); 36 } 37 } 38 39 40 } | Popular Tags |