package erabilgarriak;
/**
* Generated from IDL interface "DownloadFile".
*
* @author JacORB IDL compiler V 2.3.1, 27-May-2009
* @version generated at Jun 9, 2011 3:02:02 PM
*/
public class _DownloadFileStub
extends org.omg.CORBA.portable.ObjectImpl
implements erabilgarriak.DownloadFile
{
private String[] ids = {"IDL:erabilgarriak/DownloadFile:1.0"};
public String[] _ids()
{
return ids;
}
public final static java.lang.Class _opsClass = erabilgarriak.DownloadFileOperations.class;
public erabilgarriak.FileData getFileData()
{
while(true)
{
if(! this._is_local())
{
org.omg.CORBA.portable.InputStream _is = null;
org.omg.CORBA.portable.OutputStream _os = null;
try
{
_os = _request( "getFileData", true);
_is = _invoke(_os);
erabilgarriak.FileData _result = erabilgarriak.FileDataHelper.read(_is);
return _result;
}
catch( org.omg.CORBA.portable.RemarshalException _rx ){}
catch( org.omg.CORBA.portable.ApplicationException _ax )
{
String _id = _ax.getId();
try
{
_ax.getInputStream().close();
}
catch (java.io.IOException e)
{
throw new RuntimeException("Unexpected exception " + e.toString() );
}
throw new RuntimeException("Unexpected exception " + _id );
}
finally
{
if (_os != null)
{
try
{
_os.close();
}
catch (java.io.IOException e)
{
throw new RuntimeException("Unexpected exception " + e.toString() );
}
}
this._releaseReply(_is);
}
}
else
{
org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "getFileData", _opsClass );
if( _so == null )
throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
DownloadFileOperations _localServant = (DownloadFileOperations)_so.servant;
erabilgarriak.FileData _result;
try
{
_result = _localServant.getFileData();
}
finally
{
_servant_postinvoke(_so);
}
return _result;
}
}
}
public int getPart(int numPart, erabilgarriak.DownloadFilePackage.PartHolder part)
{
while(true)
{
if(! this._is_local())
{
org.omg.CORBA.portable.InputStream _is = null;
org.omg.CORBA.portable.OutputStream _os = null;
try
{
_os = _request( "getPart", true);
_os.write_long(numPart);
erabilgarriak.DownloadFilePackage.PartHelper.write(_os,part.value);
_is = _invoke(_os);
int _result = _is.read_long();
part.value = erabilgarriak.DownloadFilePackage.PartHelper.read(_is);
return _result;
}
catch( org.omg.CORBA.portable.RemarshalException _rx ){}
catch( org.omg.CORBA.portable.ApplicationException _ax )
{
String _id = _ax.getId();
try
{
_ax.getInputStream().close();
}
catch (java.io.IOException e)
{
throw new RuntimeException("Unexpected exception " + e.toString() );
}
throw new RuntimeException("Unexpected exception " + _id );
}
finally
{
if (_os != null)
{
try
{
_os.close();
}
catch (java.io.IOException e)
{
throw new RuntimeException("Unexpected exception " + e.toString() );
}
}
this._releaseReply(_is);
}
}
else
{
org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "getPart", _opsClass );
if( _so == null )
throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
DownloadFileOperations _localServant = (DownloadFileOperations)_so.servant;
int _result;
try
{
_result = _localServant.getPart(numPart,part);
}
finally
{
_servant_postinvoke(_so);
}
return _result;
}
}
}
public int getPartCount()
{
while(true)
{
if(! this._is_local())
{
org.omg.CORBA.portable.InputStream _is = null;
org.omg.CORBA.portable.OutputStream _os = null;
try
{
_os = _request( "getPartCount", true);
_is = _invoke(_os);
int _result = _is.read_long();
return _result;
}
catch( org.omg.CORBA.portable.RemarshalException _rx ){}
catch( org.omg.CORBA.portable.ApplicationException _ax )
{
String _id = _ax.getId();
try
{
_ax.getInputStream().close();
}
catch (java.io.IOException e)
{
throw new RuntimeException("Unexpected exception " + e.toString() );
}
throw new RuntimeException("Unexpected exception " + _id );
}
finally
{
if (_os != null)
{
try
{
_os.close();
}
catch (java.io.IOException e)
{
throw new RuntimeException("Unexpected exception " + e.toString() );
}
}
this._releaseReply(_is);
}
}
else
{
org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "getPartCount", _opsClass );
if( _so == null )
throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
DownloadFileOperations _localServant = (DownloadFileOperations)_so.servant;
int _result;
try
{
_result = _localServant.getPartCount();
}
finally
{
_servant_postinvoke(_so);
}
return _result;
}
}
}
}