JBoss Command Line Interface

Since version EAP 6.0 and AS 7.0, the JBoss CLI allows users to control and configure the JBoss instance from the command line. The Command Line Interface (CLI) is a command line management tool for the domain or a standalone server. It allows a user to connect to the domain controller or a standalone server and execute management operations available through the detyped management model.

RapidDeploy has developed a task to execute a script containing a list of commands to be exectuted. The task has a setting to batch all the commands in the script into one transaction or not. This means if the task is set to batched and one of commands in the CLI script fails then all the previous commands in the script will be reverted. If the task is not set to batched then each command in the file is committed as soon as it completes successfully.

Usage

The task uses the connection details from the Environment Product settings to connect to the specific controller or server instance by using the host and port settings.

Example Script

/subsystem=datasources/jdbc-driver=OracleDriver:add(driver-name=OracleDriver,driver-module-name=com.oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource) /subsystem=datasources/data-source=myAppDataSource/:add(connection-url=jdbc:oracle:thin:@localhost:1521:xe,jndi-name=java:jboss/jdbc/myAppDataSource,driver-name=OracleDriver,xa-datasource-class=oracle.jdbc.xa.client.OracleXADataSource,user-name=myAppDsUserName,password=myAppDsPassword,use-java-context=false,pool-prefill=false,pool-use-strict-min=false,interleaving=false,no-tx-separate-pool=false,pad-xid=false,same-rm-override=false,wrap-xa-resource=false,allow-multiple-users=false,share-prepared-statements=false,set-tx-query-timeout=false,background-validation=false,use-fast-fail=false,validate-on-match=false,spy=false,use-ccm=false,no-recovery=false,jta=false) /subsystem=datasources/data-source=myAppDataSource/:enable(persistent=true) /subsystem=datasources/data-source=myAppDataSource/:test-connection-in-pool /subsystem=logging/size-rotating-file-handler=FILE_BY_SIZE:add(level=INFO,formatter="%dHH:mm:ss,SSS %-5p [%c] (%t) %s%E%n",max-backup-index=3,rotate-size=1024,file="path"=>"production-server.log","relative-to"=>"jboss.server.log.dir") /subsystem=logging/logger=com.jboss.logtest:add(level=INFO,handlers=["FILE_BY_SIZE"])