try { java.io.FileWriter out = new java.io.FileWriter("/tmp/x.log", true); out.write("timeout = " + timeout + "\n"); out.close(); } catch (java.io.IOException e) {}
  public Value receive(Env env, @Optional("1") long timeout)    throws JMSException  {    try {      java.io.FileWriter out = new java.io.FileWriter("/tmp/x.log", true);      out.write("timeout = " + timeout + "\n");      out.close();    } catch (java.io.IOException e) {}    Message message = _consumer.receive(timeout);    if (message == null)      return BooleanValue.FALSE;    if (message instanceof ObjectMessage) {      Object object = ((ObjectMessage) message).getObject();      return objectToValue(object, env);    } else if (message instanceof TextMessage) {      return new StringValueImpl(((TextMessage) message).getText());    } else if (message instanceof StreamMessage) {      Object object = ((StreamMessage) message).readObject();      return objectToValue(object, env);    } else if (message instanceof BytesMessage) {      BytesMessage bytesMessage = (BytesMessage) message;      BinaryBuilderValue bb =         new BinaryBuilderValue((int) bytesMessage.getBodyLength());      bytesMessage.readBytes(bb.getBuffer());      bb.setOffset((int) bytesMessage.getBodyLength());      return bb;    } else if (message instanceof MapMessage) {      MapMessage mapMessage = (MapMessage) message;      Enumeration mapNames = mapMessage.getMapNames();      ArrayValue array = new ArrayValueImpl();      while (mapNames.hasMoreElements()) {        String name = mapNames.nextElement().toString();        Object object = mapMessage.getObject(name);        array.put(new StringValueImpl(name), objectToValue(object, env));      }      return array;    } else {      return BooleanValue.FALSE;    }  }