1. /*
  2. * @(#)ProxyRef.java 1.2 04/01/26
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.jmx.remote.internal;
  8. import java.io.IOException;
  9. import java.io.ObjectInput;
  10. import java.io.ObjectOutput;
  11. import java.lang.reflect.Method;
  12. import java.rmi.Remote;
  13. import java.rmi.RemoteException;
  14. import java.rmi.server.Operation;
  15. import java.rmi.server.RemoteCall;
  16. import java.rmi.server.RemoteObject;
  17. import java.rmi.server.RemoteRef;
  18. public class ProxyRef implements RemoteRef {
  19. public ProxyRef(RemoteRef ref) {
  20. this.ref = ref;
  21. }
  22. public void readExternal(ObjectInput in)
  23. throws IOException, ClassNotFoundException {
  24. ref.readExternal(in);
  25. }
  26. public void writeExternal(ObjectOutput out) throws IOException {
  27. ref.writeExternal(out);
  28. }
  29. public void invoke(RemoteCall call) throws Exception {
  30. ref.invoke(call);
  31. }
  32. public Object invoke(Remote obj, Method method, Object[] params,
  33. long opnum) throws Exception {
  34. return ref.invoke(obj, method, params, opnum);
  35. }
  36. public void done(RemoteCall call) throws RemoteException {
  37. ref.done(call);
  38. }
  39. public String getRefClass(ObjectOutput out) {
  40. return ref.getRefClass(out);
  41. }
  42. public RemoteCall newCall(RemoteObject obj, Operation[] op, int opnum,
  43. long hash) throws RemoteException {
  44. return ref.newCall(obj, op, opnum, hash);
  45. }
  46. public boolean remoteEquals(RemoteRef obj) {
  47. return ref.remoteEquals(obj);
  48. }
  49. public int remoteHashCode() {
  50. return ref.remoteHashCode();
  51. }
  52. public String remoteToString() {
  53. return ref.remoteToString();
  54. }
  55. protected RemoteRef ref;
  56. }