Class PINoOpHandlerImpl
java.lang.Object
com.sun.corba.ee.impl.interceptors.PINoOpHandlerImpl
- All Implemented Interfaces:
PIHandler
,Closeable
,AutoCloseable
This is No-Op implementation of PIHandler. It is used in ORBConfigurator
to initialize a piHandler before the Persistent Server Activation. This
PIHandler implementation will be replaced by the real PIHandler in
ORB.postInit( ) call.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
adapterManagerStateChanged
(int managerId, short newState) Called whenever a state change occurs in an adapter manager.void
adapterStateChanged
(ObjectReferenceTemplate[] templates, short newState) Called whenever a state change occurs in an object adapter that was not caused by an adapter manager state change.int
void
Invoked when a request is about to be cleaned up.void
Invoked when a request is about to be cleaned up.void
close()
create_policy
(int type, Any val) void
void
Called for pseudo-ops to temporarily disable portable interceptor hooks for calls on this thread.void
Called for pseudo-ops to re-enable portable interceptor hooks for calls on this thread.void
Complete the initialization of the PIHandler.void
initializeServerPIInfo
(MessageMediator request, ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp) Notifies PI to start a new server request and set initial information for server-side interceptors.void
initiateClientPIRequest
(boolean diiRequest) Invoked when a request is about to be created.invokeClientPIEndingPoint
(int replyStatus, Exception exception) Called when the appropriate client ending interception point is to be invoked for all apporpriate client-side request interceptors.void
Called when the send_request or send_poll portable interception point is to be invoked for all appropriate client-side request interceptors.void
invokeServerPIEndingPoint
(ReplyMessage replyMessage) Called when the appropriate server ending interception point is to be invoked for all appropriate server-side request interceptors.void
Called when the appropriate server intermediate interception point is to be invoked for all appropriate server-side request interceptors.void
Called when the appropriate server starting interception point is to be invoked for all appropriate server-side request interceptors.makeCompletedClientRequest
(int replyStatus, Exception exception) Called when a retry is needed after initiateClientPIRequest but before invokeClientPIRequest.void
Called when a new object adapter is created.void
register_interceptor
(Interceptor interceptor, int type) void
registerPolicyFactory
(int type, PolicyFactory factory) final void
void
setClientPIInfo
(RequestImpl requestImpl) Notifies PI of additional information for client-side interceptors.void
setClientPIInfo
(MessageMediator messageMediator) Notify PI of the MessageMediator for the request.void
setServerPIExceptionInfo
(Any exception) Notifies PI of additional information for server-side interceptors.void
setServerPIInfo
(Exception exception) Notifies PI of additional information required for ServerRequestInfo.void
setServerPIInfo
(Object servant, String targetMostDerivedInterface) Notifies PI of additional information reqired for ServerRequestInfo.void
setServerPIInfo
(Any result) Notifies PI of additional information for server-side interceptors.void
setServerPIInfo
(NVList arguments) Notifies PI of additional information for server-side interceptors.
-
Constructor Details
-
PINoOpHandlerImpl
public PINoOpHandlerImpl()
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
initialize
public void initialize()Description copied from interface:PIHandler
Complete the initialization of the PIHandler. This will execute the methods on the ORBInitializers, if any are defined. This must be done here so that the ORB can obtain the PIHandler BEFORE the ORBInitializers run, since they will need access to the PIHandler through the ORB.- Specified by:
initialize
in interfacePIHandler
-
destroyInterceptors
public void destroyInterceptors()- Specified by:
destroyInterceptors
in interfacePIHandler
-
objectAdapterCreated
Description copied from interface:PIHandler
Called when a new object adapter is created.- Specified by:
objectAdapterCreated
in interfacePIHandler
- Parameters:
oa
- The adapter associated with the interceptors to be invoked.
-
adapterManagerStateChanged
public void adapterManagerStateChanged(int managerId, short newState) Description copied from interface:PIHandler
Called whenever a state change occurs in an adapter manager.- Specified by:
adapterManagerStateChanged
in interfacePIHandler
- Parameters:
managerId
- managerId The adapter manager idnewState
- newState The new state of the adapter manager, and by implication of all object adapters managed by this manager.
-
adapterStateChanged
Description copied from interface:PIHandler
Called whenever a state change occurs in an object adapter that was not caused by an adapter manager state change.- Specified by:
adapterStateChanged
in interfacePIHandler
- Parameters:
templates
- The templates that are changing state.newState
- The new state of the adapters identified by the templates.
-
disableInterceptorsThisThread
public void disableInterceptorsThisThread()Description copied from interface:PIHandler
Called for pseudo-ops to temporarily disable portable interceptor hooks for calls on this thread. Keeps track of the number of times this is called and increments the disabledCount.- Specified by:
disableInterceptorsThisThread
in interfacePIHandler
-
enableInterceptorsThisThread
public void enableInterceptorsThisThread()Description copied from interface:PIHandler
Called for pseudo-ops to re-enable portable interceptor hooks for calls on this thread. Decrements the disabledCount. If disabledCount is 0, interceptors are re-enabled.- Specified by:
enableInterceptorsThisThread
in interfacePIHandler
-
invokeClientPIStartingPoint
Description copied from interface:PIHandler
Called when the send_request or send_poll portable interception point is to be invoked for all appropriate client-side request interceptors.- Specified by:
invokeClientPIStartingPoint
in interfacePIHandler
- Throws:
RemarshalException
- - Thrown when this request needs to be retried.
-
invokeClientPIEndingPoint
Description copied from interface:PIHandler
Called when the appropriate client ending interception point is to be invoked for all apporpriate client-side request interceptors.- Specified by:
invokeClientPIEndingPoint
in interfacePIHandler
- Parameters:
replyStatus
- One of the constants in iiop.messages.ReplyMessage indicating which reply status to set.exception
- The exception before ending interception points have been invoked, or null if no exception at the moment.- Returns:
- The exception to be thrown, after having gone through all ending points, or null if there is no exception to be thrown. Note that this exception can be either the same or different from the exception set using setClientPIException. There are four possible return types: null (no exception), SystemException, UserException, or RemarshalException.
-
makeCompletedClientRequest
Description copied from interface:PIHandler
Called when a retry is needed after initiateClientPIRequest but before invokeClientPIRequest. In this case, we need to properly balance initiateClientPIRequest/cleanupClientPIRequest calls, but WITHOUT extraneous calls to invokeClientPIEndingPoint (see bug 6763340).- Specified by:
makeCompletedClientRequest
in interfacePIHandler
- Parameters:
replyStatus
- One of the constants in iiop.messages.ReplyMessage indicating which reply status to set.exception
- The exception before ending interception points have been invoked, or null if no exception at the moment.- Returns:
- The exception to be thrown, after having gone through all ending points, or null if there is no exception to be thrown. Note that this exception can be either the same or different from the exception set using setClientPIException. There are four possible return types: null (no exception), SystemException, UserException, or RemarshalException.
-
initiateClientPIRequest
public void initiateClientPIRequest(boolean diiRequest) Description copied from interface:PIHandler
Invoked when a request is about to be created. Must be called before any of the setClientPI* methods so that a new info object can be prepared for information collection.- Specified by:
initiateClientPIRequest
in interfacePIHandler
- Parameters:
diiRequest
- True if this is to be a DII request, or false if it is a "normal" request. In the DII case, initiateClientPIRequest is called twice and we need to ignore the second one.
-
cleanupClientPIRequest
public void cleanupClientPIRequest()Description copied from interface:PIHandler
Invoked when a request is about to be cleaned up. Must be called after ending points are called so that the info object on the stack can be deinitialized and popped from the stack at the appropriate time.- Specified by:
cleanupClientPIRequest
in interfacePIHandler
-
setClientPIInfo
Description copied from interface:PIHandler
Notify PI of the MessageMediator for the request.- Specified by:
setClientPIInfo
in interfacePIHandler
- Parameters:
messageMediator
- Mediator to notify
-
setClientPIInfo
Description copied from interface:PIHandler
Notifies PI of additional information for client-side interceptors. PI will use this information as a source of information for the ClientRequestInfo object.- Specified by:
setClientPIInfo
in interfacePIHandler
- Parameters:
requestImpl
- request used as source of information
-
sendCancelRequestIfFinalFragmentNotSent
public final void sendCancelRequestIfFinalFragmentNotSent() -
invokeServerPIStartingPoint
public void invokeServerPIStartingPoint()Description copied from interface:PIHandler
Called when the appropriate server starting interception point is to be invoked for all appropriate server-side request interceptors.- Specified by:
invokeServerPIStartingPoint
in interfacePIHandler
-
invokeServerPIIntermediatePoint
public void invokeServerPIIntermediatePoint()Description copied from interface:PIHandler
Called when the appropriate server intermediate interception point is to be invoked for all appropriate server-side request interceptors.- Specified by:
invokeServerPIIntermediatePoint
in interfacePIHandler
-
invokeServerPIEndingPoint
Description copied from interface:PIHandler
Called when the appropriate server ending interception point is to be invoked for all appropriate server-side request interceptors.- Specified by:
invokeServerPIEndingPoint
in interfacePIHandler
- Parameters:
replyMessage
- The iiop.messages.ReplyMessage containing the reply status.
-
setServerPIInfo
Description copied from interface:PIHandler
Notifies PI of additional information required for ServerRequestInfo.- Specified by:
setServerPIInfo
in interfacePIHandler
- Parameters:
exception
- the exception that will be returned
-
setServerPIInfo
Description copied from interface:PIHandler
Notifies PI of additional information for server-side interceptors. PI will use this information as a source of information for the ServerRequestInfo object. These are the arguments for a DSI request.- Specified by:
setServerPIInfo
in interfacePIHandler
- Parameters:
arguments
- Arguments for a DSI request.
-
setServerPIExceptionInfo
Description copied from interface:PIHandler
Notifies PI of additional information for server-side interceptors. PI will use this information as a source of information for the ServerRequestInfo object. This is the exception of a DSI request.- Specified by:
setServerPIExceptionInfo
in interfacePIHandler
- Parameters:
exception
- Exception of a DSI request
-
setServerPIInfo
Description copied from interface:PIHandler
Notifies PI of additional information for server-side interceptors. PI will use this information as a source of information for the ServerRequestInfo object. This is the result of a DSI request.- Specified by:
setServerPIInfo
in interfacePIHandler
- Parameters:
result
- Result of a DSI request
-
initializeServerPIInfo
public void initializeServerPIInfo(MessageMediator request, ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp) Description copied from interface:PIHandler
Notifies PI to start a new server request and set initial information for server-side interceptors. PI will use this information as a source of information for the ServerRequestInfo object. poaimpl is declared as an Object so that we need not introduce a dependency on the POA package.- Specified by:
initializeServerPIInfo
in interfacePIHandler
- Parameters:
request
- Request holder, included the Connectionoa
- Object AdapterobjectId
- id of objectoktemp
- template for object
-
setServerPIInfo
Description copied from interface:PIHandler
Notifies PI of additional information reqired for ServerRequestInfo.- Specified by:
setServerPIInfo
in interfacePIHandler
- Parameters:
servant
- The servant. This is java.lang.Object because in the POA case, this will be a org.omg.PortableServer.Servant whereas in the ServerRequestDispatcher case this will be an ObjectImpl.targetMostDerivedInterface
- The most derived interface. This is passed in instead of calculated when needed because it requires extra information in the POA case that we didn't want to bother creating extra methods for to pass in.
-
cleanupServerPIRequest
public void cleanupServerPIRequest()Description copied from interface:PIHandler
Invoked when a request is about to be cleaned up. Must be called after ending points are called so that the info object on the stack can be deinitialized and popped from the stack at the appropriate time.- Specified by:
cleanupServerPIRequest
in interfacePIHandler
-
register_interceptor
- Specified by:
register_interceptor
in interfacePIHandler
- Throws:
DuplicateName
-
getPICurrent
- Specified by:
getPICurrent
in interfacePIHandler
-
create_policy
- Specified by:
create_policy
in interfacePIHandler
- Throws:
PolicyError
-
registerPolicyFactory
- Specified by:
registerPolicyFactory
in interfacePIHandler
-
allocateServerRequestId
public int allocateServerRequestId()- Specified by:
allocateServerRequestId
in interfacePIHandler
-