code: @Override
      protected void writeInternal(Object data, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {
      	
          try {
              AmfTrace trace = null;
              if (log.isDebugEnabled()) {
                  trace = new AmfTrace();
              }
              
              outputMessage.getHeaders().setPragma("no-cache");
              outputMessage.getHeaders().setCacheControl("no-cache, no-store, max-age=0");
              outputMessage.getHeaders().setExpires(1L);
              
              if (data instanceof ActionMessage) {
              	writeActionMessage((ActionMessage) data, outputMessage, trace);
              } else {
              	writeObject(data, outputMessage, trace);
              }
              
              if (log.isDebugEnabled()) {
                  log.debug("Wrote AMF message:\n" + trace);
              }
          } finally {
              FlexContext.clearThreadLocalObjects();
              SerializationContext.clearThreadLocalObjects();
          }
      }
docs: {@inheritDoc}