示例#1
0
 public String send() {
   log.info("send " + this);
   try {
     return SendMessage.sendMessage(context, recipient, message);
   } catch (Exception e) {
     return "Failure: Got exception in send: " + e.getMessage();
   }
 }
示例#2
0
  public Description getSellerProtocol() {
    Description pd = new Description();

    // 0
    TryNode tn = new TryNode();
    pd.getNode().add(tn);
    tn.setNextIndex(4);
    tn.setInnerIndex(1);
    tn.getCatchIndex().add(3);

    // 1
    ReceiveMessage recvOrder = new ReceiveMessage();
    recvOrder.setNextIndex(2);

    MessageType mt1 = new MessageType();
    mt1.setValue(ORDER_MESSAGE_TYPE);
    recvOrder.getMessageType().add(mt1);
    pd.getNode().add(recvOrder);

    // 2
    SendMessage sendConformation = new SendMessage();

    MessageType mt2 = new MessageType();
    mt2.setValue(CONFIRMATION_MESSAGE_TYPE);
    sendConformation.getMessageType().add(mt2);
    pd.getNode().add(sendConformation);

    // 3
    ReceiveMessage recvCancel = new ReceiveMessage();

    MessageType mt3 = new MessageType();
    mt3.setValue(CANCEL_MESSAGE_TYPE);
    recvCancel.getMessageType().add(mt3);
    pd.getNode().add(recvCancel);

    // 4
    ReceiveMessage recvFinish = new ReceiveMessage();

    MessageType mt4 = new MessageType();
    mt4.setValue(FINISH_MESSAGE_TYPE);
    recvFinish.getMessageType().add(mt4);
    pd.getNode().add(recvFinish);

    return (pd);
  }
 @Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.layout_biao_qing:
       CGLog.d("H: " + height);
       if (isJianPan) {
         Utils.inputMethod(context, false, layoutImgs); // 先隐藏输入法
         handler.sendEmptyMessageDelayed(1, 300);
         imageView.setImageDrawable(getResources().getDrawable(R.drawable.jianpan));
         isJianPan = false;
       } else {
         Utils.showLayout(layoutImgs, height, 0, Utils.ANIMATION_DURATION);
         handler.sendEmptyMessageDelayed(2, 300);
         imageView.setImageDrawable(getResources().getDrawable(R.drawable.bq));
         isJianPan = true;
       }
       break;
     case R.id.et_message:
       if (!isJianPan) {
         isJianPan = true;
         Utils.showLayout(layoutImgs, height, 0, 100);
         imageView.setImageDrawable(getResources().getDrawable(R.drawable.bq));
       }
       break;
     case R.id.layout_send:
       if (Utils.stringIsNull(etMessage.getText().toString())) {
         Utils.showToast(context, "消息不能为空");
         return;
       } else {
         sendMessage.send(etMessage.getText().toString().trim());
       }
       break;
     default:
       break;
   }
 }
示例#4
0
 public synchronized boolean equals(java.lang.Object obj) {
   if (!(obj instanceof SendMessage)) return false;
   SendMessage other = (SendMessage) obj;
   if (obj == null) return false;
   if (this == obj) return true;
   if (__equalsCalc != null) {
     return (__equalsCalc == obj);
   }
   __equalsCalc = obj;
   boolean _equals;
   _equals =
       true
           && ((this.recipient == null && other.getRecipient() == null)
               || (this.recipient != null
                   && java.util.Arrays.equals(this.recipient, other.getRecipient())))
           && ((this.group == null && other.getGroup() == null)
               || (this.group != null && java.util.Arrays.equals(this.group, other.getGroup())))
           && ((this.subject == null && other.getSubject() == null)
               || (this.subject != null && this.subject.equals(other.getSubject())))
           && ((this.body == null && other.getBody() == null)
               || (this.body != null && this.body.equals(other.getBody())))
           && ((this.priority == null && other.getPriority() == null)
               || (this.priority != null && this.priority.equals(other.getPriority())))
           && ((this.sessionID == null && other.getSessionID() == null)
               || (this.sessionID != null && this.sessionID.equals(other.getSessionID())));
   __equalsCalc = null;
   return _equals;
 }