Beginn der Änderung

cciGetBrokerInfo

Diese Funktion fragt die aktuelle Broker-Umgebung ab (z. B. nach Informationen zum Broker-, Ausführungsgruppen- und WS-Managernamen). Die Informationen werden in einer Struktur des Typs CCI_BROKER_INFO_ST zurückgegeben.
Anmerkung: Dies unterscheidet sich von der bestehenden Funktion cniGetBrokerInfo dahingehend, dass keine interne CciNode*-Kennung angegeben werden muss und von cciGetBrokerInfo keine Informationen zu einem Nachrichtenfluss geliefert werden. Folglich kann cciGetBrokerInfo von Initialisierungsfunktionen aufgerufen werden, beispielsweise bipInitializeUserExits, bipGetMessageParserFactory und bipGetMessageFlowNodeFactory.

Syntax

void cciGetBrokerInfo(
int*                   returnCode,
CCI_BROKER_INFO_ST* broker_info_st);

Parameter

Rückkehrcode (Ausgabe)
Empfängt den Rückkehrcode von der Funktion (Ausgabe).
Mögliche Rückkehrcodes sind:
  • CCI_SUCCESS
  • CCI_INV_BROKER_INFO_ST
  • CCI_EXCEPTION
broker_info_st(Ausgabe)
Die Adresse einer CCI_BROKER_INFO_ST-Struktur, die bei einem erfolgreichen Abschluss mit den relevanten Werten gefüllt werden soll.

Rückgabewerte

Keine. Wenn ein Fehler auftritt, gibt der Parameter returnCode die Fehlerursache an.

Beispiel

int          rc = CCI_SUCCESS;
CCI_BROKER_INFO_ST brokerInfo = {CCI_BROKER_INFO_ST_DEFAULT};
#define INTITIAL_STR_LEN 256
CciChar brokerNameStr[INTITIAL_STR_LEN];
CciChar executionGroupNameStr[INTITIAL_STR_LEN];
CciChar queueManagerNameStr[INTITIAL_STR_LEN];
brokerInfo.brokerName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.brokerName.buffer = brokerNameStr;
brokerInfo.executionGroupName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.executionGroupName.buffer = executionGroupNameStr;
brokerInfo.queueManagerName.bufferLength = INTITIAL_STR_LEN;
brokerInfo.queueManagerName.buffer = queueManagerNameStr;
cciGetBrokerInfo(&rc,&brokerInfo);
/* just in case any of the buffers were too short*/
if ((brokerInfo.brokerName.bytesOutput < brokerInfo.brokerName.dataLength) ||
(brokerInfo.executionGroupName.bytesOutput < brokerInfo.executionGroupName.dataLength) ||
(brokerInfo.queueManagerName.bytesOutput < brokerInfo.queueManagerName.dataLength)) {
/*at least one of the buffer were too short, need to rerty*/
/* NOTE this is unlikely given that the initial sizes were reasonably large*/
brokerInfo.brokerName.bufferLength =
brokerInfo.brokerName.dataLength;
brokerInfo.brokerName.buffer =
(CciChar*)malloc (brokerInfo.brokerName.bufferLength * sizeof(CciChar));
brokerInfo.executionGroupName.bufferLength =
brokerInfo.executionGroupName.dataLength;
brokerInfo.executionGroupName.buffer =
(CciChar*)malloc (brokerInfo.executionGroupName.bufferLength * sizeof(CciChar));
brokerInfo.queueManagerName.bufferLength =
brokerInfo.queueManagerName.dataLength;
brokerInfo.queueManagerName.buffer =
(CciChar*)malloc (brokerInfo.queueManagerName.bufferLength * sizeof(CciChar));
cciGetBrokerInfo(&rc,&brokerInfo);
/*now do something sensible with these strings before the buffers go out of scope*/
/* for example call a user written function to copy them away*/
copyBrokerInfo(brokerInfo.brokerName.buffer,
brokerInfo.executionGroupName.buffer,
brokerInfo.queueManagerName.buffer);
free((void*)brokerInfo.brokerName.buffer);
free((void*)brokerInfo.executionGroupName.buffer);
free((void*)brokerInfo.queueManagerName.buffer);
}else{
/*now do something sensible with these strings before the buffers go out of scope*/
/* for example call a user written function to copy them away*/
copyBrokerInfo(brokerInfo.brokerName.buffer,
brokerInfo.executionGroupName.buffer,
brokerInfo.queueManagerName.buffer);
}
Zugehörige Konzepte
Benutzerexits entwickeln
Zugehörige Tasks
Benutzerexit entwickeln
Bemerkungen | Marken | Downloads | Bibliothek | Unterstützung | Rückmeldung
Copyright IBM Corporation 1999, 2006 Letzte Aktualisierung: 18.05.2006
as36040_


Ende der Änderung