code: public void init() {
          participantListener = new ParticipantListener(self, EVENT_INVITE, EVENT_ACTIVE, EVENT_INACTIVE, eventManager, this);
          inviteListener = new ServiceListener<String>(EVENT_INVITE, eventManager) {
              
              /**
               * If event data is of the format [session id]^[requester], this is an invitation
               * request. If event data is of the format [session id], it is a cancellation of a
               * previous request.
               */
              @Override
              public void eventCallback(String eventName, String eventData) {
                  String[] pcs = eventData.split("\\^", 2);
                  String tag = EVENT_INVITE + "_" + pcs[0];
                  CareWebShell shell = CareWebUtil.getShell();
                  
                  if (pcs.length == 2) {
                      String message = StrUtil.formatMessage("@cwf.chat.invitation.message", pcs[1]);
                      String caption = StrUtil.formatMessage("@cwf.chat.invitation.caption");
                      shell.getMessageWindow().showMessage(message, caption, null, 999999, tag, (event) -> {
                          eventManager.fireLocalEvent(EVENT_ACCEPT, pcs[0]);
                      });
                  } else {
                      shell.getMessageWindow().clearMessages(tag);
                  }
              }
          }
docs: Initialization of service.