00001
00002
00003
00004
00005 package org.objectweb.jeremie.libs.services.registry.jndi;
00006
00007 import org.objectweb.jonathan.apis.presentation.Marshaller;
00008 import org.objectweb.jonathan.apis.presentation.UnMarshaller;
00009 import org.objectweb.jonathan.apis.protocols.ReplyInterface;
00010 import org.objectweb.jeremie.apis.binding.JRMIOptRef;
00011 import org.objectweb.jeremie.libs.stub_factories.std.OptStub;
00012 import java.rmi.server.RemoteRef;
00013
00017 public class JRMIReferenceImpl_Stub
00018 extends OptStub
00019 implements org.objectweb.jeremie.libs.services.registry.jndi.JRMIRemoteReference, java.rmi.Remote {
00020
00021
00022 public JRMIReferenceImpl_Stub() {
00023 super();
00024 }
00025
00026 public JRMIReferenceImpl_Stub(RemoteRef ref) {
00027 super(ref);
00028 }
00029
00030 public javax.naming.Reference getReference()
00031 throws java.rmi.RemoteException {
00032 try {
00033 JRMIOptRef optref = (JRMIOptRef) ref;
00034 Marshaller marshaller = optref.request();
00035 ReplyInterface reply = optref.prepareInvocation(marshaller);
00036 marshaller.writeInt(0);
00037 optref.invoke(marshaller);
00038 UnMarshaller unmarshaller = reply.listen();
00039 javax.naming.Reference result =
00040 (javax.naming.Reference) unmarshaller.readValue();
00041 unmarshaller.close();
00042 return result;
00043 } catch (org.objectweb.jonathan.apis.protocols.ServerException e) {
00044 UnMarshaller unmarshaller = e.unmarshaller;
00045 Exception excep;
00046 try {
00047 excep = (Exception) unmarshaller.readValue();
00048 unmarshaller.close();
00049 throw excep;
00050 } catch (org.objectweb.jonathan.apis.kernel.JonathanException f) {
00051 throw new java.rmi.MarshalException
00052 ("error during exception unmarshalling by stub", f);
00053 } catch (java.lang.RuntimeException f) {
00054 throw f;
00055 } catch (java.rmi.RemoteException f) {
00056 throw f;
00057 } catch (java.lang.Exception f) {
00058 throw new java.rmi.UnexpectedException
00059 ("undeclared checked exception", f);
00060 }
00061 } catch (java.lang.Exception e) {
00062 throw new java.rmi.MarshalException
00063 ("error during marshalling/unmarshalling by stub", e);
00064 }
00065 }
00066
00067 }