Class RetryClientRequestInterceptor
- All Implemented Interfaces:
Serializable
,Object
,IDLEntity
,ClientRequestInterceptor
,ClientRequestInterceptorOperations
,Interceptor
,InterceptorOperations
,ORBInitializer
,ORBInitializerOperations
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ThreadLocal
private static final String
private static boolean
private static final long
private static long
private static final String
private static final String
private static final long
private static long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Provides an opportunity to destroy this interceptor.private void
private long
static long
private long
static long
private boolean
private boolean
name()
Returns the name of the interceptor.void
post_init
(ORBInitInfo info) Called during ORB initialization.void
pre_init
(ORBInitInfo info) Called during ORB initialization.void
Indicates to the interceptor that an exception occurred.void
Allows an Interceptor to query the information available when a request results in something other than a normal reply or an exception.void
Allows an Interceptor to query the information on a reply after it is returned from the server and before control is returned to the client.void
Allows an Interceptor to query information during a Time-Independent Invocation (TII) polling get reply sequence.void
Allows an Interceptor to query request information and modify the service context before the request is sent to the server.private void
setBackoff
(long x) static void
setDebug
(boolean x) static void
setInitialBackoff
(long x) private void
setStartTime
(long x) static void
setTransientRetryTimeout
(long x) Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
Field Details
-
baseMsg
-
TRANSIENT_REPOSITORY_ID
- See Also:
-
OBJECT_NOT_EXIST_REPOSITORY_ID
- See Also:
-
INITIAL_BACKOFF_DEFAULT
private static final long INITIAL_BACKOFF_DEFAULT- See Also:
-
initialBackoff
private static long initialBackoff -
TRANSIENT_RETRY_TIMEOUT_DEFAULT
private static final long TRANSIENT_RETRY_TIMEOUT_DEFAULT- See Also:
-
transientRetryTimeout
private static long transientRetryTimeout -
debug
private static boolean debug -
backoffAndStartTime
-
-
Constructor Details
-
RetryClientRequestInterceptor
public RetryClientRequestInterceptor()
-
-
Method Details
-
getStartTime
private long getStartTime() -
setStartTime
private void setStartTime(long x) -
getBackoff
private long getBackoff() -
setBackoff
private void setBackoff(long x) -
doubleBackoff
private void doubleBackoff() -
setInitialBackoff
public static void setInitialBackoff(long x) -
getInitialBackoff
public static long getInitialBackoff() -
setTransientRetryTimeout
public static void setTransientRetryTimeout(long x) -
getTransientRetryTimeout
public static long getTransientRetryTimeout() -
setDebug
public static void setDebug(boolean x) -
name
Description copied from interface:InterceptorOperations
Returns the name of the interceptor.Each Interceptor may have a name that may be used administratively to order the lists of Interceptors. Only one Interceptor of a given name can be registered with the ORB for each Interceptor type. An Interceptor may be anonymous, i.e., have an empty string as the name attribute. Any number of anonymous Interceptors may be registered with the ORB.
- Specified by:
name
in interfaceInterceptorOperations
- Returns:
- the name of the interceptor.
-
destroy
public void destroy()Description copied from interface:InterceptorOperations
Provides an opportunity to destroy this interceptor. The destroy method is called duringORB.destroy
. When an application callsORB.destroy
, the ORB:- waits for all requests in progress to complete
- calls the
Interceptor.destroy
operation for each interceptor - completes destruction of the ORB
Interceptor.destroy
on object references for objects implemented on the ORB being destroyed result in undefined behavior. However, method invocations on objects implemented on an ORB other than the one being destroyed are permitted. (This means that the ORB being destroyed is still capable of acting as a client, but not as a server.)- Specified by:
destroy
in interfaceInterceptorOperations
-
send_request
Description copied from interface:ClientRequestInterceptorOperations
Allows an Interceptor to query request information and modify the service context before the request is sent to the server.This interception point may throw a system exception. If it does, no other Interceptors'
send_request
operations are called. Those Interceptors on the Flow Stack are popped and theirreceive_exception
interception points are called. This interception point may also throw aForwardRequest
exception. If an Interceptor throws this exception, no other Interceptors'send_request
operations are called. Those Interceptors on the Flow Stack are popped and theirreceive_other
interception points are called.Compliant Interceptors shall properly follow completion_status semantics if they throw a system exception from this interception point. The
completion_status
shall beCOMPLETED_NO
.- Specified by:
send_request
in interfaceClientRequestInterceptorOperations
- Parameters:
ri
- Information about the current request being intercepted.
-
send_poll
Description copied from interface:ClientRequestInterceptorOperations
Allows an Interceptor to query information during a Time-Independent Invocation (TII) polling get reply sequence.With TII, an application may poll for a response to a request sent previously by the polling client or some other client. This poll is reported to Interceptors through the
send_poll
interception point and the response is returned through thereceive_reply
orreceive_exception
interception points. If the response is not available before the poll time-out expires, the system exceptionTIMEOUT
is thrown andreceive_exception
is called with this exception.This interception point may throw a system exception. If it does, no other Interceptors'
send_poll
operations are called. Those Interceptors on the Flow Stack are popped and theirreceive_exception
interception points are called.Compliant Interceptors shall properly follow
completion_status
semantics if they throw a system exception from this interception point. The completion_status shall beCOMPLETED_NO
.- Specified by:
send_poll
in interfaceClientRequestInterceptorOperations
- Parameters:
ri
- Information about the current request being intercepted.
-
receive_reply
Description copied from interface:ClientRequestInterceptorOperations
Allows an Interceptor to query the information on a reply after it is returned from the server and before control is returned to the client.This interception point may throw a system exception. If it does, no other Interceptors'
receive_reply
operations are called. The remaining Interceptors in the Flow Stack shall have theirreceive_exception
interception point called.Compliant Interceptors shall properly follow
completion_status
semantics if they throw a system exception from this interception point. Thecompletion_status
shall beCOMPLETED_YES
.- Specified by:
receive_reply
in interfaceClientRequestInterceptorOperations
- Parameters:
ri
- Information about the current request being intercepted.
-
receive_exception
Description copied from interface:ClientRequestInterceptorOperations
Indicates to the interceptor that an exception occurred. Allows an Interceptor to query the exception's information before it is thrown to the client.This interception point may throw a system exception. This has the effect of changing the exception which successive Interceptors popped from the Flow Stack receive on their calls to
receive_exception
. The exception thrown to the client will be the last exception thrown by an Interceptor, or the original exception if no Interceptor changes the exception.This interception point may also throw a
ForwardRequest
exception. If an Interceptor throws this exception, no other Interceptors'receive_exception
operations are called. The remaining Interceptors in the Flow Stack are popped and have theirreceive_other
interception point called.If the
completion_status
of the exception is notCOMPLETED_NO
, then it is inappropriate for this interception point to throw aForwardRequest
exception. The request s at-most-once semantics would be lost.Compliant Interceptors shall properly follow
completion_status
semantics if they throw a system exception from this interception point. If the original exception is a system exception, thecompletion_status
of the new exception shall be the same as on the original. If the original exception is a user exception, then thecompletion_status
of the new exception shall beCOMPLETED_YES
.Under some conditions, depending on what policies are in effect, an exception (such as
COMM_FAILURE
) may result in a retry of the request. While this retry is a new request with respect to Interceptors, there is one point of correlation between the original request and the retry: because control has not returned to the client, thePortableInterceptor.Current
for both the original request and the retrying request is the same.- Specified by:
receive_exception
in interfaceClientRequestInterceptorOperations
- Parameters:
ri
- Information about the current request being intercepted.- Throws:
ForwardRequest
- If thrown, indicates to the ORB that a retry of the request should occur with the new object given in the exception.
-
receive_other
Description copied from interface:ClientRequestInterceptorOperations
Allows an Interceptor to query the information available when a request results in something other than a normal reply or an exception. For example, a request could result in a retry (e.g., a GIOP Reply with aLOCATION_FORWARD
status was received); or on asynchronous calls, the reply does not immediately follow the request, but control shall return to the client and an ending interception point shall be called.For retries, depending on the policies in effect, a new request may or may not follow when a retry has been indicated. If a new request does follow, while this request is a new request, with respect to Interceptors, there is one point of correlation between the original request and the retry: because control has not returned to the client, the request scoped
PortableInterceptor.Current
for both the original request and the retrying request is the same.This interception point may throw a system exception. If it does, no other Interceptors'
receive_other
operations are called. The remaining Interceptors in the Flow Stack are popped and have theirreceive_exception
interception point called.This interception point may also throw a
ForwardRequest
exception. If an Interceptor throws this exception, successive Interceptors'receive_other
operations are called with the new information provided by theForwardRequest
exception.Compliant Interceptors shall properly follow
completion_status
semantics if they throw a system exception from this interception point. Thecompletion_status
shall beCOMPLETED_NO
. If the target invocation had completed, this interception point would not be called.- Specified by:
receive_other
in interfaceClientRequestInterceptorOperations
- Parameters:
ri
- Information about the current request being intercepted.
-
pre_init
Description copied from interface:ORBInitializerOperations
Called during ORB initialization. If it is expected that initial services registered by an interceptor will be used by other interceptors, then those initial services shall be registered at this point via calls toORBInitInfo.register_initial_reference
.- Specified by:
pre_init
in interfaceORBInitializerOperations
- Parameters:
info
- provides initialization attributes and operations by which Interceptors can be registered.
-
post_init
Description copied from interface:ORBInitializerOperations
Called during ORB initialization. If a service must resolve initial references as part of its initialization, it can assume that all initial references will be available at this point.Calling the
post_init
operations is not the final task of ORB initialization. The final task, following thepost_init
calls, is attaching the lists of registered interceptors to the ORB. Therefore, the ORB does not contain the interceptors during calls topost_init
. If an ORB-mediated call is made from withinpost_init
, no request interceptors will be invoked on that call. Likewise, if an operation is performed which causes an IOR to be created, no IOR interceptors will be invoked.- Specified by:
post_init
in interfaceORBInitializerOperations
- Parameters:
info
- provides initialization attributes and operations by which Interceptors can be registered.
-
isTransientException
-
isBadServerIdException
-