cciGetBrokerInfo

이 함수는 현재 브로커 환경(예: 브로커 이름, 실행 그룹 이름 및 큐 관리자 이름에 대한 정보)을 조회합니다. 정보는 CCI_BROKER_INFO_ST 유형의 구조로 리턴됩니다.
주: CciNode* 핸들을 제공할 필요가 없고 이 함수는 메시지 플로우에 대한 어떠한 정보도 리턴하지 않는다는 점에서 cciGetBrokerInfo 함수는 기존의 cniGetBrokerInfo 함수와 다릅니다. 따라서 예를 들어 bipInitializeUserExits, bipGetMessageParserFactorybipGetMessageFlowNodeFactory와 같은 초기화 함수에서 cciGetBrokerInfo 함수를 호출할 수 있습니다.

구문

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

매개변수

returnCode(출력)
함수의 리턴 코드를 수신합니다(출력).
가능한 리턴 코드는 다음과 같습니다.
  • CCI_SUCCESS
  • CCI_INV_BROKER_INFO_ST
  • CCI_EXCEPTION
broker_info_st(출력)
완료 시 관련된 값으로 채울 CCI_BROKER_INFO_ST 구조의 주소입니다.

리턴 값

없음. 오류가 발생할 경우, returnCode 매개변수는 오류의 이유를 표시합니다.

  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);
}
관련 태스크
사용자 엑시트 개발
주의사항 | 등록상표 | 다운로드 | 라이브러리 | 지원 | 피드백
Copyright IBM Corporation 1999, 2006 마지막 갱신 날짜: 2006/08/21
as36040_