Initialize the session and create the mime message.

@return the mime message
766548
private MimeMessage createMimeMessage() {
		// prepare the message
		Session session = Session.getInstance(properties, authenticator);
		return new MimeMessage(session);
	}
22489
@Override
    public Session createSession() throws JMSException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createSession");

        Session session = null;
        try {
            session = createSession(false, Session.AUTO_ACKNOWLEDGE);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createSession");
        }

        return session;
    }
1093089
public JsJmsBytesMessage createJmsBytesMessage() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createJmsBytesMessage");
    JsJmsBytesMessage msg = null;
    try {
      msg = new JsJmsBytesMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createJmsBytesMessage");
    return msg;
  }
1338665
public static ContentType create(final String mimeType, final Charset charset) {
        if (mimeType == null) {
            throw new IllegalArgumentException("MIME type may not be null");
        }
        String type = mimeType.trim().toLowerCase(Locale.US);
        if (type.length() == 0) {
            throw new IllegalArgumentException("MIME type may not be empty");
        }
        if (!valid(type)) {
            throw new IllegalArgumentException("MIME type may not contain reserved characters");
        }
        return new ContentType(type, charset);
    }
242471
@Override
    public MapMessage createMapMessage() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createMapMessage");

        MapMessage mapMessage = null;

        try {
            mapMessage = jmsSession.createMapMessage();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createMapMessage", new Object[] { mapMessage });
        }

        return mapMessage;

    }
1166357
public Session createSession() throws OpenViduJavaClientException, OpenViduHttpException {
		Session s = new Session();
		OpenVidu.activeSessions.put(s.getSessionId(), s);
		return s;
	}
52658
@Override
    public Session getSession() {
        return state.get() > GlobalState.INITIALISING ? new Session(dataMgr.getSessionDAO().session()) : new Session();
    }
809345
private Session createNewSession() {
		Session session = model.newSession();
		getProxy().setIgnoreList(model.getOptionsParam().getGlobalExcludeURLParam().getTokensNames());
		return session;
	}
581322
@Override
    public Session createSession(int sessionMode) throws JMSException {

        Session session = null;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createSession", new Object[] { sessionMode });
        try {
            if (sessionMode == JMSContext.SESSION_TRANSACTED)
                session = createSession(true, sessionMode);
            else
                session = createSession(false, sessionMode);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createSession");
        }
        return session;

    }
609157
protected JLabel createMessageLabel() {
        JLabel messageLabel = new JLabel(" ");
        messageLabel.setName("message");
        Border bevelBorder = BorderFactory.createBevelBorder(BevelBorder.LOWERED, UIManager
                .getColor("controlHighlight"), UIManager.getColor("controlShadow"));
        Border emptyBorder = BorderFactory.createEmptyBorder(1, 3, 1, 3);
        messageLabel.setBorder(BorderFactory.createCompoundBorder(bevelBorder, emptyBorder));

        return messageLabel;
    }
25320
@Override
    public String getMessage() {
        String message = super.getMessage();

        if (message == null) {
            message = "";
        }

        if (hexdump != null) {
            return message + (message.length() > 0 ? " " : "") + "(Hexdump: "
                    + hexdump + ')';
        }

        return message;
    }
806485
@Override
    public TextMessage createTextMessage() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createTextMessage");

        TextMessage textMessage = null;

        try {
            textMessage = jmsSession.createTextMessage();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createTextMessage", new Object[] { textMessage });
        }

        return textMessage;

    }
471159
public String build()
    {
        this.message_string  = "{";

            if( this.recipient_id != null ){
                this.message_string += "\"recipient\": {\"id\": \"" + this.recipient_id + "\"},";
            }

            this.message_string += "\"message\": {";

                this.message_string += "\"attachment\":{";

                    this.message_string += "\"type\":\"template\",";
                    this.message_string += "\"payload\":{";

                        this.message_string += "\"template_type\":\"receipt\",";

                        if( this.recipient_name != null ){
                            this.message_string += "\"recipient_name\":\"" + this.recipient_name + "\",";
                        }
                        if( this.order_number != null ){
                            this.message_string += "\"order_number\":\"" + this.order_number + "\",";
                        }
                        if( this.currency != null ){
                            this.message_string += "\"currency\":\"" + this.currency + "\",";
                        }
                        if( this.payment_method != null ){
                            this.message_string += "\"payment_method\":\"" + this.payment_method + "\",";
                        }
                        if( this.order_url != null ){
                            this.message_string += "\"order_url\":\"" + this.order_url + "\",";
                        }
                        if( this.timestamp != null ){
                            this.message_string += "\"timestamp\":\"" + this.timestamp + "\",";
                        }

                        if( !this.elements.isEmpty() ){
                            this.message_string += "\"elements\":[";
                            for ( int j = 0 ; j < this.elements.size(); j++ ) {
                                HashMap<String, String> element = this.elements.get(j);

                                this.message_string += "{";
                                    if( !element.get("title").equals("") ){
                                        this.message_string += "\"title\":\"" + element.get("title") + "\",";
                                    }
                                    if( !element.get("subtitle").equals("") ){
                                        this.message_string += "\"subtitle\":\"" + element.get("subtitle") + "\",";
                                    }
                                    if( !element.get("quantity").equals("") ){
                                        this.message_string += "\"quantity\":" + element.get("quantity") + ",";
                                    }
                                    if( !element.get("price").equals("") ){
                                        this.message_string += "\"price\":" + element.get("price") + ",";
                                    }
                                    if( !element.get("currency").equals("") ){
                                        this.message_string += "\"currency\":\"" + element.get("currency") + "\",";
                                    }
                                    if( !element.get("image_url").equals("") ){
                                        this.message_string += "\"image_url\":\"" + element.get("image_url") + "\",";
                                    }

                                    this.message_string = this.message_string.replaceAll(",$", "");
                                this.message_string += "},";

                            }
                            this.message_string = this.message_string.replaceAll(",$", "");
                            this.message_string += "],";
                        }

                        if( !this.address.isEmpty() ){
                            this.message_string += "\"address\":{";

                                if( !this.address.get("street_1").equals("") ){
                                    this.message_string += "\"street_1\":\"" + this.address.get("street_1") + "\",";
                                }
                                if( !this.address.get("street_2").equals("") ){
                                    this.message_string += "\"street_2\":\"" + this.address.get("street_2") + "\",";
                                }
                                if( !this.address.get("city").equals("") ){
                                    this.message_string += "\"city\":\"" + this.address.get("city") + "\",";
                                }
                                if( !this.address.get("postal_code").equals("") ){
                                    this.message_string += "\"postal_code\":\"" + this.address.get("postal_code") + "\",";
                                }
                                if( !this.address.get("state").equals("") ){
                                    this.message_string += "\"state\":\"" + this.address.get("state") + "\",";
                                }
                                if( !this.address.get("country").equals("") ){
                                    this.message_string += "\"country\":\"" + this.address.get("country") + "\",";
                                }

                                this.message_string = this.message_string.replaceAll(",$", "");

                            this.message_string += "},";
                        }

                        if( !this.summary.isEmpty() ){
                            this.message_string += "\"summary\":{";

                                if( !this.summary.get("subtotal").equals("") ){
                                    this.message_string += "\"subtotal\":" + this.summary.get("subtotal") + ",";
                                }
                                if( !this.summary.get("shipping_cost").equals("") ){
                                    this.message_string += "\"shipping_cost\":" + this.summary.get("shipping_cost") + ",";
                                }
                                if( !this.summary.get("total_tax").equals("") ){
                                    this.message_string += "\"total_tax\":" + this.summary.get("total_tax") + ",";
                                }
                                if( !this.summary.get("total_cost").equals("") ){
                                    this.message_string += "\"total_cost\":" + this.summary.get("total_cost") + ",";
                                }

                                this.message_string = this.message_string.replaceAll(",$", "");

                            this.message_string += "},";
                        }
                        if( !this.adjustments.isEmpty() ){
                            this.message_string += "\"adjustments\":[";
                            for ( int j = 0 ; j < this.adjustments.size(); j++ ) {
                                HashMap<String, String> adjustment = this.adjustments.get(j);

                                this.message_string += "{";
                                    if( !adjustment.get("name").equals("") ){
                                        this.message_string += "\"name\":\"" + adjustment.get("name") + "\",";
                                    }
                                    if( !adjustment.get("amount").equals("") ){
                                        this.message_string += "\"amount\":" + adjustment.get("amount") + ",";
                                    }
                                    this.message_string = this.message_string.replaceAll(",$", "");
                                this.message_string += "},";

                            }
                            this.message_string = this.message_string.replaceAll(",$", "");
                            this.message_string += "],";
                        }

                        this.message_string = this.message_string.replaceAll(",$", "");

                    this.message_string += "}";

                this.message_string += "}";

            this.message_string += "}";

        this.message_string += "}";

        return this.message_string;
    }
733368
private MimeMessage buildMsg() throws MessagingException {
		final Charset charset = this.mailAccount.getCharset();
		final MimeMessage msg = new MimeMessage(getSession(this.useGlobalSession));
		// 发件人
		final String from = this.mailAccount.getFrom();
		if (StrUtil.isEmpty(from)) {
			// 用户未提供发送方，则从Session中自动获取
			msg.setFrom();
		} else {
			msg.setFrom(InternalMailUtil.parseFirstAddress(from, charset));
		}
		// 标题
		msg.setSubject(this.title, charset.name());
		// 发送时间
		msg.setSentDate(new Date());
		// 内容和附件
		msg.setContent(buildContent(charset));
		// 收件人
		msg.setRecipients(MimeMessage.RecipientType.TO, InternalMailUtil.parseAddressFromStrs(this.tos, charset));
		// 抄送人
		if (ArrayUtil.isNotEmpty(this.ccs)) {
			msg.setRecipients(MimeMessage.RecipientType.CC, InternalMailUtil.parseAddressFromStrs(this.ccs, charset));
		}
		// 密送人
		if (ArrayUtil.isNotEmpty(this.bccs)) {
			msg.setRecipients(MimeMessage.RecipientType.BCC, InternalMailUtil.parseAddressFromStrs(this.bccs, charset));
		}
		return msg;
	}
157798
public JsJmsMessage createJmsMessage() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createJmsMessage");
    JsJmsMessage msg = null;
    try {
      msg = new JsJmsMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createJmsMessage");
    return msg;
  }
590398
@Bean
    SystemMessagesProvider systemMessagesProvider() {
        return new SystemMessagesProvider() {
            @Override
            public SystemMessages getSystemMessages(SystemMessagesInfo systemMessagesInfo) {
                CustomizedSystemMessages systemMessages = new CustomizedSystemMessages();
                systemMessages.setSessionExpiredNotificationEnabled(false);
                return systemMessages;
            }
        };
    }
118798
private MessagingEngine createMessageEngine(JsMEConfig me) throws Exception {

        String thisMethodName = CLASS_NAME + ".createMessageEngine(JsMEConfig)";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, "replace ME name here");
        }

        JsMessagingEngine engineImpl = null;

        bus = new JsBusImpl(me, this, (me.getSIBus().getName()));// getBusProxy(me);
        engineImpl = new JsMessagingEngineImpl(this, bus, me);

        MessagingEngine engine = new MessagingEngine(me, engineImpl);
        _messagingEngines.put(defaultMEUUID, engine);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName, engine.toString());
        }

        return engine;
    }