001    package org.omg.CORBA;
002    
003    
004    /**
005     * Generated from IDL interface "Policy".
006     *
007     * @author JacORB IDL compiler V 2.3.0 (JBoss patch 6), 06-Jun-2007
008     * @version generated at Jun 18, 2012 10:37:00 AM
009     */
010    
011    public class _PolicyStub
012            extends org.omg.CORBA.portable.ObjectImpl
013            implements org.omg.CORBA.Policy
014    {
015            private String[] ids = {"IDL:CORBA/Policy:1.0"};
016            public String[] _ids()
017            {
018                    return ids;
019            }
020    
021            public final static java.lang.Class _opsClass = org.omg.CORBA.PolicyOperations.class;
022            public int policy_type()
023            {
024                    while(true)
025                    {
026                    if(! this._is_local())
027                    {
028                            org.omg.CORBA.portable.InputStream _is = null;
029                            try
030                            {
031                                    org.omg.CORBA.portable.OutputStream _os = _request("_get_policy_type",true);
032                                    _is = _invoke(_os);
033                                    return _is.read_ulong();
034                            }
035                            catch( org.omg.CORBA.portable.RemarshalException _rx ){}
036                            catch( org.omg.CORBA.portable.ApplicationException _ax )
037                            {
038                                    String _id = _ax.getId();
039                                    throw new RuntimeException("Unexpected exception " + _id );
040                            }
041                            finally
042                            {
043                                    this._releaseReply(_is);
044                            }
045                    }
046    
047                    else
048                    {
049                    org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "_get_policy_type", _opsClass);
050                    if( _so == null )
051                            throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
052                            PolicyOperations _localServant = (PolicyOperations)_so.servant;
053                            int _result;
054                    try
055                    {
056                            _result = _localServant.policy_type();
057                    }
058                    finally
059                    {
060                            _servant_postinvoke(_so);
061                    }
062                    return _result;
063                    }
064                    }
065    
066            }
067    
068            public org.omg.CORBA.Policy copy()
069            {
070                    while(true)
071                    {
072                    if(! this._is_local())
073                    {
074                            org.omg.CORBA.portable.InputStream _is = null;
075                            try
076                            {
077                                    org.omg.CORBA.portable.OutputStream _os = _request( "copy", true);
078                                    _is = _invoke(_os);
079                                    org.omg.CORBA.Policy _result = org.omg.CORBA.PolicyHelper.read(_is);
080                                    return _result;
081                            }
082                            catch( org.omg.CORBA.portable.RemarshalException _rx ){}
083                            catch( org.omg.CORBA.portable.ApplicationException _ax )
084                            {
085                                    String _id = _ax.getId();
086                                    throw new RuntimeException("Unexpected exception " + _id );
087                            }
088                            finally
089                            {
090                                    this._releaseReply(_is);
091                            }
092                    }
093                    else
094                    {
095                            org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "copy", _opsClass );
096                            if( _so == null )
097                                    throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
098                            PolicyOperations _localServant = (PolicyOperations)_so.servant;
099                            org.omg.CORBA.Policy _result;
100                            try
101                            {
102                                    _result = _localServant.copy();
103                            }
104                            finally
105                            {
106                                    _servant_postinvoke(_so);
107                            }
108                            return _result;
109                    }
110    
111                    }
112    
113            }
114    
115            public void destroy()
116            {
117                    while(true)
118                    {
119                    if(! this._is_local())
120                    {
121                            org.omg.CORBA.portable.InputStream _is = null;
122                            try
123                            {
124                                    org.omg.CORBA.portable.OutputStream _os = _request( "destroy", true);
125                                    _is = _invoke(_os);
126                                    return;
127                            }
128                            catch( org.omg.CORBA.portable.RemarshalException _rx ){}
129                            catch( org.omg.CORBA.portable.ApplicationException _ax )
130                            {
131                                    String _id = _ax.getId();
132                                    throw new RuntimeException("Unexpected exception " + _id );
133                            }
134                            finally
135                            {
136                                    this._releaseReply(_is);
137                            }
138                    }
139                    else
140                    {
141                            org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "destroy", _opsClass );
142                            if( _so == null )
143                                    throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
144                            PolicyOperations _localServant = (PolicyOperations)_so.servant;
145                            try
146                            {
147                                    _localServant.destroy();
148                            }
149                            finally
150                            {
151                                    _servant_postinvoke(_so);
152                            }
153                            return;
154                    }
155    
156                    }
157    
158            }
159    
160    }