MsgUnitRaw[] msgUnitRawArr = new MsgUnitRaw[msgArr.length];
// We export/encrypt the message (call the interceptor)
if (securityInterceptor != null) {
for (int i=0; i<msgArr.length; i++) {
CryptDataHolder dataHolder = new CryptDataHolder(MethodName.PUBLISH, msgArr[i].getMsgUnitRaw());
msgUnitRawArr[i] = securityInterceptor.exportMessage(dataHolder);
}
if (log.isLoggable(Level.FINE)) log.fine("Exported/encrypted " + msgArr.length + " publish messages.");
}
else {
log.warning("No session security context, sending " + msgArr.length + " publish messages without encryption");
for (int i=0; i<msgArr.length; i++) {
msgUnitRawArr[i] = msgArr[i].getMsgUnitRaw();
}
}
if (MethodName.PUBLISH_ONEWAY == msgArr_[0].getMethodName()) {
this.driver.publishOneway(msgUnitRawArr);
connectionsHandler.getDispatchStatistic().incrNumPublish(msgUnitRawArr.length);
if (log.isLoggable(Level.FINE)) log.fine("Success, sent " + msgArr.length + " oneway publish messages.");
if (cp != null) {
for (int i=0; i<msgArr.length; i++) {
cp.passingBy(I_Checkpoint.CP_CONNECTION_PUBLISH_ACK, msgArr[i],
null, this.checkPointContext);
}
}
return;
}
if (log.isLoggable(Level.FINE)) log.fine("Before publish " + msgArr.length + " acknowledged messages ...");
String[] rawReturnVal = this.driver.publishArr(msgUnitRawArr);
if (rawReturnVal == null) {
String text = "driver.publishArr len= " + msgUnitRawArr.length + " returned null: " + ((msgUnitRawArr.length>0)?msgUnitRawArr[0].getKey():"");
throw new XmlBlasterException(glob, ErrorCode.COMMUNICATION_NOCONNECTION, ME, text);
}
connectionsHandler.getDispatchStatistic().incrNumPublish(rawReturnVal.length);
if (log.isLoggable(Level.FINE)) log.fine("Success, sent " + msgArr.length + " acknowledged publish messages, return value #1 is '" + rawReturnVal[0] + "'");
if (rawReturnVal != null) {
for (int i=0; i<rawReturnVal.length; i++) {
if (cp != null) {
MsgQueuePublishEntry publishEntry = (MsgQueuePublishEntry)msgArr_[i];
cp.passingBy(I_Checkpoint.CP_CONNECTION_PUBLISH_ACK, publishEntry.getMsgUnit(),
null, this.checkPointContext);
}
if (!msgArr_[i].wantReturnObj())
continue;
if (securityInterceptor != null) {
CryptDataHolder dataHolder = new CryptDataHolder(MethodName.PUBLISH, new MsgUnitRaw(null, (byte[])null, rawReturnVal[i]));
dataHolder.setReturnValue(true);
rawReturnVal[i] = securityInterceptor.importMessage(dataHolder).getQos();
}
// create return object
try {