Package com.sun.corba.se.impl.protocol
Class CorbaMessageMediatorImpl
java.lang.Object
com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl
- All Implemented Interfaces:
MessageHandler,MessageMediator,ProtocolHandler,CorbaMessageMediator,CorbaProtocolHandler,ResponseHandler
public class CorbaMessageMediatorImpl
extends Object
implements CorbaMessageMediator, CorbaProtocolHandler, MessageHandler
- Author:
- Harold Carr
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected shortprotected booleanprotected CorbaConnectionprotected CorbaContactInfoprotected Requestprotected ByteBufferprotected Messageprotected CDRInputObjectprotected InterceptorsSystemExceptionprotected booleanprotected Messageprotected ORBprotected CDROutputObjectprotected ProtocolHandlerprotected Stringprotected LocateReplyOrReplyMessageprotected IORprotected RequestMessageprotected Integerprotected byteprotected booleanprotected ORBUtilSystemException -
Constructor Summary
ConstructorsConstructorDescriptionCorbaMessageMediatorImpl(ORB orb, Connection connection) CorbaMessageMediatorImpl(ORB orb, ContactInfo contactInfo, Connection connection, GIOPVersion giopVersion, IOR ior, int requestId, short addrDisposition, String operationName, boolean isOneWay) CorbaMessageMediatorImpl(ORB orb, CorbaConnection connection, Message dispatchHeader, ByteBuffer byteBuffer) -
Method Summary
Modifier and TypeMethodDescriptionprotected SystemExceptionconvertThrowableToSystemException(Throwable throwable, CompletionStatus completionStatus) Called by the servant during a method invocation.createLocationForward(CorbaMessageMediator messageMediator, IOR ior, ServiceContexts svc) Called by the servant during a method invocation.createResponse(CorbaMessageMediator messageMediator, ServiceContexts svc) protected CorbaMessageMediatorcreateResponseHelper(CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior) protected CorbaMessageMediatorcreateResponseHelper(CorbaMessageMediator messageMediator, ServiceContexts svc) protected CorbaMessageMediatorcreateResponseHelper(CorbaMessageMediator messageMediator, ServiceContexts svc, boolean user) createSystemExceptionResponse(CorbaMessageMediator messageMediator, SystemException ex, ServiceContexts svc) createUnknownExceptionResponse(CorbaMessageMediator messageMediator, UnknownException ex) createUserExceptionResponse(CorbaMessageMediator messageMediator, ServiceContexts svc) booleanbooleanbooleanvoidUsed to send the message (or its last fragment).shortshortTheBrokerassociated with an invocation.Get theConnectionon which this message is sent or received.Get theContactInfowhich created thisMessageMediator.byteUsed to get theInputObjectused for the message.Used to get theOutputObjectused for the message.intprotected ServiceContextsgetServiceContextsForReply(CorbaMessageMediator messageMediator, ServiceContexts contexts) bytebyteIf the RMI-IIOP maximum stream format version service context is present, it indicates the maximum stream format version we could use for the reply.intprotected voidhandleAddressingDisposition(CorbaMessageMediator messageMediator, AddressingDispositionException ex) voidhandleDIIReply(InputStream inputStream) voidhandleInput(CancelRequestMessage header) voidhandleInput(FragmentMessage_1_1 header) voidhandleInput(FragmentMessage_1_2 header) voidhandleInput(LocateReplyMessage_1_0 header) voidhandleInput(LocateReplyMessage_1_1 header) voidhandleInput(LocateReplyMessage_1_2 header) voidhandleInput(LocateRequestMessage_1_0 header) voidhandleInput(LocateRequestMessage_1_1 header) voidhandleInput(LocateRequestMessage_1_2 header) voidhandleInput(Message header) Used for message types for which we don't have concrete classes, yet, such as CloseConnection and MessageError, as well as unknown types.voidhandleInput(ReplyMessage_1_0 header) voidhandleInput(ReplyMessage_1_1 header) voidhandleInput(ReplyMessage_1_2 header) voidhandleInput(RequestMessage_1_0 header) voidhandleInput(RequestMessage_1_1 header) voidhandleInput(RequestMessage_1_2 header) protected voidhandleLocateRequest(CorbaMessageMediator messageMediator) voidhandleRequest(LocateRequestMessage msg, CorbaMessageMediator messageMediator) voidhandleRequest(RequestMessage msg, CorbaMessageMediator messageMediator) booleanhandleRequest(MessageMediator messageMediator) This method determines the type of an incoming message and dispatches it appropriately.protected voidhandleRequestRequest(CorbaMessageMediator messageMediator) voidhandleThrowableDuringServerDispatch(CorbaMessageMediator messageMediator, Throwable throwable, CompletionStatus completionStatus) protected voidhandleThrowableDuringServerDispatch(CorbaMessageMediator messageMediator, Throwable throwable, CompletionStatus completionStatus, int iteration) voidUsed to initialize message headers.booleanbooleanbooleanbooleanisOneWay()booleanbooleanprotected StringopAndId(CorbaMessageMediator mediator) protected voidrunInterceptors(CorbaMessageMediator messageMediator, ReplyMessage reply) protected voidrunRemoveThreadInfo(CorbaMessageMediator messageMediator) protected voidrunServantPostInvoke(CorbaMessageMediator messageMediator) voidbooleanbooleanvoidsetDIIException(Exception exception) voidsetDIIInfo(Request diiRequest) voidsetDispatchBuffer(ByteBuffer byteBuffer) voidsetDispatchHeader(Message msg) voidsetExecutePIInResponseConstructor(boolean b) voidvoidsetExecuteReturnServantInResponseConstructor(boolean b) voidsetInputObject(InputObject inputObject) Used to set theInputObjectused for the message.voidsetOutputObject(OutputObject outputObject) Used to set theOutputObjectused for the message.voidsetProtocolHandler(CorbaProtocolHandler protocolHandler) voidsetReplyExceptionDetailMessage(String message) voidunmarshalDIIUserException(String repoId, InputStream is) Used to wait for a response for synchronous messages.
-
Field Details
-
orb
-
wrapper
-
interceptorWrapper
-
contactInfo
-
connection
-
addrDisposition
protected short addrDisposition -
outputObject
-
inputObject
-
messageHeader
-
requestHeader
-
replyHeader
-
replyExceptionDetailMessage
-
replyIOR
-
requestIdInteger
-
dispatchHeader
-
dispatchByteBuffer
-
streamFormatVersion
protected byte streamFormatVersion -
streamFormatVersionSet
protected boolean streamFormatVersionSet -
diiRequest
-
cancelRequestAlreadySent
protected boolean cancelRequestAlreadySent -
protocolHandler
-
_executeReturnServantInResponseConstructor
protected boolean _executeReturnServantInResponseConstructor -
_executeRemoveThreadInfoInResponseConstructor
protected boolean _executeRemoveThreadInfoInResponseConstructor -
_executePIInResponseConstructor
protected boolean _executePIInResponseConstructor -
isThreadDone
protected boolean isThreadDone
-
-
Constructor Details
-
CorbaMessageMediatorImpl
public CorbaMessageMediatorImpl(ORB orb, ContactInfo contactInfo, Connection connection, GIOPVersion giopVersion, IOR ior, int requestId, short addrDisposition, String operationName, boolean isOneWay) -
CorbaMessageMediatorImpl
-
CorbaMessageMediatorImpl
public CorbaMessageMediatorImpl(ORB orb, CorbaConnection connection, Message dispatchHeader, ByteBuffer byteBuffer)
-
-
Method Details
-
getBroker
Description copied from interface:MessageMediatorTheBrokerassociated with an invocation.- Specified by:
getBrokerin interfaceMessageMediator- Returns:
Broker
-
getContactInfo
Description copied from interface:MessageMediatorGet theContactInfowhich created thisMessageMediator.- Specified by:
getContactInfoin interfaceMessageMediator- Returns:
ContactInfo
-
getConnection
Description copied from interface:MessageMediatorGet theConnectionon which this message is sent or received.- Specified by:
getConnectionin interfaceMessageMediator
-
initializeMessage
public void initializeMessage()Description copied from interface:MessageMediatorUsed to initialize message headers. Note: this should be moved to aRequestDispatcher.- Specified by:
initializeMessagein interfaceMessageMediator
-
finishSendingRequest
public void finishSendingRequest()Description copied from interface:MessageMediatorUsed to send the message (or its last fragment). Note: this should be moved to aRequestDispatcher.- Specified by:
finishSendingRequestin interfaceMessageMediator
-
waitForResponse
Description copied from interface:MessageMediatorUsed to wait for a response for synchronous messages.- Specified by:
waitForResponsein interfaceMessageMediator
-
setOutputObject
Description copied from interface:MessageMediatorUsed to set theOutputObjectused for the message.- Specified by:
setOutputObjectin interfaceMessageMediator
-
getOutputObject
Description copied from interface:MessageMediatorUsed to get theOutputObjectused for the message.- Specified by:
getOutputObjectin interfaceMessageMediator- Returns:
OutputObject
-
setInputObject
Description copied from interface:MessageMediatorUsed to set theInputObjectused for the message.- Specified by:
setInputObjectin interfaceMessageMediator
-
getInputObject
Description copied from interface:MessageMediatorUsed to get theInputObjectused for the message.- Specified by:
getInputObjectin interfaceMessageMediator- Returns:
InputObject
-
setReplyHeader
- Specified by:
setReplyHeaderin interfaceCorbaMessageMediator
-
getLocateReplyHeader
- Specified by:
getLocateReplyHeaderin interfaceCorbaMessageMediator
-
getReplyHeader
- Specified by:
getReplyHeaderin interfaceCorbaMessageMediator
-
setReplyExceptionDetailMessage
- Specified by:
setReplyExceptionDetailMessagein interfaceCorbaMessageMediator
-
getRequestHeader
- Specified by:
getRequestHeaderin interfaceCorbaMessageMediator
-
getGIOPVersion
- Specified by:
getGIOPVersionin interfaceCorbaMessageMediator
-
getEncodingVersion
public byte getEncodingVersion()- Specified by:
getEncodingVersionin interfaceCorbaMessageMediator
-
getRequestId
public int getRequestId()- Specified by:
getRequestIdin interfaceCorbaMessageMediator
-
getRequestIdInteger
- Specified by:
getRequestIdIntegerin interfaceCorbaMessageMediator
-
isOneWay
public boolean isOneWay()- Specified by:
isOneWayin interfaceCorbaMessageMediator
-
getAddrDisposition
public short getAddrDisposition()- Specified by:
getAddrDispositionin interfaceCorbaMessageMediator
-
getOperationName
- Specified by:
getOperationNamein interfaceCorbaMessageMediator
-
getRequestServiceContexts
- Specified by:
getRequestServiceContextsin interfaceCorbaMessageMediator
-
getReplyServiceContexts
- Specified by:
getReplyServiceContextsin interfaceCorbaMessageMediator
-
sendCancelRequestIfFinalFragmentNotSent
public void sendCancelRequestIfFinalFragmentNotSent()- Specified by:
sendCancelRequestIfFinalFragmentNotSentin interfaceCorbaMessageMediator
-
sentFullMessage
public boolean sentFullMessage() -
sentFragment
public boolean sentFragment() -
setDIIInfo
- Specified by:
setDIIInfoin interfaceCorbaMessageMediator
-
isDIIRequest
public boolean isDIIRequest()- Specified by:
isDIIRequestin interfaceCorbaMessageMediator
-
unmarshalDIIUserException
- Specified by:
unmarshalDIIUserExceptionin interfaceCorbaMessageMediator
-
setDIIException
- Specified by:
setDIIExceptionin interfaceCorbaMessageMediator
-
handleDIIReply
- Specified by:
handleDIIReplyin interfaceCorbaMessageMediator
-
getDispatchHeader
- Specified by:
getDispatchHeaderin interfaceCorbaMessageMediator
-
setDispatchHeader
- Specified by:
setDispatchHeaderin interfaceCorbaMessageMediator
-
getDispatchBuffer
- Specified by:
getDispatchBufferin interfaceCorbaMessageMediator
-
setDispatchBuffer
- Specified by:
setDispatchBufferin interfaceCorbaMessageMediator
-
getThreadPoolToUse
public int getThreadPoolToUse()- Specified by:
getThreadPoolToUsein interfaceCorbaMessageMediator
-
getStreamFormatVersion
public byte getStreamFormatVersion()- Specified by:
getStreamFormatVersionin interfaceCorbaMessageMediator
-
getStreamFormatVersionForReply
public byte getStreamFormatVersionForReply()If the RMI-IIOP maximum stream format version service context is present, it indicates the maximum stream format version we could use for the reply. If it isn't present, the default is 2 for GIOP 1.3 or greater, 1 for lower. This is only sent on requests. Clients can find out the server's maximum by looking for a tagged component in the IOR.- Specified by:
getStreamFormatVersionForReplyin interfaceCorbaMessageMediator
-
isSystemExceptionReply
public boolean isSystemExceptionReply()- Specified by:
isSystemExceptionReplyin interfaceCorbaMessageMediator
-
isUserExceptionReply
public boolean isUserExceptionReply()- Specified by:
isUserExceptionReplyin interfaceCorbaMessageMediator
-
isLocationForwardReply
public boolean isLocationForwardReply()- Specified by:
isLocationForwardReplyin interfaceCorbaMessageMediator
-
isDifferentAddrDispositionRequestedReply
public boolean isDifferentAddrDispositionRequestedReply()- Specified by:
isDifferentAddrDispositionRequestedReplyin interfaceCorbaMessageMediator
-
getAddrDispositionReply
public short getAddrDispositionReply()- Specified by:
getAddrDispositionReplyin interfaceCorbaMessageMediator
-
getForwardedIOR
- Specified by:
getForwardedIORin interfaceCorbaMessageMediator
-
getSystemExceptionReply
- Specified by:
getSystemExceptionReplyin interfaceCorbaMessageMediator
-
getObjectKey
- Specified by:
getObjectKeyin interfaceCorbaMessageMediator
-
setProtocolHandler
- Specified by:
setProtocolHandlerin interfaceCorbaMessageMediator
-
getProtocolHandler
- Specified by:
getProtocolHandlerin interfaceCorbaMessageMediator
-
createReply
Description copied from interface:ResponseHandlerCalled by the servant during a method invocation. The servant should call this method to create a reply marshal buffer if no exception occurred.- Specified by:
createReplyin interfaceCorbaMessageMediator- Specified by:
createReplyin interfaceResponseHandler- Returns:
- an OutputStream suitable for marshalling the reply.
- See Also:
-
createExceptionReply
Description copied from interface:ResponseHandlerCalled by the servant during a method invocation. The servant should call this method to create a reply marshal buffer if a user exception occurred.- Specified by:
createExceptionReplyin interfaceCorbaMessageMediator- Specified by:
createExceptionReplyin interfaceResponseHandler- Returns:
- an OutputStream suitable for marshalling the exception ID and the user exception body.
-
executeReturnServantInResponseConstructor
public boolean executeReturnServantInResponseConstructor()- Specified by:
executeReturnServantInResponseConstructorin interfaceCorbaMessageMediator
-
setExecuteReturnServantInResponseConstructor
public void setExecuteReturnServantInResponseConstructor(boolean b) - Specified by:
setExecuteReturnServantInResponseConstructorin interfaceCorbaMessageMediator
-
executeRemoveThreadInfoInResponseConstructor
public boolean executeRemoveThreadInfoInResponseConstructor()- Specified by:
executeRemoveThreadInfoInResponseConstructorin interfaceCorbaMessageMediator
-
setExecuteRemoveThreadInfoInResponseConstructor
public void setExecuteRemoveThreadInfoInResponseConstructor(boolean b) - Specified by:
setExecuteRemoveThreadInfoInResponseConstructorin interfaceCorbaMessageMediator
-
executePIInResponseConstructor
public boolean executePIInResponseConstructor()- Specified by:
executePIInResponseConstructorin interfaceCorbaMessageMediator
-
setExecutePIInResponseConstructor
public void setExecutePIInResponseConstructor(boolean b) - Specified by:
setExecutePIInResponseConstructorin interfaceCorbaMessageMediator
-
handleRequest
Description copied from interface:ProtocolHandlerThis method determines the type of an incoming message and dispatches it appropriately. For example, on the server side, it may find aServerRequestDispatcherto handle the request. On the client-side it may signal a waiting thread to handle a reply.- Specified by:
handleRequestin interfaceProtocolHandler- Returns:
- deprecated
-
handleInput
Description copied from interface:MessageHandlerUsed for message types for which we don't have concrete classes, yet, such as CloseConnection and MessageError, as well as unknown types.- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
handleInput
- Specified by:
handleInputin interfaceMessageHandler- Throws:
IOException
-
opAndId
-
handleRequest
- Specified by:
handleRequestin interfaceCorbaProtocolHandler
-
handleRequest
- Specified by:
handleRequestin interfaceCorbaProtocolHandler
-
handleRequestRequest
-
handleLocateRequest
-
handleThrowableDuringServerDispatch
public void handleThrowableDuringServerDispatch(CorbaMessageMediator messageMediator, Throwable throwable, CompletionStatus completionStatus) - Specified by:
handleThrowableDuringServerDispatchin interfaceCorbaProtocolHandler
-
handleThrowableDuringServerDispatch
protected void handleThrowableDuringServerDispatch(CorbaMessageMediator messageMediator, Throwable throwable, CompletionStatus completionStatus, int iteration) -
convertThrowableToSystemException
protected SystemException convertThrowableToSystemException(Throwable throwable, CompletionStatus completionStatus) -
handleAddressingDisposition
protected void handleAddressingDisposition(CorbaMessageMediator messageMediator, AddressingDispositionException ex) -
createResponse
public CorbaMessageMediator createResponse(CorbaMessageMediator messageMediator, ServiceContexts svc) - Specified by:
createResponsein interfaceCorbaProtocolHandler
-
createUserExceptionResponse
public CorbaMessageMediator createUserExceptionResponse(CorbaMessageMediator messageMediator, ServiceContexts svc) - Specified by:
createUserExceptionResponsein interfaceCorbaProtocolHandler
-
createUnknownExceptionResponse
public CorbaMessageMediator createUnknownExceptionResponse(CorbaMessageMediator messageMediator, UnknownException ex) - Specified by:
createUnknownExceptionResponsein interfaceCorbaProtocolHandler
-
createSystemExceptionResponse
public CorbaMessageMediator createSystemExceptionResponse(CorbaMessageMediator messageMediator, SystemException ex, ServiceContexts svc) - Specified by:
createSystemExceptionResponsein interfaceCorbaProtocolHandler
-
createLocationForward
public CorbaMessageMediator createLocationForward(CorbaMessageMediator messageMediator, IOR ior, ServiceContexts svc) - Specified by:
createLocationForwardin interfaceCorbaProtocolHandler
-
createResponseHelper
protected CorbaMessageMediator createResponseHelper(CorbaMessageMediator messageMediator, ServiceContexts svc) -
createResponseHelper
protected CorbaMessageMediator createResponseHelper(CorbaMessageMediator messageMediator, ServiceContexts svc, boolean user) -
createResponseHelper
protected CorbaMessageMediator createResponseHelper(CorbaMessageMediator messageMediator, ReplyMessage reply, IOR ior) -
runServantPostInvoke
-
runInterceptors
-
runRemoveThreadInfo
-
getServiceContextsForReply
protected ServiceContexts getServiceContextsForReply(CorbaMessageMediator messageMediator, ServiceContexts contexts)
-