Results 1 to 2 of 2

Thread: how to get hdp:configuration from Java

  1. #1

    Default how to get hdp:configuration from Java

    i like hdp:configuration because you can type configuration strings directly into xml.

    <hdp:configuration properties-ref="props" properties-location="cfg-1.properties, cfg-2.properties">
    star=chasing
    captain=eo
    </hdp:configuration>

    how to get instance of this (type Configuration) in application code, what is bean name created by hdp:configuration?

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    It's "hadoopConfiguration" - the docs (and the XSD) contain the default name and the reason behind it (simply autowiring between components).
    Note that there's nothing preventing you from specifying an id (though in that case, other components that depend on the default config, need to be re-wired).
    If you're doing dependency injection (not lookup) you can just specify @Inject or @Autowired and you're set.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •