Search in sources :

Example 6 with ApplicationException

use of org.omg.CORBA.portable.ApplicationException in project jdk8u_jdk by JetBrains.

the class _HelloInterface_Stub method sayHelloWithTest3.

public Test3 sayHelloWithTest3(Test3 arg0) throws java.rmi.RemoteException {
    if (!Util.isLocal(this)) {
        try {
            org.omg.CORBA_2_3.portable.InputStream in = null;
            try {
                org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) _request("sayHelloWithTest3", true);
                out.write_value(arg0, Test3.class);
                in = (org.omg.CORBA_2_3.portable.InputStream) _invoke(out);
                return (Test3) in.read_value(Test3.class);
            } catch (ApplicationException ex) {
                in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
                String $_id = in.read_string();
                throw new UnexpectedException($_id);
            } catch (RemarshalException ex) {
                return sayHelloWithTest3(arg0);
            } finally {
                _releaseReply(in);
            }
        } catch (SystemException ex) {
            throw Util.mapSystemException(ex);
        }
    } else {
        ServantObject so = _servant_preinvoke("sayHelloWithTest3", HelloInterface.class);
        if (so == null) {
            return sayHelloWithTest3(arg0);
        }
        try {
            Test3 arg0Copy = (Test3) Util.copyObject(arg0, _orb());
            Test3 result = ((HelloInterface) so.servant).sayHelloWithTest3(arg0Copy);
            return (Test3) Util.copyObject(result, _orb());
        } catch (Throwable ex) {
            Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
            throw Util.wrapException(exCopy);
        } finally {
            _servant_postinvoke(so);
        }
    }
}
Also used : UnexpectedException(java.rmi.UnexpectedException) InputStream(org.omg.CORBA.portable.InputStream) OutputStream(org.omg.CORBA.portable.OutputStream) RemarshalException(org.omg.CORBA.portable.RemarshalException) ApplicationException(org.omg.CORBA.portable.ApplicationException) SystemException(org.omg.CORBA.SystemException) ServantObject(org.omg.CORBA.portable.ServantObject)

Example 7 with ApplicationException

use of org.omg.CORBA.portable.ApplicationException in project jdk8u_jdk by JetBrains.

the class _HelloInterface_Stub method sayHelloWithHashMap2.

public String sayHelloWithHashMap2(HashMap arg0) throws java.rmi.RemoteException {
    if (!Util.isLocal(this)) {
        try {
            org.omg.CORBA_2_3.portable.InputStream in = null;
            try {
                org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) _request("sayHelloWithHashMap2", true);
                out.write_value(arg0, HashMap.class);
                in = (org.omg.CORBA_2_3.portable.InputStream) _invoke(out);
                return (String) in.read_value(String.class);
            } catch (ApplicationException ex) {
                in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
                String $_id = in.read_string();
                throw new UnexpectedException($_id);
            } catch (RemarshalException ex) {
                return sayHelloWithHashMap2(arg0);
            } finally {
                _releaseReply(in);
            }
        } catch (SystemException ex) {
            throw Util.mapSystemException(ex);
        }
    } else {
        ServantObject so = _servant_preinvoke("sayHelloWithHashMap2", HelloInterface.class);
        if (so == null) {
            return sayHelloWithHashMap2(arg0);
        }
        try {
            HashMap arg0Copy = (HashMap) Util.copyObject(arg0, _orb());
            return ((HelloInterface) so.servant).sayHelloWithHashMap2(arg0Copy);
        } catch (Throwable ex) {
            Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
            throw Util.wrapException(exCopy);
        } finally {
            _servant_postinvoke(so);
        }
    }
}
Also used : UnexpectedException(java.rmi.UnexpectedException) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) InputStream(org.omg.CORBA.portable.InputStream) OutputStream(org.omg.CORBA.portable.OutputStream) RemarshalException(org.omg.CORBA.portable.RemarshalException) ApplicationException(org.omg.CORBA.portable.ApplicationException) SystemException(org.omg.CORBA.SystemException) ServantObject(org.omg.CORBA.portable.ServantObject)

Example 8 with ApplicationException

use of org.omg.CORBA.portable.ApplicationException in project jdk8u_jdk by JetBrains.

the class _HelloInterface_Stub method sayHello.

public String sayHello(String arg0) throws java.rmi.RemoteException {
    if (!Util.isLocal(this)) {
        try {
            org.omg.CORBA_2_3.portable.InputStream in = null;
            try {
                org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) _request("sayHello", true);
                out.write_value(arg0, String.class);
                in = (org.omg.CORBA_2_3.portable.InputStream) _invoke(out);
                return (String) in.read_value(String.class);
            } catch (ApplicationException ex) {
                in = (org.omg.CORBA_2_3.portable.InputStream) ex.getInputStream();
                String $_id = in.read_string();
                throw new UnexpectedException($_id);
            } catch (RemarshalException ex) {
                return sayHello(arg0);
            } finally {
                _releaseReply(in);
            }
        } catch (SystemException ex) {
            throw Util.mapSystemException(ex);
        }
    } else {
        ServantObject so = _servant_preinvoke("sayHello", HelloInterface.class);
        if (so == null) {
            return sayHello(arg0);
        }
        try {
            return ((HelloInterface) so.servant).sayHello(arg0);
        } catch (Throwable ex) {
            Throwable exCopy = (Throwable) Util.copyObject(ex, _orb());
            throw Util.wrapException(exCopy);
        } finally {
            _servant_postinvoke(so);
        }
    }
}
Also used : UnexpectedException(java.rmi.UnexpectedException) InputStream(org.omg.CORBA.portable.InputStream) OutputStream(org.omg.CORBA.portable.OutputStream) RemarshalException(org.omg.CORBA.portable.RemarshalException) ApplicationException(org.omg.CORBA.portable.ApplicationException) SystemException(org.omg.CORBA.SystemException) ServantObject(org.omg.CORBA.portable.ServantObject)

Aggregations

SystemException (org.omg.CORBA.SystemException)8 ApplicationException (org.omg.CORBA.portable.ApplicationException)8 RemarshalException (org.omg.CORBA.portable.RemarshalException)8 UnexpectedException (java.rmi.UnexpectedException)7 InputStream (org.omg.CORBA.portable.InputStream)7 OutputStream (org.omg.CORBA.portable.OutputStream)7 ServantObject (org.omg.CORBA.portable.ServantObject)7 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 InetAddress (java.net.InetAddress)1 PrivilegedAction (java.security.PrivilegedAction)1 HashMap (java.util.HashMap)1 ReentrantLock (java.util.concurrent.locks.ReentrantLock)1 HandleImplIIOP (org.jboss.ejb.iiop.HandleImplIIOP)1 HomeHandleImplIIOP (org.jboss.ejb.iiop.HomeHandleImplIIOP)1 InputStream (org.omg.CORBA_2_3.portable.InputStream)1 OutputStream (org.omg.CORBA_2_3.portable.OutputStream)1