You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by "Brian K. Wallace" <br...@transmorphix.com> on 2005/02/05 17:25:30 UTC

Supplement to examples - REVISED

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Actually... I think I'd like to supplement the examples a little more
than what I'm proposing in my original e-mail. I haven't even begun to
flesh out 'how', but would like input on creating individual example
dirs under the main examples tree.

I currently have an implementation of my previous e-mail that 'just
works' (test case and build.xml target are both responsible for copying
the descriptor so the test works command-line and in eclipse - just not
too fond of "eclipse specific" code... even if it's the only IDE I use),
but I'd rather split the examples out so it's easier to add new examples
without going through the ExampleUtils gyration except for an example
that shows how to utilize deployment descriptors in non-standard
locations or with non-standard names.

proposed new structure would be more along the lines of:
~  examples/
~    calculator/
~    logging/
~    startup/              <-- Panorama* would go here
~    descriptors/          <-- new - how to load descriptors
~    ...

Each of these subdirectories would be laid out with a complete tree,
build a deployable jar, and have tasks to run as the current examples have.

I believe this would make it easier to provide more examples in a
'standard' "build it and run it, or build it and deploy the jar" -
possibly adding a 'default' way (later on... just hopefully not too much
later) of "pick up, drop in, and see how it's completely self-contained".

Thoughts? [yes, in doing this I'd still want to make sure of individual
documentation, test coverage, and integration back into the site]

Brian

Brian K. Wallace wrote:
| Per a question on the user list as to "what's different" with regard to
| loading the Examples registry, I'd like to get your input on adding a
| target to the examples build.xml as well as adding another class to the
| examples:
|
| Proposed addition to build.xml:
|
| ~    <target name="run-calculator-default"
| ~      description="Execute the Calculator example using default registry
| creation.">
| ~    <copy file="src/descriptor/META-INF/examples.xml"
| tofile="target/classes/META-INF/hivemodule.xml"/>
| ~    <java classname="org.apache.hivemind.examples.CalculatorMainDefault">
| ~      <classpath refid="runtime.classpath"/>
| ~      <arg line="28 4.75"/>
| ~    </java>
| ~    <delete dir="target/classes/META-INF"/>
| ~  </target>
|
| Adding a copy of CalculatorMain as CalculatorMainDefault which changes
| the registry creation line to:
| ~          Registry registry = RegistryBuilder.constructDefaultRegistry();
|
|
| The current methodology is good in that, for the developer, it shows how
| to load a registry from a non-standard filename and location. I believe
| this addition would also help show how it's done with the descriptor
| named 'hivemodule.xml' in the META-INF directory on the classpath (the
| 'default').
|
| If this addition is alright, I'll create an issue and attach the patch.
| [also going to post the summation of changes to the Wiki]
|
| Brian

- ---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)

iD8DBQFCBPN6aCoPKRow/gARArq5AKDdT6wCgn/3uKl16G+ROIZm8gSGjgCg1xoS
v5pfHEiZn79BwldxiXaP6Rg=
=zg/T
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org