JBoss.orgCommunity Documentation
The Section 7.1, “BlackTie Administration Functions” are exposed through a both a JMX MBean and a Java XATMI service deployed into JBoss AS, configured the same btconfig.xml of the domain it is administering
Each BlackTie server exposes the same administration service, registered during AtmiBrokerServer startup
Queue administration for the AtmiBrokerAdmin service is performed through a separate Java XATMI service
stompconnectservice: BlacktieStompAdministrationService
Administration is facilitated graphically from a JBoss AS RHQ administration console plugin
getSoftwareVersion:
Retrieve the software version of the domain
getServerList:
Retrieve the full list of servers
listRunningServers:
Discover running servers
To achieve this, the administration routings lists all the queues locally for the appearance of the string ADMIN
Note servers connected to other JBoss AS instances will not be discoverable
reloadDomain:
Halt servers, update configuration, restart
This causes reloadServer to be called on all running instances
pauseDomain:
This calls pauseServer for each server
servers which connect to the domain which it is paused are paused automatically
resumeDomain:
This calls resumeDomain for each server
Paused servers which reconnect after the domain is resumed will resume automatically
getServersStatus:
This method looks in the btconfig.xml for the list of servers and returns an HTML structure to describe the status of the servers in the domain, if there are no servers running, than instances would not be returned
<!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) --> <span class="xml_tag_symbols"><</span><span class="xml_tag_name">servers</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">server</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">name</span><span class="xml_tag_symbols">></span><span class="xml_plain">[SERVER_NAME]</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">name</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">instances</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">instance</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">id</span><span class="xml_tag_symbols">></span><span class="xml_plain">[ID]</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">id</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">status</span><span class="xml_tag_symbols">></span><span class="xml_plain">[STATUS]</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">status</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">instance</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">instances</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">server</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_tag_symbols"></</span><span class="xml_tag_name">servers</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
[SERVER_NAME] is a arbitrary length character string
[ID] is a server id
[STATUS] is equal to 0 (Idle) or 1 (Running)
getServiceCounter (service name):
Retrieves the counter for a service from all servers
listRunningInstanceIds (server name):
Get the list of ids of currently running servers
serverdone:
Calls server_sigint_handler_callback
Returns 1
reloadServer:
requires an external shell script to repeatedly start server processes dependent upon exit status of server
If the server exits with the reloadServer code, then an svn update on the configuration is issued and the server restarts
advertise (service name):
Does not allow advertise of <SERVER>_ADMIN_<ID>
Calls advertiseByAdmin (don't need the function pointer)
Returns 1
unadvertise (service name):
Suppresses unadvertise of <SERVER>_ADMIN_<ID>
Calls tpunadvertise
Returns 1
pauseServer:
Stop all currently running services
Record which services were paused
A call to tpadvertise will now place a service in the paused status
A call to tpunadvertise will allow unadvertisement of the service
resumeServer:
Start the list of paused services
counter (serviceName):
Calls getServiceMessageCounter
Returns a 16 length buffer
First byte is the number 1
Remaining 15 bytes contains a long
status [optional service name]:
Calls getServiceStatus
Returns an HTML structure ServiceStatus
First byte of the response is the number 1
Remaining bytes contains the ServiceStatus
<!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) --> <span class="xml_tag_symbols"><</span><span class="xml_tag_name">server</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">name</span><span class="xml_tag_symbols">></span><span class="xml_plain">[SERVER_NAME]</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">name</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">services</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">service</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">name</span><span class="xml_tag_symbols">></span><span class="xml_plain">[SERVICE_NAME]</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">name</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"><</span><span class="xml_tag_name">status</span><span class="xml_tag_symbols">></span><span class="xml_plain">[STATUS]</span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">status</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">service</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_plain"> </span><span class="xml_tag_symbols"></</span><span class="xml_tag_name">services</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br /> <span class="xml_tag_symbols"></</span><span class="xml_tag_name">server</span><span class="xml_tag_symbols">></span><span class="xml_plain"></span><br />
[SERVICE_NAME] is a 15 character length name
[STATUS] is equal to 0 (unadvertised) or 1 (advertised)
In a typical BlackTie installation the transaction service will be running in the JBoss Application server where you installed the stomp connect service. In such a setup basic transaction management information is exposed by the native transaction service running in the AS. For example to enable statistics open the JBossTS property file located at:
$JBOSS_HOME/server/<server>/conf/jbossts-properties.xml
and set the enableStatistics property to YES:
<!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) --> <span class="xml_tag_symbols"><</span><span class="xml_tag_name">property</span><span class="xml_plain"> </span><span class="xml_attribute_name">name</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"com.arjuna.ats.arjuna.coordinator.enableStatistics"</span><span class="xml_plain"> </span><span class="xml_attribute_name">value</span><span class="xml_tag_symbols">=</span><span class="xml_attribute_value">"YES"</span><span class="xml_tag_symbols">/></span><span class="xml_plain"></span><br />
The statistics are then available via any standard JMX browser or programatically via JMX. The object name of the MBean that maintains the stats is:
<!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) --> <span class="xml_plain">jboss.management.local:J2EEServer=Local,j2eeType=JTAResource,name=TransactionManager</span><br />
If you are using the web based JBossAS jmx console then look for the name
<!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) --> <span class="xml_plain">J2EEServer=Local,j2eeType=JTAResource,name=TransactionManager</span><br />
in the section called jboss.management.local
In the jmx console some extra transaction information is also exposed as a service with the following name:
<!-- XML : generated by JHighlight v1.0 (http://jhighlight.dev.java.net) --> <span class="xml_plain">service=TransactionManager</span><br />
The statistics are global to the application server. We would like to provide similar information on a per BlackTie domain and per BlackTie server basis in a future release.
Defined in stompconnectservice:BlacktieAdminServiceXATMI
Contains the same functionality as the JMX bean
The XATMI service is accessed by:
User defined XATMI administration clients
Defined in the module: stompconnectservice:BlacktieAdminServiceMBean
The JMX bean is accessed by either:
blacktie-rhq-plugin
Custom JMX administration programs
The BlackTie administration services marshal calls to this raw administration service deployed in each server
The service is bound with a well known name:
<SERVER_NAME>_ADMIN_>SERVER_ID>
Each server exposes the administration service for the duration of its lifespan
Clients (typically the BlackTie administration services) are able to invoke a standard XATMI service with a structured command
Command structure is (note the trailing comma's):
<command>,[<arg1>,<arg2>,....]
copy <BLACKTIE_BIN_DIR>/blacktie-admin-services/blacktie-rhq-plugin-<VERSION>.jar to <JBOSS_HOME>/server/all/deploy/admin-console.war/plugins
restart jboss as
open http://localhost:8080/admin-console, now you can find 'Blacktie Domains'
start a server in <BLACKTIE_BIN_DIR>/example/xatmi/foo following with README
navigate to "Blacktie Domains" -> "fooapp" -> "Servers" -> "default", you can click "Control"
there is a operation named 'shutdown', and you can click the button. You should type in server id which used to start example server, e.g if you start example server with command 'server -c linux -i 1' , and you should type in '1'
other operations such like 'listServiceStatus', 'getServiceCounter', 'advertise' and 'unadvertise'. you could type in a SERVICE NAME, e.g if you want to unadvertise service BAR in server 1, you should click operation 'unadvertise' and type '1' in id also type 'BAR' in service.
The following commands are supported by BlackTie:
Table 7.1. Commands
Command |
Description |
---|---|
Section 7.6.2, “btadmin” |
The btadmin command is used to administer the BlackTie serve process from the command line |
Section 7.6.3, “generate_server” |
The generate_server command is used to build a BlackTie server |
Section 7.6.4, “generate_client” |
The generate_client command is used to build a client application linked against the BlackTie libraries |
The btadmin command is used to perform command line administration of the BlackTie server processes. In a well configured environment, the btadmin tool can be launched in either interactive mode (by ommitting a command) or in non-interactive mode by issues a command, for example: "btadmin startup". For the list of commands type: "help"
You must have called
<BLACKTIE_HOME>/setenv.[sh|bat]
You must, either set
BLACKTIE_CONFIGURATION_DIR
to
the directory containing a btconfig.xml for the domain that you
wish to
administer or ensure a valid btconfig.xml is in the working
directory
Table 7.2. btadmin commands
Command |
Description |
---|---|
version |
Print out the version of BlackTie that is linked against |
startup [<serverName>] |
Start the server, optionally constrained by the serverName |
pauseDomain |
Pause the domain |
advertise <serverName> <serviceName> |
Advertise the service indicated by the name at the server |
help [command] |
Get help on a command |
getServersStatus |
The status of the running servers |
unadvertise <serverName> <serviceName> |
Unadvertise the service at the specified server |
resumeDomain |
Resume the domain |
listRunningServers |
List all running servers in the domain |
quit |
Shutdown the btadmin tool, a no-op for a non-interactive btadmin shell |
listRunningInstanceIds <serverName> |
List the running instance ids of a specific server |
listServiceStatus <serverName> <serviceName> |
List the status of the service running on a particular server group |
shutdown [<serverName> [<serverId>]] |
Shutdown items in the domain, optionally constrained by a server name and (again, optionally) a serverId |
The generate_server command is used to create a standalone BlackTie server application linking the user code against the BlackTie runtime libraries.
generate_server <-Dservice.names=service[,service2,...]> <-Dserver.includes="source1[ source2 ..."]> <-Dx.inc.dir="directory"> <-Dx.inc.dir2="directory2"> <-Dx.lib.dir="directory" -Dx.libs="library[ library2]"> <-Dx.lib.dir2="directory2"> <-Dx.libs2="library[ library2]"> <-Dx.define="symbol1[,symbol2]">
Table 7.3. generate_server parameter
Parameter |
Description |
---|---|
-Dservice.names=service[,service2,...] |
This is the comma seperated list of services that should be advertised at boottime that were not coded in a DLL export compatible manner and as such cannot be registered for advertised in the btconfig.xml |
-Dserver.includes="source1[ source2 ..."] |
The list of files that should be compiled into this server |
-Dx.inc.dir="directory" |
A single additional directory for including |
-Dx.lib.dir="directory" |
A single additional directory for linking against |
-Dx.libs="library[ library2]" |
A space seperated list of libraries to link against in the lib dir |
-Dx.inc.dir2="directory" |
A second additional directory to include headers from |
-Dx.lib.dir2="directory" |
A second additional directory to include libraries from |
-Dx.libs2="library[ library2]" |
The list of libraries to include from the second library directory |
-Dx.define="symbol1[,symbol2]" |
The comma-seperated list of addtional pre-processor symbols to define |
To link against the Oracle database
On Linux:
generate_server -Dservice.names=BAR -Dserver.includes="request.c ora.c DbService.c" -Dx.inc.dir="$ORACLE_HOME/rdbms/public" -Dx.lib.dir="$ORACLE_HOME/lib" -Dx.libs="occi clntsh" -Dx.define="ORACLE"
On Windows:
generate_server -Dservice.names=BAR -Dserver.includes="request.c ora.c DbService.c" -Dx.inc.dir="%ORACLE_HOME%\OCI\include" -Dx.lib.dir="%ORACLE_HOME%\OCI\lib\MSVC" -Dx.libs="oci" -Dx.define="ORACLE"
The generate_client command is used to create a standalone client application linking the user code against the BlackTie runtime libraries.
generate_client <-Dclient.includes="source1[ source2 ..."]> <-Dx.inc.dir="directory" > <-Dx.inc.dir2="directory2"> <-Dx.lib.dir="directory" -Dx.libs="library[ library2]"> <-Dx.lib.dir2="directory2"> <-Dx.libs2="library[ library2]"> <-Dx.define="symbol1[,symbol2]">
Table 7.4. generate_client parameter
Parameter |
Description |
---|---|
-Dclient.includes="source1[ source2 ..."] |
The list of files that should be compiled into this client |
-Dx.inc.dir="directory" |
A single additional directory for including |
-Dx.lib.dir="directory" |
A single additional directory for linking against |
-Dx.libs="library[ library2]" |
A space seperated list of libraries to link against in the lib dir |
-Dx.inc.dir2="directory" |
A second additional directory to include headers from |
-Dx.lib.dir2="directory" |
A second additional directory to include libraries from |
-Dx.libs2="library[ library2]" |
The list of libraries to include from the second library directory |
-Dx.define="symbol1[,symbol2]" |
The comma-seperated list of addtional pre-processor symbols to define |
To create a client which links against the Oracle database.
On Linux:
generate_client -Dclient.includes="client.c request.c ora.c cutil.c" -Dx.inc.dir="$ORACLE_HOME/rdbms/public" -Dx.lib.dir="$ORACLE_HOME/lib" -Dx.libs="occi clntsh" -Dx.define="ORACLE"
On Windows:
generate_client -Dclient.includes="client.c request.c ora.c cutil.c" -Dx.inc.dir="%ORACLE_HOME%\OCI\include" -Dx.lib.dir="%ORACLE_HOME%\OCI\lib\MSVC" -Dx.libs="oci" -Dx.define="ORACLE"