JAXRConnection.java

00001 
00026 package org.objectweb.jonas.jaxr;
00027 
00028 import java.io.Serializable;
00029 import java.util.Properties;
00030 
00031 import javax.naming.BinaryRefAddr;
00032 import javax.naming.NamingException;
00033 import javax.naming.Reference;
00034 import javax.naming.Referenceable;
00035 
00036 import org.objectweb.jonas.common.JNDIUtils;
00037 import org.objectweb.jonas.jaxr.factory.JAXRFactory;
00038 
00039 
00044 public class JAXRConnection implements Referenceable, Serializable {
00045 
00049     private Properties p;
00050 
00055     public JAXRConnection(Properties p) {
00056         this.p = p;
00057     }
00058 
00062     public Reference getReference() throws NamingException {
00063 
00064         // create new Reference using javax.xml.registry.ConnectionFactory Type
00065         // and our own Factory
00066         Reference ref = new Reference(JAXRFactory.FACTORY_TYPE, JAXRFactory.class.getName(), null);
00067 
00068         // store configuration properties
00069         ref.add(new BinaryRefAddr(JAXRFactory.PROPS_NAME, JNDIUtils.getBytesFromObject(p)));
00070 
00071         // return the instance
00072         return ref;
00073     }
00074 
00075 }

Generated on Tue Feb 15 15:05:16 2005 for JOnAS by  doxygen 1.3.9.1