Class MessageBase
java.lang.Object
com.sun.corba.ee.impl.protocol.giopmsgheaders.MessageBase
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
Message_1_0, Message_1_1
This class acts as the base class for the various GIOP message types. This
also serves as a factory to create various message types. We currently
support GIOP 1.0, 1.1 and 1.2 message types.
- Version:
- 1.0
- Author:
- Ram Jeyaraman 05/14/2000
-
Field Summary
Fields inherited from interface Message
defaultBufferSize, FLAG_NO_FRAG_BIG_ENDIAN, GIOPBigMagic, GIOPCancelRequest, GIOPCloseConnection, GIOPFragment, GIOPLocateReply, GIOPLocateRequest, GIOPMessageError, GIOPMessageHeaderLength, GIOPReply, GIOPRequest, LITTLE_ENDIAN_BIT, MORE_FRAGMENTS_BIT, THREAD_POOL_TO_USE_MASK, TRAILING_TWO_BIT_BYTE_MASK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcallback(MessageHandler handler) static CancelRequestMessagecreateCancelRequest(GIOPVersion gv, int request_id) static Messagestatic LocateReplyMessagecreateLocateReply(ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, int locate_status, IOR ior) static LocateRequestMessagecreateLocateRequest(ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, byte[] object_key) static Messagestatic ReplyMessagecreateReply(ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, int reply_status, ServiceContexts service_contexts, IOR ior) static RequestMessagecreateRequest(ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, boolean response_expected, IOR ior, short addrDisp, String operation, ServiceContexts service_contexts, Principal requesting_principal) Return a Message's CorbaRequestId.bytestatic RequestIdgetRequestIdFromMessageBytes(Message message, ByteBuffer byteBuffer) Get the request id from the 4 bytes following the 12 byte GIOP request header if the request header exists.intstatic MessageBaseparseGiopHeader(ORB orb, Connection connection, ByteBuffer buf, int startPosition) voidsetEncodingVersion(byte version) static voidsetFlag(ByteBuffer byteBuffer, int flag) Set a flag in the given buffer (fragment bit, byte order bit, etc)booleanReturns true if this message could be followed by a fragment.static StringtypeToString(byte type) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Message
createFragmentMessage, getGIOPVersion, getSize, getType, isLittleEndian, moreFragmentsToFollow, read, setSize, write
-
Constructor Details
-
MessageBase
public MessageBase()
-
-
Method Details
-
typeToString
-
parseGiopHeader
public static MessageBase parseGiopHeader(ORB orb, Connection connection, ByteBuffer buf, int startPosition) -
createRequest
public static RequestMessage createRequest(ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, boolean response_expected, IOR ior, short addrDisp, String operation, ServiceContexts service_contexts, Principal requesting_principal) -
createReply
public static ReplyMessage createReply(ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, int reply_status, ServiceContexts service_contexts, IOR ior) -
createLocateRequest
public static LocateRequestMessage createLocateRequest(ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, byte[] object_key) -
createLocateReply
public static LocateReplyMessage createLocateReply(ORB orb, GIOPVersion gv, byte encodingVersion, int request_id, int locate_status, IOR ior) -
createCancelRequest
-
createCloseConnection
-
createMessageError
-
setFlag
Set a flag in the given buffer (fragment bit, byte order bit, etc)- Parameters:
byteBuffer- buffer to set flag inflag- flag to set
-
callback
- Specified by:
callbackin interfaceMessage- Throws:
IOException
-
getThreadPoolToUse
public int getThreadPoolToUse()- Specified by:
getThreadPoolToUsein interfaceMessage
-
getEncodingVersion
public byte getEncodingVersion()- Specified by:
getEncodingVersionin interfaceMessage
-
setEncodingVersion
public void setEncodingVersion(byte version) - Specified by:
setEncodingVersionin interfaceMessage
-
getCorbaRequestId
Return a Message's CorbaRequestId. NOTE: This method should be overridden for messages that support a 4 byte request id following the 12 byte GIOP message header.- Specified by:
getCorbaRequestIdin interfaceMessage- Returns:
- a Message's CorbaRequestId.
-
supportsFragments
public boolean supportsFragments()Returns true if this message could be followed by a fragment.- Specified by:
supportsFragmentsin interfaceMessage- Returns:
trueif Message supports fragmenting or is a message fragment. Otherwisefalseit does not support message fragments.
-
getRequestIdFromMessageBytes
Get the request id from the 4 bytes following the 12 byte GIOP request header if the request header exists. Otherwise, return 0.NOTE: Assumes Message already been filtered by MessageBase.messageSupportsFragments(Message)
- Parameters:
message- message to set ID ofbyteBuffer- buffer containing the request ID- Returns:
CorbaRequestIdifMessagesupports a 12 + 4 byte GIOP header. Otherwise returns a CorbaRequestId with an undefined request id.
-