CRaSH the shell for the JVM

20

description

CRaSH is the shell for the Java Virtual Machine

Transcript of CRaSH the shell for the JVM

Page 1: CRaSH the shell for the JVM
Page 2: CRaSH the shell for the JVM

An extensible command line for the JVM

Julien VietSenior software engineer

eXo Platform

@julienviet

Alain DefranceSoftware engineer

eXo Platform

@alaindefrance

Page 3: CRaSH the shell for the JVM

@julienviet

10 years of Open Source

■ eXo Platform 2008

■ Red Hat 2006

■ JBoss 2002

Various

■ Portal stuff (JBoss / GateIn)

■ JCP a while ago

3

2 years of Open Source■ eXo Platform 2010

Various■ Develop social product

@alaindefrance

Page 4: CRaSH the shell for the JVM

Project

Open source LGPL: http://www.crashub.orgCRaSH 1.0 – April 2012CRaSH 1.1 – August 2012CRaSH 1.2 – Soon (in release candidate)

Page 5: CRaSH the shell for the JVM

What/Why?

CLI are still relevantUbiquitousExpressive: find . -name “*.java” -exec grep julien {} \; -print

Made for us Trends: NoSQL, MS Powershell, Drupal, Jenkins, Cloud, etc…

Fun!

Page 6: CRaSH the shell for the JVM

Comparison with UN*X shell

Same client interface

■ History

■ Completion

■ Command Line Editing

■ Options & Arguments

■ Pipes

6

But hosted by JVM■ Java threads■ JVM access

Page 7: CRaSH the shell for the JVM

Usage

Runtime modes

■ Standalone

■ Embedded (web app, Spring, …)

■ Attach

7

Get it from■ crashub download■ Maven Central

dependency

Page 8: CRaSH the shell for the JVM

Simple stack

TelnetSSH ConsoleWebVisualV

MAttach

Native Client

Connectors

CRaSH

Groovy Commands

Page 9: CRaSH the shell for the JVM

What you can do with CRaSH

Swiss army knifeEmbed in your runtimeCreate your commandsMonitoring toolScriptingAnd more…

Page 10: CRaSH the shell for the JVM

Out of the box

Page 11: CRaSH the shell for the JVM

Out of the box

Install CRaSHRun CRaSH standaloneCLI basicsJVM base commandsTest it online

Page 12: CRaSH the shell for the JVM

The Swiss Knife

Page 13: CRaSH the shell for the JVM

The Swiss Knife

Attach CRaSH to JBoss Application ServerExecute commands in the Application Server

Page 14: CRaSH the shell for the JVM

Extend your runtime

Page 15: CRaSH the shell for the JVM

Extend your runtime

Embed CRaSH in a Spring web applicationConnect using remote protocolDevelop a command to access Spring beansAdd options and arguments to the command

Page 16: CRaSH the shell for the JVM

Monitoring

Page 17: CRaSH the shell for the JVM

Monitoring

Attach to Tomcat with VisualVMUse JMX command pipesCreate pipesAssemble in custom dashboard

Page 18: CRaSH the shell for the JVM

%jmx find …

Pipelined object stream

jmx find

jmx get

sort

<Void, ObjectName><ObjectName, Map> <Map, Map>

Page 19: CRaSH the shell for the JVM

Wrap up

Multi facet, powerful and extensibleReach [email protected]@crashub http://www.crashub.org

Hackergarten hands on coding Tuesday

Page 20: CRaSH the shell for the JVM

Q&A