The implementation of the CORBA request.
PAUSE_INITIAL
public static int PAUSE_INITIAL
The initial pause that the Request makes when the required port is not
available.
PAUSE_MAX
public static int PAUSE_MAX
The maximal pausing interval between two repetetive attempts. The interval
doubles after each unsuccessful attempt, but will not exceed this value.
PAUSE_STEPS
public static int PAUSE_STEPS
The number of repretetive attempts to get a required port, if it is not
immediately available.
complete
protected boolean complete
The flag, indicating that the request has been sent and the result is
already received.
m_context
protected Context m_context
The context holder for methods ctx(Context) and ctx().
m_environment
protected Environment m_environment
The request environment for holding the exception the has possibly been
thrown by the method being invoked.
m_exception_id
protected String m_exception_id
The exception id, received from the server, null if none.
m_forward_ior
public IOR m_forward_ior
This field temporary remembers the value of the forwarded ior reference. If
it is not null, the request was forwarded and the effective target is not
the same as the default target.
m_result
protected NamedValue m_result
The result, returned by the invoked method (function).
m_slots
protected Any[] m_slots
The array of slots.
oneWay
protected boolean oneWay
The flag, indicating that the response to this request must be ignored
(used with
send_oneway()
).
running
protected boolean running
The flag, indicating that the request has been sent and no result is yet
received.
checkDii
public void checkDii()
Check if the call is done via DII.
getIor
public IOR getIor()
Get the IOR data, sufficient to find the invocation target.
getParameterStream
public StreamBasedRequest getParameterStream()
Get the parameter stream, where the invocation arguments should be written
if they are written into the stream directly.
invoke
public void invoke()
throws BAD_INV_ORDER
Submit the request, suspending the current thread until the answer is
received.
This implementation requires to set the IOR property (setIOR(IOR)
before calling this method.
- invoke in interface Request
SystemException
- if this exception has been thrown on remote side.
The exact exception type and the minor code are the same as they have been
for the exception, thrown on remoted side.
orb
public ORB orb()
Get the orb, related to the invocation target.
reply_status
public short reply_status()
Get the reply status.
request_id
public int request_id()
Get the request id.
response_expected
public boolean response_expected()
Return true if the response is expected.
send_oneway
public void send_oneway()
Send a request and forget about it, not waiting for a response. This can be
done also for methods that normally are expected to return some values.
TODO It is generally recommended to reuse the threads. Reuse?
- send_oneway in interface Request
setBigEndian
public void setBigEndian(boolean use_big_endian)
Set the encoding that will be used to send the message. The default
encoding is inherited from the set IOR (that string reference can be
encoded in either Big or Little endian). If the IOR encoding is not known
(for example, by obtaining the reference from the naming service), the Big
Endian is used.
use_big_endian
- true to use the Big Endian, false to use the Little
Endian encoding.
setIor
public void setIor(IOR an_ior)
Set the IOR data, sufficient to find the invocation target. This also sets
default endian encoding for invocations.
setORB
public void setORB(ORB an_orb)
Set the ORB, related to the invocation target.
setOperation
public void setOperation(String operation)
The the method name to invoke.
operation
- the method name.
set_args
public void set_args(NVList a_args)
Set the argument list. This field is initialised as empty non null instance
by default, so the method is only used in cases when the direct replacement
is desired.
a_args
- the argument list.
set_environment
public void set_environment(Environment a_environment)
Set the exception container. This field is initialised as empty non null
instance by default, so the method is only used in cases when the direct
replacement is desired.
a_environment
- the new exception container.
set_exceptions
public void set_exceptions(ExceptionList a_exceptions)
Set the list of exceptions. This field is initialised as empty non null
instance by default, so the method is only used in cases when the direct
replacement is desired.
a_exceptions
- a list of exceptions.
set_operation
public void set_operation(String a_operation)
Set the operation name.
a_operation
- the operation name.
set_result
public void set_result(NamedValue a_result)
Set the named value, returned as result. This field is initialised as empty
non null instance by default, so the method is only used in cases when the
direct replacement is desired.
a_result
- the result keeper.
set_target
public void set_target(Object a_target)
Set the invocation target.
a_target
- the CORBA object for that the method will be invoked.
submit
public gnu.CORBA.RawReply submit()
throws ForwardRequest
Do the actual invocation. This implementation requires to set the IOR
property (setIOR(IOR)
before calling this method.
- the server response in binary form.
sync_scope
public short sync_scope()
Determines how far the request shall progress before control is returned to
the client. However up till JDK 1.5 inclusive this method always returns
SYNC_WITH_TRANSPORT.
useVersion
public Version useVersion(Version desired)
Get the used version. Normally, it is better to respond using the same
version as it is specified in IOR, but not above the maximal supported
version.
waitWhileBusy
public void waitWhileBusy()
Wait while the response to request, submitted using
send_deferred()
or
invoke()
(from other thread) is
returned.
FIXME It is possible to rewrite this using Object.wait() and
Object.notify(), but be sure to prepare the test as well.
gnuRequest.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.