src/share/classes/sun/rmi/server/UnicastRef.java

Print this page




  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.rmi.server;
  27 
  28 import java.io.IOException;
  29 import java.io.ObjectInput;
  30 import java.io.ObjectOutput;
  31 import java.lang.reflect.Method;
  32 import java.rmi.MarshalException;
  33 import java.rmi.Remote;
  34 import java.rmi.RemoteException;
  35 import java.rmi.ServerException;
  36 import java.rmi.UnmarshalException;
  37 import java.rmi.server.Operation;
  38 import java.rmi.server.RemoteCall;
  39 import java.rmi.server.RemoteObject;
  40 import java.rmi.server.RemoteRef;
  41 import java.security.AccessController;

  42 import sun.rmi.runtime.Log;
  43 import sun.rmi.transport.Connection;
  44 import sun.rmi.transport.LiveRef;
  45 import sun.rmi.transport.StreamRemoteCall;
  46 import sun.security.action.GetBooleanAction;
  47 
  48 /**
  49  * NOTE: There is a JDK-internal dependency on the existence of this
  50  * class's getLiveRef method (as it is inherited by UnicastRef2) in
  51  * the implementation of javax.management.remote.rmi.RMIConnector.
  52  */
  53 @SuppressWarnings("deprecation")
  54 public class UnicastRef implements RemoteRef {
  55 
  56     /**
  57      * Client-side transport log.
  58      */
  59     public static final Log clientRefLog =
  60         Log.getLog("sun.rmi.client.ref", "transport",  Util.logLevel);
  61 
  62     /**
  63      * Client-side call log.
  64      */
  65     public static final Log clientCallLog =
  66         Log.getLog("sun.rmi.client.call", "RMI",
  67                    AccessController.doPrivileged(
  68                        new GetBooleanAction("sun.rmi.client.logCalls")));
  69     private static final long serialVersionUID = 8258372400816541186L;
  70 
  71     protected LiveRef ref;
  72 
  73     /**
  74      * Create a new (empty) Unicast remote reference.
  75      */
  76     public UnicastRef() {
  77     }
  78 
  79     /**
  80      * Create a new Unicast RemoteRef.
  81      */
  82     public UnicastRef(LiveRef liveRef) {
  83         ref = liveRef;
  84     }
  85 
  86     /**
  87      * Returns the current value of this UnicastRef's underlying
  88      * LiveRef.




  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.rmi.server;
  27 
  28 import java.io.IOException;
  29 import java.io.ObjectInput;
  30 import java.io.ObjectOutput;
  31 import java.lang.reflect.Method;
  32 import java.rmi.MarshalException;
  33 import java.rmi.Remote;
  34 import java.rmi.RemoteException;
  35 import java.rmi.ServerException;
  36 import java.rmi.UnmarshalException;
  37 import java.rmi.server.Operation;
  38 import java.rmi.server.RemoteCall;
  39 import java.rmi.server.RemoteObject;
  40 import java.rmi.server.RemoteRef;
  41 import java.security.AccessController;
  42 import java.security.PrivilegedAction;
  43 import sun.rmi.runtime.Log;
  44 import sun.rmi.transport.Connection;
  45 import sun.rmi.transport.LiveRef;
  46 import sun.rmi.transport.StreamRemoteCall;

  47 
  48 /**
  49  * NOTE: There is a JDK-internal dependency on the existence of this
  50  * class's getLiveRef method (as it is inherited by UnicastRef2) in
  51  * the implementation of javax.management.remote.rmi.RMIConnector.
  52  */
  53 @SuppressWarnings("deprecation")
  54 public class UnicastRef implements RemoteRef {
  55 
  56     /**
  57      * Client-side transport log.
  58      */
  59     public static final Log clientRefLog =
  60         Log.getLog("sun.rmi.client.ref", "transport",  Util.logLevel);
  61 
  62     /**
  63      * Client-side call log.
  64      */
  65     public static final Log clientCallLog =
  66         Log.getLog("sun.rmi.client.call", "RMI",
  67                    AccessController.doPrivileged((PrivilegedAction<Boolean>) () ->
  68                        Boolean.getBoolean("sun.rmi.client.logCalls")));
  69     private static final long serialVersionUID = 8258372400816541186L;
  70 
  71     protected LiveRef ref;
  72 
  73     /**
  74      * Create a new (empty) Unicast remote reference.
  75      */
  76     public UnicastRef() {
  77     }
  78 
  79     /**
  80      * Create a new Unicast RemoteRef.
  81      */
  82     public UnicastRef(LiveRef liveRef) {
  83         ref = liveRef;
  84     }
  85 
  86     /**
  87      * Returns the current value of this UnicastRef's underlying
  88      * LiveRef.