jdk/test/java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak_Stub.java
changeset 309 bda219d843f6
parent 2 90ce3da70b43
child 715 f16baef3a20e
equal deleted inserted replaced
308:33a1639d64a5 309:bda219d843f6
     1 /* 
     1 /*
     2  * Copyright 1998 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 1998 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
    27 public final class CheckLeaseLeak_Stub
    27 public final class CheckLeaseLeak_Stub
    28     extends java.rmi.server.RemoteStub
    28     extends java.rmi.server.RemoteStub
    29     implements LeaseLeak, java.rmi.Remote
    29     implements LeaseLeak, java.rmi.Remote
    30 {
    30 {
    31     private static java.rmi.server.Operation[] operations = {
    31     private static java.rmi.server.Operation[] operations = {
    32 	new java.rmi.server.Operation("void ping()")
    32         new java.rmi.server.Operation("void ping()")
    33     };
    33     };
    34     
    34 
    35     private static final long interfaceHash = -8409781791984809394L;
    35     private static final long interfaceHash = -8409781791984809394L;
    36     
    36 
    37     private static final long serialVersionUID = 2;
    37     private static final long serialVersionUID = 2;
    38     
    38 
    39     private static boolean useNewInvoke;
    39     private static boolean useNewInvoke;
    40     private static java.lang.reflect.Method $method_ping_0;
    40     private static java.lang.reflect.Method $method_ping_0;
    41     
    41 
    42     static {
    42     static {
    43 	try {
    43         try {
    44 	    java.rmi.server.RemoteRef.class.getMethod("invoke",
    44             java.rmi.server.RemoteRef.class.getMethod("invoke",
    45 		new java.lang.Class[] {
    45                 new java.lang.Class[] {
    46 		    java.rmi.Remote.class,
    46                     java.rmi.Remote.class,
    47 		    java.lang.reflect.Method.class,
    47                     java.lang.reflect.Method.class,
    48 		    java.lang.Object[].class,
    48                     java.lang.Object[].class,
    49 		    long.class
    49                     long.class
    50 		});
    50                 });
    51 	    useNewInvoke = true;
    51             useNewInvoke = true;
    52 	    $method_ping_0 = LeaseLeak.class.getMethod("ping", new java.lang.Class[] {});
    52             $method_ping_0 = LeaseLeak.class.getMethod("ping", new java.lang.Class[] {});
    53 	} catch (java.lang.NoSuchMethodException e) {
    53         } catch (java.lang.NoSuchMethodException e) {
    54 	    useNewInvoke = false;
    54             useNewInvoke = false;
    55 	}
    55         }
    56     }
    56     }
    57     
    57 
    58     // constructors
    58     // constructors
    59     public CheckLeaseLeak_Stub() {
    59     public CheckLeaseLeak_Stub() {
    60 	super();
    60         super();
    61     }
    61     }
    62     public CheckLeaseLeak_Stub(java.rmi.server.RemoteRef ref) {
    62     public CheckLeaseLeak_Stub(java.rmi.server.RemoteRef ref) {
    63 	super(ref);
    63         super(ref);
    64     }
    64     }
    65     
    65 
    66     // methods from remote interfaces
    66     // methods from remote interfaces
    67     
    67 
    68     // implementation of ping()
    68     // implementation of ping()
    69     public void ping()
    69     public void ping()
    70 	throws java.rmi.RemoteException
    70         throws java.rmi.RemoteException
    71     {
    71     {
    72 	try {
    72         try {
    73 	    if (useNewInvoke) {
    73             if (useNewInvoke) {
    74 		ref.invoke(this, $method_ping_0, null, 5866401369815527589L);
    74                 ref.invoke(this, $method_ping_0, null, 5866401369815527589L);
    75 	    } else {
    75             } else {
    76 		java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
    76                 java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
    77 		ref.invoke(call);
    77                 ref.invoke(call);
    78 		ref.done(call);
    78                 ref.done(call);
    79 	    }
    79             }
    80 	} catch (java.lang.RuntimeException e) {
    80         } catch (java.lang.RuntimeException e) {
    81 	    throw e;
    81             throw e;
    82 	} catch (java.rmi.RemoteException e) {
    82         } catch (java.rmi.RemoteException e) {
    83 	    throw e;
    83             throw e;
    84 	} catch (java.lang.Exception e) {
    84         } catch (java.lang.Exception e) {
    85 	    throw new java.rmi.UnexpectedException("undeclared checked exception", e);
    85             throw new java.rmi.UnexpectedException("undeclared checked exception", e);
    86 	}
    86         }
    87     }
    87     }
    88 }
    88 }