Java Reference
In-Depth Information
connect
/server-group=main-server-group:start-servers
/server-group=main-server-group:stop-servers
If you prefer a more granular approach, you can start the single server nodes as shown in
the following example, which shows how you can apply conditional execution logic in
your CLI scripts:
connect
if (result == "STARTED") of /host=master/
server-config=server-one:read-attribute(name=status)
/host=master/server-config=server-one:stop
end-if
if (result == "STARTED") of /host=master/
server-config=server-two:read-attribute(name=status)
/host=master/server-config=server-two:stop
end-if
/host=master/server-config=server-one:start
/host=master/server-config=server-two:start
In the if end-if part of the code, we are checking for the server's status attribute. If
the status is STARTED , the application servers are stopped and then restarted.
Installing a data source as a module
In WildFly, you can use the module command in order to install a new module. We
already did something similar in Chapter 5 , Combining Persistence with CDI . Now, you
can fully automate a data source creation as shown in the following example:
connect
module add --name=org.postgresql --resources=
postgresql-9.3-1101.jdbc41.jar
--dependencies=javax.api,javax.transaction.api
/subsystem=datasources/
jdbc-driver=postgresql:add(driver-module-name=org.postgresql,driver-name=postgresql,driver-class-name=org.postgresql.Driver)
Search WWH ::




Custom Search