SlideShare a Scribd company logo
1 of 24
Download to read offline
Who is Stefano?

●   JBoss WS[1] committer since early 2007
●   Committer of various Jboss projects
●   JBoss / Red Hat employee since July 2010
●   JBoss AS7[2] team memeber
●   IronJacamar[4] team member
●   Wise[3] project leader
●   Follow me:       www.javalinux.it, www.twitter.com/maeste
    https://plus.google.com/102371438013760231375/about
    https://github.com/maeste http://www.linkedin.com/in/maeste
    [1] http://www.jboss.org/jbossws   [2] http://www.jboss.org/jbossas

    [3] http://www.jboss.org/wise      [4] http://www.jboss.org/ironjcamar
AS7 in a nutshell


●Blazingly fast (<3s startup)
●Lightweight

●Modular core

●Hot, parallel deployment

●Elegant administration

●Domain management

●Easy testable
Dynamic Model Representation (DMR)

●   Central detyped management API
       ●   All management operations with/on DMR
       ●   Backwards compatible
●   Can be used to control standalone or
    domain
●   Detyped (i.e. string based) API uses small
    set of Java classes
●   Various transports (Java, remoting,
    JSON/HTTP)
Dynamic Model Representation (DMR)
What is CLI?

●   Command Line Interface
●   Easy to use both for standalone and
    domain mode
●   Scriptable
●   Low level management of DMR resource
    and/or high level user friendly command
●   Manage deployement and “special
    deployment”
●   Provide also a simple GUI
Why CLI instead of Web Console?

●   Both have valid use cases
●   CLI could be helpful in complex
    management but requiring programming
    skills (almost)
●   Web console give an advanced interface
    for complex operation and give a cooked
    view of resources
CLI Feature includes (1/2):
●   connect to the specific controller or server instance by specifying
    the host and the port;
●   send operation requests (providing the managed component's
    address, attribute or operation name and parameters) following
    the AS7 detyped management model;
●   view the available managed components, their attributes and
    operations;
●   tab-completion for commands and operation requests;
●   history of the executed commands and operation requests;
●   deploy and undeploy standard packages at runtime in standalone
    and domain modes;
●   CLI deployment archives;
CLI Feature includes (2/2):
●   batch mode;
●   non-interactive mode;
●   generic resource type commands and custom commands;
●   GUI mode;
●   CLI public API;
●   system properties in operations and commands;
●   try-catch-finally control flow;
●   if-else control flow
●   Single jar for remote clients
●   Advanced CLI scripting with Groovy, Rhino, Jython, etc.
connect to the specific controller or server
instance by specifying the host and the port;




                  DEMO
          (execute cli an connect)
send operation requests

●   Address (node path)
    node_type=node_name (, node_type=node_name)*
    /subsystem=datasources
    /subsystem=datasources/data-source=ExampleDS

●   Operations
    :operation-name ['(' [name=value [, name=value]*] ')']
    :shutdown
    :shutdown()
    :shutdown(restart=true)
    /subsystem=datasources/data-source=ExampleDS:write-
    attribute(name=min-pool-size,value=5)
A demo of some other features

●   view the available managed components,
    their attributes and operations;
●   tab-completion for commands and
    operation requests;
●   history of the executed commands and
    operation requests;
Deploy and Undeploy standard
               packages
●   Standalone mode
      ●   Deploy/undeploy a package
      ●   Deploy –disabled
      ●   Undeploy --keep-content
●   Domain mode
      ●   Specify a server group (or --all-server-
           groups)
      ●   Undeploy from relevant server groups
      ●   Deply/undeploy on specific server group
           and disabled deployments
CLI deployment archive

●   Standard Jar containing archives to
    deploy
●   A deploy.scr containing commands to
    execute in cli when archive is deployed
●   A undeploy.scr to rollback on undeploy
●   Multiple deploy/undeploy script can exist
    and they are addressed by --script option
    in deploy/undeploy command
Batch mode

●   The batch mode allows one to group
    commands and operations and execute
    them together as an atomic unit
●   Build them from scratch (entering batch
    mode w/ “batch” command)...demo
●   Execute (eventually modify) batch stored
    in file
●   Batches with properties (./jboss-cli
    --properties=script.properties)
Non interective

●   ./jboss-cli.sh -c –file=test.cli
●   ./jboss-cli.sh -c --commands="cd
    subsystem=web,ls"
●   Why? Cron for example, or in any case
    you need to run scripts triggered from
    operating system
Generic type CLI commands

●   is a command that is assigned to a
    specific node type
●   Data-source example
●   Add a new command (only in current
    session...but you can create a batch for
    your own commands...)
CLI GUI

●   Browse the domain model
●   To see the operations available for a
    node, right-click the node.
●   Context-sensitive help is available
    throughout the Command Builder
●   You can also edit the command line
    manually and submit a command at any
    time
Public API
                  (Since JBoss AS 7.1.1)
final CommandContext ctx;
try {
   ctx = CommandContextFactory.getInstance().newCommandContext();
} catch(CliInitializationException e) {
   throw new IllegalStateException("Failed to initialize CLI context", e);
}

try {
   // connect to the server controller
   ctx.connectController();

   // execute commands and operations
   ctx.handle(":take-snapshot");
   ctx.handle("deploy myapp.ear");
} catch (CommandLineException e) {
   // the operation or the command has failed
} finally {
   // terminate the session and
   // close the connection to the controller
   ctx.terminateSession();

 }
try-catch-finally control flow

Try
 /subsystem=datasources/data-source=myds:add(connection-url=xxx,jndi-
name=java:/myds,driver-name=h2)
catch
 /subsystem=datasources/data-source=myds:remove
 /subsystem=datasources/data-source=myds:add(connection-url=xxx,jndi-
name=java:/myds,driver-name=h2)
finally
 /subsystem=datasources/data-source=myds:enable
end-try
if-else control flow

 if (outcome != success) of /system-property=test:read-resource
     /system-property=test:add(value=true)
 end-if


[standalone@localhost:9999 /] /system-property=test:read-resource
{
    "outcome" => "failed",
    "failure-description" => "JBAS014807: Management resource
'[("system-property" => "test")]' not found",
    "rolled-back" => true
}



 [standalone@localhost:9999 /] /system-property=test:read-resource
 {
     "outcome" => "success",
     "result" => {"value" => "true"}
 }
Scripting with Groovy
    (and all Java lib enabled scripting language)
groovy -cp jboss-cli-client.jar uptime.groovy
 import org.jboss.as.cli.scriptsupport.*
  
 cli = CLI.newInstance()
 cli.connect()
  
 if (cli.getCommandContext().isDomainMode()) {
   cli.cmd("cd /host=master/core-service=platform-mbean/type=runtime")
 } else {
   cli.cmd("cd /core-service=platform-mbean/type=runtime")
 }
  
 result = cli.cmd(":read-attribute(name=start-time)")
 response = result.getResponse()
 startTime = response.get("result").asLong()
  
 result = cli.cmd(":read-attribute(name=uptime)")
 response = result.getResponse()
 serveruptime = response.get("result").asString()
  
 println()
 println("The server was started on " + new Date(startTime))
 println("It has been running for " + serveruptime + "ms")
  
 cli.disconnect()
Community

●   Get involved !
       ●   Base for JBoss Enterprise Application
            Platform 6.x
●   Download
       ●   http://www.jboss.org/jbossas/downloads
●   Forum
       ●   http://community.jboss.org/en/jbossas/as7_us
            ers
Community

●   Hacking on AS 7
       ●   http://community.jboss.org/wiki/HackingonAS
            7
●   Command Line Interface
       ●   https://community.jboss.org/wiki/CommandLin
●   Operations, Administration & Management
    of JBoss AS7
       ●   http://vimeo.com/25855285

More Related Content

What's hot

Getting hands on-experience with UltraESB
Getting hands on-experience with UltraESBGetting hands on-experience with UltraESB
Getting hands on-experience with UltraESBAdroitLogic
 
vert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Javavert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in JavaClément Escoffier
 
자바 성능 강의
자바 성능 강의자바 성능 강의
자바 성능 강의Terry Cho
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
Architecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsArchitecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsMarkus Eisele
 
NodeJS ecosystem
NodeJS ecosystemNodeJS ecosystem
NodeJS ecosystemYukti Kaura
 
Front-end build tools - Webpack
Front-end build tools - WebpackFront-end build tools - Webpack
Front-end build tools - WebpackRazvan Rosu
 
Find bottleneck and tuning in Java Application
Find bottleneck and tuning in Java ApplicationFind bottleneck and tuning in Java Application
Find bottleneck and tuning in Java Applicationguest1f2740
 
Node js实践
Node js实践Node js实践
Node js实践jay li
 
SockJS Intro
SockJS IntroSockJS Intro
SockJS IntroNgoc Dao
 
Unirest Java Tutorial | Java Http Client
Unirest Java Tutorial | Java Http ClientUnirest Java Tutorial | Java Http Client
Unirest Java Tutorial | Java Http Clientrahul patel
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneidermfrancis
 
플랫폼 통합을 위한 Client Module 개발 & 배포
플랫폼 통합을 위한 Client Module 개발 & 배포플랫폼 통합을 위한 Client Module 개발 & 배포
플랫폼 통합을 위한 Client Module 개발 & 배포흥래 김
 
UltraESB - Advanced services
UltraESB - Advanced servicesUltraESB - Advanced services
UltraESB - Advanced servicesAdroitLogic
 
Nanocloud cloud scale jvm
Nanocloud   cloud scale jvmNanocloud   cloud scale jvm
Nanocloud cloud scale jvmaragozin
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsWinston Hsieh
 
WSO2 Micro Services Server - Basic Workshop Part 1
WSO2 Micro Services Server - Basic Workshop Part 1WSO2 Micro Services Server - Basic Workshop Part 1
WSO2 Micro Services Server - Basic Workshop Part 1Edgar Silva
 

What's hot (20)

Getting hands on-experience with UltraESB
Getting hands on-experience with UltraESBGetting hands on-experience with UltraESB
Getting hands on-experience with UltraESB
 
Angular2 ecosystem
Angular2 ecosystemAngular2 ecosystem
Angular2 ecosystem
 
GlassFish v2.1
GlassFish v2.1GlassFish v2.1
GlassFish v2.1
 
vert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Javavert.x 3.1 - be reactive on the JVM but not only in Java
vert.x 3.1 - be reactive on the JVM but not only in Java
 
자바 성능 강의
자바 성능 강의자바 성능 강의
자바 성능 강의
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Architecting Large Enterprise Java Projects
Architecting Large Enterprise Java ProjectsArchitecting Large Enterprise Java Projects
Architecting Large Enterprise Java Projects
 
NodeJS ecosystem
NodeJS ecosystemNodeJS ecosystem
NodeJS ecosystem
 
Front-end build tools - Webpack
Front-end build tools - WebpackFront-end build tools - Webpack
Front-end build tools - Webpack
 
Find bottleneck and tuning in Java Application
Find bottleneck and tuning in Java ApplicationFind bottleneck and tuning in Java Application
Find bottleneck and tuning in Java Application
 
Node js实践
Node js实践Node js实践
Node js实践
 
SockJS Intro
SockJS IntroSockJS Intro
SockJS Intro
 
Unirest Java Tutorial | Java Http Client
Unirest Java Tutorial | Java Http ClientUnirest Java Tutorial | Java Http Client
Unirest Java Tutorial | Java Http Client
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
 
플랫폼 통합을 위한 Client Module 개발 & 배포
플랫폼 통합을 위한 Client Module 개발 & 배포플랫폼 통합을 위한 Client Module 개발 & 배포
플랫폼 통합을 위한 Client Module 개발 & 배포
 
UltraESB - Advanced services
UltraESB - Advanced servicesUltraESB - Advanced services
UltraESB - Advanced services
 
Nanocloud cloud scale jvm
Nanocloud   cloud scale jvmNanocloud   cloud scale jvm
Nanocloud cloud scale jvm
 
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor BuzatovićJavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
JavaCro'14 - Is there Kotlin after Java 8 – Ivan Turčinović and Igor Buzatović
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
WSO2 Micro Services Server - Basic Workshop Part 1
WSO2 Micro Services Server - Basic Workshop Part 1WSO2 Micro Services Server - Basic Workshop Part 1
WSO2 Micro Services Server - Basic Workshop Part 1
 

Similar to AS7 and CLI

airflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxairflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxVIJAYAPRABAP
 
Airflow presentation
Airflow presentationAirflow presentation
Airflow presentationIlias Okacha
 
airflow web UI and CLI.pptx
airflow web UI and CLI.pptxairflow web UI and CLI.pptx
airflow web UI and CLI.pptxVIJAYAPRABAP
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVMSylvain Wallez
 
Ob1k presentation at Java.IL
Ob1k presentation at Java.ILOb1k presentation at Java.IL
Ob1k presentation at Java.ILEran Harel
 
LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager Alison Chaiken
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfOrtus Solutions, Corp
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment Systema3sec
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to productionmuayyad alsadi
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them AllTim Fairweather
 
Dragoncraft Architectural Overview
Dragoncraft Architectural OverviewDragoncraft Architectural Overview
Dragoncraft Architectural Overviewjessesanford
 
Privilege Escalation with Metasploit
Privilege Escalation with MetasploitPrivilege Escalation with Metasploit
Privilege Escalation with Metasploitegypt
 
Scala, docker and testing, oh my! mario camou
Scala, docker and testing, oh my! mario camouScala, docker and testing, oh my! mario camou
Scala, docker and testing, oh my! mario camouJ On The Beach
 
OSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David BosschaertOSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David Bosschaertmfrancis
 

Similar to AS7 and CLI (20)

airflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptxairflowpresentation1-180717183432.pptx
airflowpresentation1-180717183432.pptx
 
Airflow presentation
Airflow presentationAirflow presentation
Airflow presentation
 
airflow web UI and CLI.pptx
airflow web UI and CLI.pptxairflow web UI and CLI.pptx
airflow web UI and CLI.pptx
 
Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI
 
Native Java with GraalVM
Native Java with GraalVMNative Java with GraalVM
Native Java with GraalVM
 
It gilde 20150209
It gilde 20150209It gilde 20150209
It gilde 20150209
 
Ob1k presentation at Java.IL
Ob1k presentation at Java.ILOb1k presentation at Java.IL
Ob1k presentation at Java.IL
 
LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
 
A3Sec Advanced Deployment System
A3Sec Advanced Deployment SystemA3Sec Advanced Deployment System
A3Sec Advanced Deployment System
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
JOSA TechTalk: Taking Docker to Production
JOSA TechTalk: Taking Docker to ProductionJOSA TechTalk: Taking Docker to Production
JOSA TechTalk: Taking Docker to Production
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to production
 
Ansible Automation to Rule Them All
Ansible Automation to Rule Them AllAnsible Automation to Rule Them All
Ansible Automation to Rule Them All
 
Dragoncraft Architectural Overview
Dragoncraft Architectural OverviewDragoncraft Architectural Overview
Dragoncraft Architectural Overview
 
Privilege Escalation with Metasploit
Privilege Escalation with MetasploitPrivilege Escalation with Metasploit
Privilege Escalation with Metasploit
 
Grails 101
Grails 101Grails 101
Grails 101
 
Scala, docker and testing, oh my! mario camou
Scala, docker and testing, oh my! mario camouScala, docker and testing, oh my! mario camou
Scala, docker and testing, oh my! mario camou
 
Catalyst MVC
Catalyst MVCCatalyst MVC
Catalyst MVC
 
OSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David BosschaertOSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David Bosschaert
 

More from JBug Italy

JBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testingJBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testingJBug Italy
 
Intro jbug milano_26_set2012
Intro jbug milano_26_set2012Intro jbug milano_26_set2012
Intro jbug milano_26_set2012JBug Italy
 
Faster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzzFaster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzzJBug Italy
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMJBug Italy
 
JBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logicJBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logicJBug Italy
 
JBoss AS7 Overview
JBoss AS7 OverviewJBoss AS7 Overview
JBoss AS7 OverviewJBug Italy
 
Intro JBug Milano - January 2012
Intro JBug Milano - January 2012Intro JBug Milano - January 2012
Intro JBug Milano - January 2012JBug Italy
 
JBoss AS7 Webservices
JBoss AS7 WebservicesJBoss AS7 Webservices
JBoss AS7 WebservicesJBug Italy
 
Intro JBug Milano - September 2011
Intro JBug Milano - September 2011Intro JBug Milano - September 2011
Intro JBug Milano - September 2011JBug Italy
 
All the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSAll the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSJBug Italy
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridJBug Italy
 
Drools Introduction
Drools IntroductionDrools Introduction
Drools IntroductionJBug Italy
 
September 2010 - Arquillian
September 2010 - ArquillianSeptember 2010 - Arquillian
September 2010 - ArquillianJBug Italy
 
September 2010 - Gatein
September 2010 - GateinSeptember 2010 - Gatein
September 2010 - GateinJBug Italy
 
May 2010 - Infinispan
May 2010 - InfinispanMay 2010 - Infinispan
May 2010 - InfinispanJBug Italy
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasyJBug Italy
 
May 2010 - Drools flow
May 2010 - Drools flowMay 2010 - Drools flow
May 2010 - Drools flowJBug Italy
 
May 2010 - Hibernate search
May 2010 - Hibernate searchMay 2010 - Hibernate search
May 2010 - Hibernate searchJBug Italy
 

More from JBug Italy (20)

JBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testingJBoss Wise: breaking barriers to WS testing
JBoss Wise: breaking barriers to WS testing
 
Intro jbug milano_26_set2012
Intro jbug milano_26_set2012Intro jbug milano_26_set2012
Intro jbug milano_26_set2012
 
Faster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzzFaster & Greater Messaging System HornetQ zzz
Faster & Greater Messaging System HornetQ zzz
 
Infinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGMInfinispan,Lucene,Hibername OGM
Infinispan,Lucene,Hibername OGM
 
AS7
AS7AS7
AS7
 
JBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logicJBoss BRMS - The enterprise platform for business logic
JBoss BRMS - The enterprise platform for business logic
 
JBoss AS7 Overview
JBoss AS7 OverviewJBoss AS7 Overview
JBoss AS7 Overview
 
Intro JBug Milano - January 2012
Intro JBug Milano - January 2012Intro JBug Milano - January 2012
Intro JBug Milano - January 2012
 
JBoss AS7 Webservices
JBoss AS7 WebservicesJBoss AS7 Webservices
JBoss AS7 Webservices
 
JBoss AS7
JBoss AS7JBoss AS7
JBoss AS7
 
Intro JBug Milano - September 2011
Intro JBug Milano - September 2011Intro JBug Milano - September 2011
Intro JBug Milano - September 2011
 
All the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMSAll the cool stuff of JBoss BRMS
All the cool stuff of JBoss BRMS
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data Grid
 
Drools Introduction
Drools IntroductionDrools Introduction
Drools Introduction
 
September 2010 - Arquillian
September 2010 - ArquillianSeptember 2010 - Arquillian
September 2010 - Arquillian
 
September 2010 - Gatein
September 2010 - GateinSeptember 2010 - Gatein
September 2010 - Gatein
 
May 2010 - Infinispan
May 2010 - InfinispanMay 2010 - Infinispan
May 2010 - Infinispan
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
May 2010 - Drools flow
May 2010 - Drools flowMay 2010 - Drools flow
May 2010 - Drools flow
 
May 2010 - Hibernate search
May 2010 - Hibernate searchMay 2010 - Hibernate search
May 2010 - Hibernate search
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 

AS7 and CLI

  • 1.
  • 2. Who is Stefano? ● JBoss WS[1] committer since early 2007 ● Committer of various Jboss projects ● JBoss / Red Hat employee since July 2010 ● JBoss AS7[2] team memeber ● IronJacamar[4] team member ● Wise[3] project leader ● Follow me: www.javalinux.it, www.twitter.com/maeste https://plus.google.com/102371438013760231375/about https://github.com/maeste http://www.linkedin.com/in/maeste [1] http://www.jboss.org/jbossws [2] http://www.jboss.org/jbossas [3] http://www.jboss.org/wise [4] http://www.jboss.org/ironjcamar
  • 3. AS7 in a nutshell ●Blazingly fast (<3s startup) ●Lightweight ●Modular core ●Hot, parallel deployment ●Elegant administration ●Domain management ●Easy testable
  • 4. Dynamic Model Representation (DMR) ● Central detyped management API ● All management operations with/on DMR ● Backwards compatible ● Can be used to control standalone or domain ● Detyped (i.e. string based) API uses small set of Java classes ● Various transports (Java, remoting, JSON/HTTP)
  • 6. What is CLI? ● Command Line Interface ● Easy to use both for standalone and domain mode ● Scriptable ● Low level management of DMR resource and/or high level user friendly command ● Manage deployement and “special deployment” ● Provide also a simple GUI
  • 7. Why CLI instead of Web Console? ● Both have valid use cases ● CLI could be helpful in complex management but requiring programming skills (almost) ● Web console give an advanced interface for complex operation and give a cooked view of resources
  • 8. CLI Feature includes (1/2): ● connect to the specific controller or server instance by specifying the host and the port; ● send operation requests (providing the managed component's address, attribute or operation name and parameters) following the AS7 detyped management model; ● view the available managed components, their attributes and operations; ● tab-completion for commands and operation requests; ● history of the executed commands and operation requests; ● deploy and undeploy standard packages at runtime in standalone and domain modes; ● CLI deployment archives;
  • 9. CLI Feature includes (2/2): ● batch mode; ● non-interactive mode; ● generic resource type commands and custom commands; ● GUI mode; ● CLI public API; ● system properties in operations and commands; ● try-catch-finally control flow; ● if-else control flow ● Single jar for remote clients ● Advanced CLI scripting with Groovy, Rhino, Jython, etc.
  • 10. connect to the specific controller or server instance by specifying the host and the port; DEMO (execute cli an connect)
  • 11. send operation requests ● Address (node path) node_type=node_name (, node_type=node_name)* /subsystem=datasources /subsystem=datasources/data-source=ExampleDS ● Operations :operation-name ['(' [name=value [, name=value]*] ')'] :shutdown :shutdown() :shutdown(restart=true) /subsystem=datasources/data-source=ExampleDS:write- attribute(name=min-pool-size,value=5)
  • 12. A demo of some other features ● view the available managed components, their attributes and operations; ● tab-completion for commands and operation requests; ● history of the executed commands and operation requests;
  • 13. Deploy and Undeploy standard packages ● Standalone mode ● Deploy/undeploy a package ● Deploy –disabled ● Undeploy --keep-content ● Domain mode ● Specify a server group (or --all-server- groups) ● Undeploy from relevant server groups ● Deply/undeploy on specific server group and disabled deployments
  • 14. CLI deployment archive ● Standard Jar containing archives to deploy ● A deploy.scr containing commands to execute in cli when archive is deployed ● A undeploy.scr to rollback on undeploy ● Multiple deploy/undeploy script can exist and they are addressed by --script option in deploy/undeploy command
  • 15. Batch mode ● The batch mode allows one to group commands and operations and execute them together as an atomic unit ● Build them from scratch (entering batch mode w/ “batch” command)...demo ● Execute (eventually modify) batch stored in file ● Batches with properties (./jboss-cli --properties=script.properties)
  • 16. Non interective ● ./jboss-cli.sh -c –file=test.cli ● ./jboss-cli.sh -c --commands="cd subsystem=web,ls" ● Why? Cron for example, or in any case you need to run scripts triggered from operating system
  • 17. Generic type CLI commands ● is a command that is assigned to a specific node type ● Data-source example ● Add a new command (only in current session...but you can create a batch for your own commands...)
  • 18. CLI GUI ● Browse the domain model ● To see the operations available for a node, right-click the node. ● Context-sensitive help is available throughout the Command Builder ● You can also edit the command line manually and submit a command at any time
  • 19. Public API (Since JBoss AS 7.1.1) final CommandContext ctx; try { ctx = CommandContextFactory.getInstance().newCommandContext(); } catch(CliInitializationException e) { throw new IllegalStateException("Failed to initialize CLI context", e); } try { // connect to the server controller ctx.connectController(); // execute commands and operations ctx.handle(":take-snapshot"); ctx.handle("deploy myapp.ear"); } catch (CommandLineException e) { // the operation or the command has failed } finally { // terminate the session and // close the connection to the controller ctx.terminateSession(); }
  • 20. try-catch-finally control flow Try /subsystem=datasources/data-source=myds:add(connection-url=xxx,jndi- name=java:/myds,driver-name=h2) catch /subsystem=datasources/data-source=myds:remove /subsystem=datasources/data-source=myds:add(connection-url=xxx,jndi- name=java:/myds,driver-name=h2) finally /subsystem=datasources/data-source=myds:enable end-try
  • 21. if-else control flow if (outcome != success) of /system-property=test:read-resource     /system-property=test:add(value=true) end-if [standalone@localhost:9999 /] /system-property=test:read-resource {     "outcome" => "failed",     "failure-description" => "JBAS014807: Management resource '[("system-property" => "test")]' not found",     "rolled-back" => true } [standalone@localhost:9999 /] /system-property=test:read-resource {     "outcome" => "success",     "result" => {"value" => "true"} }
  • 22. Scripting with Groovy (and all Java lib enabled scripting language) groovy -cp jboss-cli-client.jar uptime.groovy import org.jboss.as.cli.scriptsupport.*   cli = CLI.newInstance() cli.connect()   if (cli.getCommandContext().isDomainMode()) {   cli.cmd("cd /host=master/core-service=platform-mbean/type=runtime") } else {   cli.cmd("cd /core-service=platform-mbean/type=runtime") }   result = cli.cmd(":read-attribute(name=start-time)") response = result.getResponse() startTime = response.get("result").asLong()   result = cli.cmd(":read-attribute(name=uptime)") response = result.getResponse() serveruptime = response.get("result").asString()   println() println("The server was started on " + new Date(startTime)) println("It has been running for " + serveruptime + "ms")   cli.disconnect()
  • 23. Community ● Get involved ! ● Base for JBoss Enterprise Application Platform 6.x ● Download ● http://www.jboss.org/jbossas/downloads ● Forum ● http://community.jboss.org/en/jbossas/as7_us ers
  • 24. Community ● Hacking on AS 7 ● http://community.jboss.org/wiki/HackingonAS 7 ● Command Line Interface ● https://community.jboss.org/wiki/CommandLin ● Operations, Administration & Management of JBoss AS7 ● http://vimeo.com/25855285