home *** CD-ROM | disk | FTP | other *** search
Java Source | 2003-04-29 | 3.9 KB | 120 lines |
- // Stub class generated by rmic, do not edit.
- // Contents subject to change without notice.
-
- package com.jproxy.samples.rmi.test;
-
- public final class TestImpl_Stub
- extends java.rmi.server.RemoteStub
- implements com.jproxy.samples.rmi.test.TestRmi, java.rmi.Remote
- {
- private static final java.rmi.server.Operation[] operations = {
- new java.rmi.server.Operation("byte echoBytes(byte[])[]"),
- new java.rmi.server.Operation("long getServerTime()")
- };
-
- private static final long interfaceHash = 3274809350234753702L;
-
- private static final long serialVersionUID = 2;
-
- private static boolean useNewInvoke;
- private static java.lang.reflect.Method $method_echoBytes_0;
- private static java.lang.reflect.Method $method_getServerTime_1;
-
- static {
- try {
- java.rmi.server.RemoteRef.class.getMethod("invoke",
- new java.lang.Class[] {
- java.rmi.Remote.class,
- java.lang.reflect.Method.class,
- java.lang.Object[].class,
- long.class
- });
- useNewInvoke = true;
- $method_echoBytes_0 = com.jproxy.samples.interfaces.ITest.class.getMethod("echoBytes", new java.lang.Class[] {byte[].class});
- $method_getServerTime_1 = com.jproxy.samples.interfaces.ITest.class.getMethod("getServerTime", new java.lang.Class[] {});
- } catch (java.lang.NoSuchMethodException e) {
- useNewInvoke = false;
- }
- }
-
- // constructors
- public TestImpl_Stub() {
- super();
- }
- public TestImpl_Stub(java.rmi.server.RemoteRef ref) {
- super(ref);
- }
-
- // methods from remote interfaces
-
- // implementation of echoBytes(byte[])
- public byte[] echoBytes(byte[] $param_arrayOf_byte_1)
- throws java.rmi.RemoteException
- {
- try {
- if (useNewInvoke) {
- Object $result = ref.invoke(this, $method_echoBytes_0, new java.lang.Object[] {$param_arrayOf_byte_1}, -3791006001307315080L);
- return ((byte[]) $result);
- } else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 0, interfaceHash);
- try {
- java.io.ObjectOutput out = call.getOutputStream();
- out.writeObject($param_arrayOf_byte_1);
- } catch (java.io.IOException e) {
- throw new java.rmi.MarshalException("error marshalling arguments", e);
- }
- ref.invoke(call);
- byte[] $result;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $result = (byte[]) in.readObject();
- } catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- } catch (java.lang.ClassNotFoundException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- } finally {
- ref.done(call);
- }
- return $result;
- }
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
-
- // implementation of getServerTime()
- public long getServerTime()
- throws java.rmi.RemoteException
- {
- try {
- if (useNewInvoke) {
- Object $result = ref.invoke(this, $method_getServerTime_1, null, 7800110265884817733L);
- return ((java.lang.Long) $result).longValue();
- } else {
- java.rmi.server.RemoteCall call = ref.newCall((java.rmi.server.RemoteObject) this, operations, 1, interfaceHash);
- ref.invoke(call);
- long $result;
- try {
- java.io.ObjectInput in = call.getInputStream();
- $result = in.readLong();
- } catch (java.io.IOException e) {
- throw new java.rmi.UnmarshalException("error unmarshalling return", e);
- } finally {
- ref.done(call);
- }
- return $result;
- }
- } catch (java.lang.RuntimeException e) {
- throw e;
- } catch (java.rmi.RemoteException e) {
- throw e;
- } catch (java.lang.Exception e) {
- throw new java.rmi.UnexpectedException("undeclared checked exception", e);
- }
- }
- }
-