| Home >> All >> org >> jnp >> [ interfaces Javadoc ] |
Source code: org/jnp/interfaces/MarshalledValuePair.java
1 package org.jnp.interfaces; 2 3 import java.io.IOException; 4 import java.io.Serializable; 5 import java.rmi.MarshalledObject; 6 7 /** An encapsulation of a JNDI binding as both the raw object and its 8 MarshalledObject form. When accessed in the same VM as the JNP server, 9 the raw object reference is used to avoid deserialization. 10 11 @author Scott.Stark@jboss.org 12 @version $Revision: 1.2 $ 13 */ 14 public class MarshalledValuePair implements Serializable 15 { 16 public MarshalledObject marshalledValue; 17 public transient Object value; 18 19 /** Creates a new instance of MashalledValuePair */ 20 public MarshalledValuePair(Object value) throws IOException 21 { 22 this.value = value; 23 this.marshalledValue = new MarshalledObject(value); 24 } 25 26 public Object get() throws ClassNotFoundException, IOException 27 { 28 Object theValue = value; 29 if( theValue == null && marshalledValue != null ) 30 theValue = marshalledValue.get(); 31 return theValue; 32 } 33 }