jdk/src/share/classes/com/sun/jmx/remote/internal/ProxyRef.java
changeset 2 90ce3da70b43
child 1004 5ba8217eb504
equal deleted inserted replaced
0:fd16c54261b3 2:90ce3da70b43
       
     1 /*
       
     2  * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.  Sun designates this
       
     8  * particular file as subject to the "Classpath" exception as provided
       
     9  * by Sun in the LICENSE file that accompanied this code.
       
    10  *
       
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14  * version 2 for more details (a copy is included in the LICENSE file that
       
    15  * accompanied this code).
       
    16  *
       
    17  * You should have received a copy of the GNU General Public License version
       
    18  * 2 along with this work; if not, write to the Free Software Foundation,
       
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20  *
       
    21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
       
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
       
    23  * have any questions.
       
    24  */
       
    25 
       
    26 package com.sun.jmx.remote.internal;
       
    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.Remote;
       
    33 import java.rmi.RemoteException;
       
    34 import java.rmi.server.Operation;
       
    35 import java.rmi.server.RemoteCall;
       
    36 import java.rmi.server.RemoteObject;
       
    37 import java.rmi.server.RemoteRef;
       
    38 
       
    39 
       
    40 @SuppressWarnings("deprecation")
       
    41 public class ProxyRef implements RemoteRef {
       
    42     private static final long serialVersionUID = -6503061366316814723L;
       
    43 
       
    44     public ProxyRef(RemoteRef ref) {
       
    45         this.ref = ref;
       
    46     }
       
    47 
       
    48     public void readExternal(ObjectInput in)
       
    49             throws IOException, ClassNotFoundException {
       
    50         ref.readExternal(in);
       
    51     }
       
    52 
       
    53     public void writeExternal(ObjectOutput out) throws IOException {
       
    54         ref.writeExternal(out);
       
    55     }
       
    56 
       
    57     public void invoke(RemoteCall call) throws Exception {
       
    58         ref.invoke(call);
       
    59     }
       
    60 
       
    61     public Object invoke(Remote obj, Method method, Object[] params,
       
    62                          long opnum) throws Exception {
       
    63         return ref.invoke(obj, method, params, opnum);
       
    64     }
       
    65 
       
    66     public void done(RemoteCall call) throws RemoteException {
       
    67         ref.done(call);
       
    68     }
       
    69 
       
    70     public String getRefClass(ObjectOutput out) {
       
    71         return ref.getRefClass(out);
       
    72     }
       
    73 
       
    74     public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum,
       
    75                               long hash) throws RemoteException {
       
    76         return ref.newCall(obj, op, opnum, hash);
       
    77     }
       
    78 
       
    79     public boolean remoteEquals(RemoteRef obj) {
       
    80         return ref.remoteEquals(obj);
       
    81     }
       
    82 
       
    83     public int remoteHashCode() {
       
    84         return ref.remoteHashCode();
       
    85     }
       
    86 
       
    87     public String remoteToString() {
       
    88         return ref.remoteToString();
       
    89     }
       
    90 
       
    91     protected RemoteRef ref;
       
    92 }