Is there an example of a command line Bootstrapped application ?

46 views
Skip to first unread message

ricardop

unread,
Jun 25, 2014, 3:51:54 PM6/25/14
to crash...@googlegroups.com
The documentation seems to hint that with:

"Let’s see an example on how to use it"

but then no further information is given.
Just looking for a very basic example that launches the prompt and mounts some command directory...

I've looked at Crash.java, could copy paste the static main()  to my app and launch the main console, but not sure how I can set my own mountpoints for properties and commands.

Thanks for any help.


Julien Viet

unread,
Jun 27, 2014, 11:58:26 AM6/27/14
to crash...@googlegroups.com, ricardop
I started this documentation a while ago and did not have time to finish it properly, sorry for that.

for mountpoints, the best thing to do is:

1/ create an FS.Builder

FS.Builder builder = new FS.Builder();

2/ register the mount point factories you want

FileMountFactory fileDriver = new FileMountFactory(Utils.getCurrentDirectory());
ClassPathMountFactory classpathDriver = new ClassPathMountFactory(Thread.currentThread().getContextClassLoader());
builder.register("file", fileDriver).register("classpath", classpathDriver)

3/ use it to create an FS

FS cmdFS = builder.mount(“classpath:/crash/commands/");

Then create a Bootstrap object with the created cmd FS and conf FS.

does it make sense ?



--
Julien Viet
www.julienviet.com
> --
> Vous recevez ce message, car vous êtes abonné au groupe Google Groupes CRaSH User Group.
> Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez
> un e-mail à l'adresse crash-users...@googlegroups.com.
> Pour plus d'options, visitez le site https://groups.google.com/d/optout .
>

Reply all
Reply to author
Forward
0 new messages