def __init__(self,
               name,
               sources=None,
               excludes=None,
               resources=None,
               premain=None,
               agent_class=None,
               can_redefine=False,
               can_retransform=False,
               can_set_native_method_prefix=False,
               **kwargs):

    super(JavaAgent, self).__init__(
        name=name,
        sources=sources,
        provides=None,
        excludes=self.assert_list(excludes, key_arg='excludes'),
        resources=self.assert_list(resources, key_arg='resources'),
        **kwargs)

    if not (premain or agent_class):
      raise TargetDefinitionException(self, "Must have at least one of 'premain' or 'agent_class' "
                                            "defined.")
    if premain and not isinstance(premain, string_types):
      raise TargetDefinitionException(self, 'The premain must be a fully qualified class name, '
                                            'given {} of type {}'.format(premain, type(premain)))

    if agent_class and not isinstance(agent_class, string_types):
      raise TargetDefinitionException(self,
                                      'The agent_class must be a fully qualified class name, given '
                                      '{} of type {}'.format(agent_class, type(agent_class)))

    self._premain = premain
    self._agent_class = agent_class
    self._can_redefine = can_redefine
    self._can_retransform = can_retransform
    self._can_set_native_method_prefix = can_set_native_method_prefix

    # TODO(Eric Ayers) As of 2/5/2015 this call is DEPRECATED and should be removed soon
    self.add_labels('java_agent')
:param string premain: When an agent is specified at JVM launch time this attribute specifies
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/backend/jvm/targets/java_agent.py/JavaAgent.__init__