Examples of ObjectMessage


Examples of de.willuhn.jameica.hbci.messaging.ObjectMessage

    /**
     * @see de.willuhn.jameica.messaging.MessageConsumer#handleMessage(de.willuhn.jameica.messaging.Message)
     */
    public void handleMessage(Message message) throws Exception
    {
      ObjectMessage msg = (ObjectMessage) message;
      GenericObject o = msg.getObject();
      if (!(o instanceof UmsatzTyp))
        return;
     
      GUI.getDisplay().asyncExec(new Runnable()
      {
View Full Code Here

Examples of javax.jms.ObjectMessage

            QueueConnectionFactory factory = ( QueueConnectionFactory ) ic.lookup( JNDINames.QUEUE_CONNECTION_FACTORY );
            cnn     = factory.createQueueConnection(  );
            session = cnn.createQueueSession( transacted, QueueSession.AUTO_ACKNOWLEDGE );

            ObjectMessage msg = session.createObjectMessage( obj );

            sender = session.createSender( queue );
            sender.send( msg );
        }
        finally
View Full Code Here

Examples of javax.jms.ObjectMessage

    this.selector = selector;
  }

  public void write(Object message) throws IOException {
    try {
      ObjectMessage clientMessage = this.session.createObjectMessage();
      clientMessage.setObject((Serializable) message);
     
      clientMessage.setStringProperty(TaskServiceConstants.SELECTOR_NAME, this.selector);
      this.producer.send(clientMessage);
      this.session.commit();
    } catch (JMSException e) {
      throw new IOException("Unable to create message: " + e.getMessage());
    } finally {
View Full Code Here

Examples of javax.jms.ObjectMessage

    }
  }

  public void write(Object object) {
    try {
      ObjectMessage message = this.session.createObjectMessage();
      this.selector = UUID.randomUUID().toString();
      Thread responseThread = new Thread(new Responder(selector));
      responseThread.start();
      message.setStringProperty(TaskServiceConstants.SELECTOR_NAME, this.selector);
      message.setObject((Serializable)object);
      this.producer.send(message);
      this.session.commit();
    } catch (Throwable e) {
      throw new RuntimeException("Error creating message", e);
    }
View Full Code Here

Examples of javax.jms.ObjectMessage

   
    public void run() {
      MessageConsumer consumer = null;
      try {
        consumer = session.createConsumer(responseQueue, " " + TaskServiceConstants.SELECTOR_NAME + " like '" + selector + "%' ");
        ObjectMessage serverMessage = (ObjectMessage) consumer.receive();
        if (serverMessage != null) {
          ((JMSTaskClientHandler) handler).messageReceived(session, readMessage(serverMessage), responseQueue, selector);
        }
      } catch (JMSException e) {
        if (!"102".equals(e.getErrorCode())) {
View Full Code Here

Examples of javax.jms.ObjectMessage

      throw new RuntimeException("Error leyendo mensaje", e);
    }
  }

  private Object readMessage(Message msgReceived) throws IOException {
    ObjectMessage strmMsgReceived = (ObjectMessage) msgReceived;
    try {
      return strmMsgReceived.getObject();
    } catch (JMSException e) {
      throw new IOException("Error reading message");
    }
  }
View Full Code Here

Examples of javax.jms.ObjectMessage

    {
        try
        {
            Debug.print( "MailerMDB.onMessage(" + recvMsg + ")" );

            ObjectMessage msg = ( ObjectMessage ) recvMsg;
            Email         email = ( Email ) msg.getObject(  );

            send( email.getTo(  ), email.getSubject(  ), email.getBody(  ) );
        }
        catch ( Exception e )
        {
View Full Code Here

Examples of javax.jms.ObjectMessage

        try
        {
            Debug.print( "OrderProcessorMDB.onMessage(" + recvMsg + ")" );

            /* Get the order to proceed */
            ObjectMessage msg = ( ObjectMessage ) recvMsg;
            orderUId = ( Integer ) msg.getObject(  );
            order    = OrderUtil.getLocalHome(  ).findByPrimaryKey( orderUId );

            /* Proceed the order */
            proceedPayment( order );
            proceedOrder( order );
View Full Code Here

Examples of javax.jms.ObjectMessage

    private static final Log log = LogFactory.getLog(DefaultMarshaller.class);

    private boolean ignoreInvalidMessages;

    public Message createRequestMessage(Requestor requestor, LingoInvocation invocation) throws JMSException {
        ObjectMessage message = requestor.getSession().createObjectMessage(invocation);
        appendMessageHeaders(message, requestor, invocation);
        return message;
    }
View Full Code Here

Examples of javax.jms.ObjectMessage

        return message;
    }

   
    public Message createResponseMessage(Session session, RemoteInvocationResult result, Message requestMessage) throws JMSException {
        ObjectMessage answer = session.createObjectMessage(result);
        addResponseMessageHeaders(answer, result, requestMessage);
        return answer;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.