def to_json(*a)
      # Hack to override RightScale namespace with Nanite for downward compatibility
      class_name = self.class.name
      if class_name =~ /^RightScale::(.*)/
        class_name = "Nanite::" + Regexp.last_match(1)
      end

      js = {
        'json_class' => class_name,
        'data'       => instance_variables.inject({}) do |m, ivar|
                          name = ivar.to_s.sub(/@/, '')
                          m[name] = instance_variable_get(ivar) unless NOT_SERIALIZED.include?(name)
                          m
                        end
      }.to_json(*a)
      @size = js.size
      js = js.chop + ",\"size\":#{@size}}"
    end
def to_json(*a)
      # Hack to override RightScale namespace with Nanite for downward compatibility
      class_name = self.class.name
      if class_name =~ /^RightScale::(.*)/
        class_name = "Nanite::" + Regexp.last_match(1)
      end

      js = {
        'json_class' => class_name,
        'data'       => instance_variables.inject({}) do |m, ivar|
                          name = ivar.to_s.sub(/@/, '')
                          m[name] = instance_variable_get(ivar) unless NOT_SERIALIZED.include?(name)
                          m
                        end
      }.to_json(*a)
      @size = js.size
      js = js.chop + ",\"size\":#{@size}}"
    end
Marshal packet into JSON format

 === Parameters
 a(Array):: Arguments

 === Return
 js(String):: Marshalled packet