Package jadex.bdiv3x.features
Class BDIXMessageComponentFeature
- java.lang.Object
-
- jadex.bridge.component.impl.AbstractComponentFeature
-
- jadex.bridge.component.impl.MessageComponentFeature
-
- jadex.bdiv3x.features.BDIXMessageComponentFeature
-
- All Implemented Interfaces:
IInternalBDIXMessageFeature
,IComponentFeature
,IMessageFeature
,jadex.bridge.component.impl.IInternalMessageFeature
public class BDIXMessageComponentFeature extends jadex.bridge.component.impl.MessageComponentFeature implements IInternalBDIXMessageFeature
Extension to allow message injection in agent methods.
-
-
Field Summary
Fields Modifier and Type Field Description static IComponentFeatureFactory
FACTORY
The factory.protected long
mevents_max
The maximum number of outstanding messages.protected java.util.List<RMessageEvent<java.lang.Object>>
sent_meventlist
Sent message tracking (insertion order).protected java.util.Map<RMessageEvent<java.lang.Object>,java.lang.Integer>
sent_mevents
Sent message tracking (msg->cnt).
-
Constructor Summary
Constructors Constructor Description BDIXMessageComponentFeature(IInternalAccess component, ComponentCreationInfo cinfo)
Create the feature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deregisterMessageEvent(RMessageEvent<java.lang.Object> msgevent)
Deregister a conversation or reply-with.RMessageEvent<java.lang.Object>
getInReplyMessageEvent(java.lang.Object message)
Find a message event that the given native message is a reply to.protected boolean
match(MMessageEvent msgevent, java.util.Map<java.lang.String,java.lang.Object> msg)
Match a message with a message event.protected int
matchMessageEvents(java.util.Map<java.lang.String,java.lang.Object> message, java.util.List<MMessageEvent> mevents, java.util.List<MMessageEvent> matched, java.util.List<MMessageEvent> events, int degree, boolean checkscope, java.lang.String scope)
Match message events with a message adapter.protected void
processUnhandledMessage(ISecurityInfo secinf, IMsgHeader header, java.lang.Object body)
Test if there are matching message events in XML description.void
registerMessageEvent(RMessageEvent<java.lang.Object> msgevent)
Register a conversation or reply-with to be able to send back answers to the source capability.-
Methods inherited from class jadex.bridge.component.impl.MessageComponentFeature
addInputConnection, addMessageHandler, addOutputConnection, createInputConnection, createOutputConnection, deserializeMessage, doSendMessage, findPreprocessor, generateConversationId, getAllTransports, getInitiatorConnections, getInputConnection, getMessageEvents, getMinLeaseTime, getOutputConnection, getParticipantConnections, getParticipantInputConnection, getParticipantOutputConnection, getPreprocessor, getSecurityService, getSerializationServices, getStreamCount, getTransportCache, handleMessage, handleStreamPacket, hasUserBody, init, initInputConnection, initOutputConnection, internalCreateInputConnection, internalCreateOutputConnection, isSecurityMessage, isTrusted, messageArrived, messageArrived, notifyMessageReceived, notifyMessageSent, preprocessMessage, removeInputConnection, removeMessageHandler, removeOutputConnection, sendMessage, sendMessage, sendMessage, sendMessageAndWait, sendMessageAndWait, sendReply, sendToAllTransports, sendToTransports, shutdown, startStreamCheckAliveBehavior, stopStreamCheckAliveBehavior, streamArrived
-
-
-
-
Field Detail
-
FACTORY
public static final IComponentFeatureFactory FACTORY
The factory.
-
sent_mevents
protected java.util.Map<RMessageEvent<java.lang.Object>,java.lang.Integer> sent_mevents
Sent message tracking (msg->cnt).
-
sent_meventlist
protected java.util.List<RMessageEvent<java.lang.Object>> sent_meventlist
Sent message tracking (insertion order).
-
mevents_max
protected long mevents_max
The maximum number of outstanding messages.
-
-
Constructor Detail
-
BDIXMessageComponentFeature
public BDIXMessageComponentFeature(IInternalAccess component, ComponentCreationInfo cinfo)
Create the feature.
-
-
Method Detail
-
processUnhandledMessage
protected void processUnhandledMessage(ISecurityInfo secinf, IMsgHeader header, java.lang.Object body)
Test if there are matching message events in XML description.- Overrides:
processUnhandledMessage
in classjadex.bridge.component.impl.MessageComponentFeature
-
matchMessageEvents
protected int matchMessageEvents(java.util.Map<java.lang.String,java.lang.Object> message, java.util.List<MMessageEvent> mevents, java.util.List<MMessageEvent> matched, java.util.List<MMessageEvent> events, int degree, boolean checkscope, java.lang.String scope)
Match message events with a message adapter.
-
match
protected boolean match(MMessageEvent msgevent, java.util.Map<java.lang.String,java.lang.Object> msg)
Match a message with a message event.- Parameters:
msgevent
- The message event.- Returns:
- True, if message matches the message event.
-
registerMessageEvent
public void registerMessageEvent(RMessageEvent<java.lang.Object> msgevent)
Register a conversation or reply-with to be able to send back answers to the source capability.- Specified by:
registerMessageEvent
in interfaceIInternalBDIXMessageFeature
- Parameters:
msgevent
- The message event.
-
deregisterMessageEvent
public void deregisterMessageEvent(RMessageEvent<java.lang.Object> msgevent)
Deregister a conversation or reply-with.- Specified by:
deregisterMessageEvent
in interfaceIInternalBDIXMessageFeature
- Parameters:
msgevent
- The message event.
-
getInReplyMessageEvent
public RMessageEvent<java.lang.Object> getInReplyMessageEvent(java.lang.Object message)
Find a message event that the given native message is a reply to.- Parameters:
message
- The (native) message.
-
-