Embedding trinidad in a java app or accessing command line args?

40 views
Skip to first unread message

Chris Kimpton

unread,
Apr 6, 2013, 3:29:54 AM4/6/13
to rails-t...@googlegroups.com
Hi,

[trinidad noob]

We are using a third party framework to manage (start/stop) our Java apps, which provides the main() method and needs access to the command line arguments.  

Wondering what options we have for working with trinidad (or other jruby/java web containers):
  • If we start trinidad, can it pass command line args across, for example, is ARGV available?
  • If we start via third party framework, can it manage (start/stop) an embedded trinidad process? 
Assuming the first option, looks like we'd add the framework jars to directory specified in "lib_java".

I dont see a way to specify a class to instantiate, so to load the framework, it seems we'd write some ruby code to instantiate it - is that correct?

Its for an internal webapp - that will be largely a javascript front end - the backend will mainly be API calls.  Also looking for a lightweight (minimum of gem dependencies, due to company firewall :( ).  So thinking we will go for something like Sinatra or maybe Grape (https://github.com/intridea/grape).  Suggestions welcome?

Thanks,
Chris 

kares

unread,
Apr 9, 2013, 12:45:39 PM4/9/13
to rails-t...@googlegroups.com

 Hi Chris, you certainly can start Trinidad from Java ... since it's an embed-ed Tomcat in the end.

Looking at the trinidad binary will probably show you how, you basically need to understand how to boot JRuby from Java first, and than simply in the embedded JRuby instance eval Ruby code you wish for (you can set ARGV or completely avoid it when starting Trinidad from user-code).

Good luck, K.

Chris Kimpton

unread,
Apr 9, 2013, 4:18:11 PM4/9/13
to rails-t...@googlegroups.com
Perfect - thanks K.


--
Has recibido este mensaje porque estás suscrito a un tema del grupo "Rails Trinidad" de Grupos de Google.
Para anular la suscripción a este tema, visita https://groups.google.com/d/topic/rails-trinidad/XsffVbBMeTw/unsubscribe?hl=es. Para anular la suscripción a este grupo y todos sus temas, envía un correo electrónico a rails-trinida...@googlegroups.com.
Para publicar una entrada en este grupo, envía un correo electrónico a rails-t...@googlegroups.com.
Visita este grupo en http://groups.google.com/group/rails-trinidad?hl=es.
Para obtener más opciones, visita https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages