Fields Summary |
---|
protected org.omg.CORBA.Object | _target |
protected String | _opName |
protected org.omg.CORBA.NVList | _arguments |
protected org.omg.CORBA.ExceptionList | _exceptions |
private org.omg.CORBA.NamedValue | _result |
protected org.omg.CORBA.Environment | _env |
private org.omg.CORBA.Context | _ctx |
private org.omg.CORBA.ContextList | _ctxList |
protected com.sun.corba.se.spi.orb.ORB | _orb |
private com.sun.corba.se.impl.logging.ORBUtilSystemException | _wrapper |
protected boolean | _isOneWay |
private int[] | _paramCodes |
private long[] | _paramLongs |
private Object[] | _paramObjects |
protected boolean | gotResponse |
Methods Summary |
---|
public synchronized void | add_exception(org.omg.CORBA.TypeCode exceptionType)
_exceptions.add(exceptionType);
|
public synchronized org.omg.CORBA.Any | add_in_arg()
return _arguments.add(org.omg.CORBA.ARG_IN.value).value();
|
public synchronized org.omg.CORBA.Any | add_inout_arg()
return _arguments.add(org.omg.CORBA.ARG_INOUT.value).value();
|
public synchronized org.omg.CORBA.Any | add_named_in_arg(java.lang.String name)
return _arguments.add_item(name, org.omg.CORBA.ARG_IN.value).value();
|
public synchronized org.omg.CORBA.Any | add_named_inout_arg(java.lang.String name)
return _arguments.add_item(name, org.omg.CORBA.ARG_INOUT.value).value();
|
public synchronized org.omg.CORBA.Any | add_named_out_arg(java.lang.String name)
return _arguments.add_item(name, org.omg.CORBA.ARG_OUT.value).value();
|
public synchronized org.omg.CORBA.Any | add_out_arg()
return _arguments.add(org.omg.CORBA.ARG_OUT.value).value();
|
public org.omg.CORBA.NVList | arguments()
return _arguments;
|
public org.omg.CORBA.ContextList | contexts()
return _ctxList;
|
public synchronized void | ctx(org.omg.CORBA.Context newCtx)
_ctx = newCtx;
|
public synchronized org.omg.CORBA.Context | ctx()
if (_ctx == null)
_ctx = new ContextImpl(_orb);
return _ctx;
|
protected void | doInvocation()
org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
_target ) ;
// Initiate Client Portable Interceptors. Inform the PIHandler that
// this is a DII request so that it knows to ignore the second
// inevitable call to initiateClientPIRequest in createRequest.
// Also, save the RequestImpl object for later use.
_orb.getPIHandler().initiateClientPIRequest( true );
_orb.getPIHandler().setClientPIInfo( this );
InputStream $in = null;
try {
OutputStream $out = delegate.request(null, _opName, !_isOneWay);
// Marshal args
try {
for (int i=0; i<_arguments.count() ; i++) {
NamedValue nv = _arguments.item(i);
switch (nv.flags()) {
case ARG_IN.value:
nv.value().write_value($out);
break;
case ARG_OUT.value:
break;
case ARG_INOUT.value:
nv.value().write_value($out);
break;
}
}
} catch ( org.omg.CORBA.Bounds ex ) {
throw _wrapper.boundsErrorInDiiRequest( ex ) ;
}
$in = delegate.invoke(null, $out);
} catch (ApplicationException e) {
// REVISIT - minor code.
// This is already handled in subcontract.
// REVISIT - uncomment.
//throw new INTERNAL();
} catch (RemarshalException e) {
doInvocation();
} catch( SystemException ex ) {
_env.exception(ex);
// NOTE: The exception should not be thrown.
// However, JDK 1.4 and earlier threw the exception,
// so we keep the behavior to be compatible.
throw ex;
} finally {
delegate.releaseReply(null, $in);
}
|
public org.omg.CORBA.Environment | env()
return _env;
|
public org.omg.CORBA.ExceptionList | exceptions()
return _exceptions;
|
public synchronized void | get_response()
while (gotResponse == false) {
// release the lock. wait to be notified by the thread that is
// doing the asynchronous invocation.
try {
wait();
}
catch (InterruptedException e) {}
}
|
public synchronized void | invoke()
doInvocation();
|
public java.lang.String | operation()
return _opName;
|
public synchronized boolean | poll_response()
// this method has to be synchronized even though it seems
// "readonly" since the thread object doing the asynchronous
// invocation can potentially update this variable in parallel.
// updates are currently simply synchronized againt the request
// object.
return gotResponse;
|
public org.omg.CORBA.NamedValue | result()
return _result;
|
public synchronized org.omg.CORBA.Any | return_value()
if (_result == null)
_result = new NamedValueImpl(_orb);
return _result.value();
|
public synchronized void | send_deferred()
AsynchInvoke invokeObject = new AsynchInvoke(_orb, this, false);
new Thread(invokeObject).start();
|
public synchronized void | send_oneway()
_isOneWay = true;
doInvocation();
|
public synchronized void | set_return_type(org.omg.CORBA.TypeCode tc)
if (_result == null)
_result = new NamedValueImpl(_orb);
_result.value().type(tc);
|
public org.omg.CORBA.Object | target()
return _target;
|
public void | unmarshalReply(org.omg.CORBA.portable.InputStream is)
// First unmarshal the return value if it is not void
if ( _result != null ) {
Any returnAny = _result.value();
TypeCode returnType = returnAny.type();
if ( returnType.kind().value() != TCKind._tk_void )
returnAny.read_value(is, returnType);
}
// Now unmarshal the out/inout args
try {
for ( int i=0; i<_arguments.count() ; i++) {
NamedValue nv = _arguments.item(i);
switch( nv.flags() ) {
case ARG_IN.value:
break;
case ARG_OUT.value:
case ARG_INOUT.value:
Any any = nv.value();
any.read_value(is, any.type());
break;
}
}
}
catch ( org.omg.CORBA.Bounds ex ) {
// Cannot happen since we only iterate till _arguments.count()
}
|