# File lib/adaptation/adaptor.rb, line 20
    def publish *options
      message_object = nil
      if options.first.is_a?(Message)
        message_object = options.first
      elsif options.first.is_a?(String)
        xml_message = options.first
        message_type = xml_message[1..(xml_message.index(/(>| )/) - 1)]
        message_class = Adaptation::Message.get_class_object(message_type.capitalize)
        message_object = message_class.to_object(xml_message)
      end
      
      xml = message_object.to_xml.to_s.gsub("'", "\"")
      publish_method = $config["oappublish"] || "#{ADAPTOR_ROOT}/script/publish"
      topic = $config["application"] || "ADAPTATION"
      unless system("#{publish_method} '#{$config["application"]}' '#{xml}'")
        logger.error "Problem publishing: #{xml}"
      end

    end