1 8 package org.codehaus.spice.jndikit.test; 9 10 import java.io.IOException ; 11 import javax.naming.Reference ; 12 import javax.naming.Referenceable ; 13 import javax.naming.StringRefAddr ; 14 15 16 23 public class TestDataReferenceable extends TestData implements Referenceable 24 { 25 26 27 30 public TestDataReferenceable() 31 { 32 } 33 34 39 public TestDataReferenceable( String value ) 40 { 41 super( value ); 42 } 43 44 49 public Reference getReference() 50 { 51 return new Reference ( getClass().getName(), 52 new StringRefAddr ( "value", getValue() ), 53 TestObjectFactory.class.getName(), 54 null ); 55 } 56 57 private void writeObject( java.io.ObjectOutputStream out ) 58 throws IOException 59 { 60 throw new IOException ( "Cannot serialize. Use getReference() instead" ); 61 } 62 63 private void readObject( java.io.ObjectInputStream in ) 64 throws IOException 65 { 66 throw new IOException ( "Cannot serialize. Use getReference() instead" ); 67 } 68 69 } 70 | Popular Tags |