Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
JBoss AS7 Overview
1. Andrea Leoncini
JBoss Senior Solution Architect @ Red Hat
andrea.leoncini@redhat.com
It’s JBoss, but not as we know it
2. EVERYTHING CHANGES
• AS7 is the major application server rewriting
• much bigger change than AS4 to AS5
• Lots of new features
• Module based services & Modular Service Container
• Domain mode and Standalone mode
• New configuration
• Everything has changed
3. MOTIVATIONS FOR AS7
• Improve usability
• with AS4 and AS5 the JBoss user used to be an expert
• Increase manageability
• with AS4 and AS5 each server is based on specific configuration
• Simplify configurations
• with AS4 and AS5 each service has its own configuration approach
• Higly performant - GO FAST!
• much faster than previous versions
4. 7 REASONS TO LOVE AS7
• blazingly fast (<3s startup)
• lightweight
• modular
• hot parallel deployment
• elegant administration
• domain management
• easy testable
5. KEY NEW FEATURES
• Fast and lightweight
• Supports domain (multi node) management
• Multiple consistent management interfaces
CLI, Java API, HTTP API, Web Console
• Unified user-focused configuration
• Modular
• Pluggable components of the application server, referenced from profiles, based on module.xml
• tha basis of classloading in AS7
7. THE NEW JBOSS SCENARIO
host301.prod.acme.it host302.prod.acme.it host303.prod.acme.it
JBoss Server JBoss Server JBoss Server
MonteMario Pietralata EUR
JBoss Server JBoss Server
Trastevere Garbatella
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Domain
Contoller
host199.mgmt.acme.it
8. HOST
host301.prod.acme.it
esil903.ac.bankit.it host302.prod.acme.it esil905.ac.bankit.it
Host:
JBoss Server each “host
JBoss Server box” represents a physical or virtual host.
JBoss Server
MonteMario Pietralata box can contain zero, one or multiple server
Each EUR
instances
JBoss Server JBoss Server
Trastevere Garbatella
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Domain
Contoller
host199.mgmt.acme.it
9. HOST CONTROLLER
esil903.ac.bankit.it Host Controller:
esil904.ac.bankit.it esil905.ac.bankit.it
When domain.sh script is run on a host, a process known as a Host Controller is launched. The Host Controller is solely
JBoss Server JBoss Server JBoss Server
concerned with server management; it does not handle application server workloads. The Host Controller is responsible for
MonteMario Pietralata EUR
starting and stopping the individual application server processes that run on its host, and interacts with the Domain
Controller to help manage them.
JBoss Server JBoss Server
Trastevere Garbatella
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Domain
Contoller
host199.mgmt.acme.it
10. DOMAIN CONTROLLER
Domain Controller:
esil903.ac.bankit.it
One Host Controller instance is configured to act as the central management point for the entire domain, i.e. to be the
esil904.ac.bankit.it esil905.ac.bankit.it
Domain Controller. The primary responsibility of the Domain Controller is to maintain the domain's central management
JBoss Server JBoss contents, JBoss Server
policy, to ensure all Host Controllers are aware of its currentServer and to assist the Host Controllers ensuring that any
MonteMario Pietralata EUR
running application server instances are configured in accordance with this policy. This central management policy is stored by
default in the domain/configuration/domain.xml file in the unzipped JBoss Application Server 7 installation on Domain
Controller's host's filesystem. JBoss Server JBoss Server
A domain.xml file must be located in the domain/configuration directory of an installation that's meant to run the Domain
Trastevere Garbatella
Controller. It does not need to be present in the installations that are not meant to run a Domain Controller; i.e. those whose
Host Controller is configured to contact a remote Domain Controller. The presence of a domain.xml file on such a server
JBoss Server
does no harm. Trionfale
Host Host Host
Contoller Contoller Contoller
Domain
Contoller
host199.mgmt.acme.it
11. SERVER GROUP
host301.prod.acme.it host302.prod.acme.it host303.prod.acme.it
JBoss Server
JBoss Server JBoss Server JBoss Server
JBoss Server
MonteMario
MonteMario Pietralata EUR
EUR
restful-group
JBoss Server JBoss Server
Trastevere Garbatella
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Server Group:
A server group is set of server instances that will be managed and configured as one. In a managed domain each application
server instance is a member of a server group. (Even if the group has just a single server, the server is still a member of a
group.) It is the responsibility of the Domain Controller and the Host Controllers to ensure that all servers in a server group
Domain
have a consistent configuration. They should all be configured with the same profile and they should have the same
deployment content deployed Contoller
host199.mgmt.acme.it
12. SERVER GROUP
host301.prod.acme.it host302.prod.acme.it host303.prod.acme.it
JBoss Server JBoss Server JBoss Server
MonteMario Pietralata EUR
JBoss Server JBoss Server
Trastevere Garbatella
midsize-group
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Domain
Contoller
host199.mgmt.acme.it
13. SERVER INSTANCE
host301.prod.acme.it host302.prod.acme.it host303.prod.acme.it
JBoss Server JBoss Server JBoss Server
MonteMario Pietralata EUR
JBoss Server JBoss Server
Trastevere Garbatella
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Server:
Each "Server" in the above diagram represents an actual application server instance.
The server runs in a separate JVM process from the Host Controller. The Host
Controller is responsible for launching that process. (In a managed domain the end
Domain
user cannot directly launch a server process from the command line).
Contoller
host199.mgmt.acme.it
14. DEPLOYMENT
host301.prod.acme.it host302.prod.acme.it host303.prod.acme.it
JBoss Server JBoss Server JBoss Server
MonteMario Pietralata EUR
JBoss Server JBoss Server
Trastevere Garbatella
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Domain
Contoller
New Module
host199.mgmt.acme.it
<datasource>
15. DEPLOYMENT
host301.prod.acme.it host302.prod.acme.it host303.prod.acme.it
JBoss Server JBoss Server JBoss Server
MonteMario Pietralata EUR
JBoss Server JBoss Server
Trastevere Garbatella
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Domain
Contoller
New Module
host199.mgmt.acme.it
<datasource>
16. DEPLOYMENT
host301.prod.acme.it host302.prod.acme.it host303.prod.acme.it
JBoss Server JBoss Server JBoss Server
MonteMario Pietralata EUR
New Module New Module
<datasource> <datasource>
JBoss Server JBoss Server
Trastevere Garbatella
JBoss Server
Trionfale
Host Host Host
Contoller Contoller Contoller
Domain
Contoller
host199.mgmt.acme.it
17. JBoss Modules is a standalone implementation of a
modular (non-hierarchical) class loading and execution
environment for Java. In other words, rather than a single
class loader which loads all JARs into a flat class path, each
library becomes a module which only links against the exact
modules it depends on, and nothing more. It implements a
thread-safe, fast, and highly concurrent delegating class
loader model, coupled to an extensible module resolution
system, which combine to form a unique, simple and
powerful system for application execution and distribution.
JBOSS MODULES
18. System CL
Server CL
Deployment CL Deployment CL
HIERARCHICAL CL
22. USER DEPLOYMENTS
• User deployments are modules too
• Sets up dependencies on some modules automatically
(e.g. JPA, Hibernate, WebServices)
• Theuser can also set up their own dependencies on app
server modules
23. USER DEPLOYMENTS DETAILS
• Each sub-deployment in an EAR is its own module
• Sub-deployments in an EAR do not have access to other sub-deplyments
by default
• Allows for individuals ejb-JARs to have dependencies on different versions
of classes
• Also provide a relaxed isolation mode, which automatically sets up
dependencies between all the sub-deployments in the EAR
• Dependencies can be set up using the manifest, a custom deployment
descriptor or on a global level.
24. • In AS7 almost everything is a service
• Services are objects that can be started and stopped
• Services can have dependencies on other services
• When all services dependencies are satisfied it will attempt to start
• If a dependency going to be stopped then MSC will stop all
dependent services first
• Services can inject dependent services
SERVICES
25. EVERYTHING IS A SERVICE!
• Aspreviously mentioned almost everything in AS7 is a
service, including:
• EJBs
• JNDI Bindings
• Servlets
• The deployments itself
26. TWO OPERATIONAL MODES
• Standalone
This is the traditional JBoss single JVM server
This will have management facilities IN-VM
• Domain
Multi JVM multi server model
Management coordinated by Domain Controller Process
Multiple server instances (JVMs) per host
Full lifecycle managed by Process Controller
27. STANDALONE MODE
• Standalone is a single AS process for use in development,
where the additional management functionality is not required
• Itprovides a similar development experience to previous
versions of the AS, allowing for a deployment to be dropped
in the deployment folder and automatically deployed
• Canstill be managed by the same tools and APIs as domain
mode
28. DOMAIN MODE
• Easy management of multiple AS instances
• managed from a single point and all have access to the same domain
configuration
• allows management and configuration updates to be pushed to all servers
• when operating in domain mode there will be three classes of processes:
• Proces Controller
• Host Controller
• Server Instance
29. WHEN YOU START A HOST IN
DOMAIN MODE
• Process Controller
responsible for managing and starting / restarting processes
extremely simple, not much that can go wrong.
This is the process that the system will take care of, for example
at bootstrap, or by > service jboss start (/etc/init.d)
• Host Controller
One host controller is the Domain Controller, the rest are slaves
DC is responsible for pushing out configuration changes over the
domain. Domain C. and Host C. are responsible for remote
management
30. WHEN YOU START AN HOST IN
DOMAIN MODE
• Host Controller
By default each Host Controller reads its configuration from the domain/configuration/host.xml file located
in the unzipped JBoss Application Server 7 installation on its host's filesystem. The host.xml file contains
configuration information specific to the particular host. Primarily:
• the listing of the names of the actual JBoss Application Server 7 instances that are meant to run off of
this installation
• configuration of how the Host Controller has to contact the Domain Controller to register itself and
access the domain configuration. This may either be configuration of how to find and contact a remote
Domain Controller, or a configuration telling the Host Controller to act as the Domain Controller
• configuration of items that are specific to the local physical installation. For example, named interface
definitions declared in domain.xml (see below) can be mapped to an actual machine-specific IP address
in host.xml. Abstract path names in domain.xml can be mapped to actual filesystem paths in host.xml
43. FILE
LAYOUT
also uses domain.conf but it
just sets the Host controller
configuration
44. FILE
LAYOUT
In the domain mode
domain.xml contains
configurations common to all
instances
45. FILE
LAYOUT
In the domain mode
host.xml contains the servers
configurations
46. FILE
LAYOUT
In the domain mode
for each server there will be
just working directories
47. • ONE configuration file
• standalone.xml - domain.xml
• Management API allows persistent changes to the configuration
• Management API can manage all servers in the domain
• Management console provides user friendly management in a web
browser
• command line tool (higly scriptable)
MANAGEMENT
48. • ONE configuration file
• standalone.xml - domain.xml
• Management API that allows for persistent changes to the configuration
• Management API can manage all servers in the domain
The XML configuration files act as a central, authoritative source of configuration. Any
configuration changes made via the web interface or the CLI are persisted back to the XML
• Management console to provide user friendly management in a web
configuration files. If a domain or standalone server is offline, the XML configuration files can be
hand edited as well, and any changes will be picked up when the domain or standalone server is
browser next started. However, users are encouraged to use the web interface or the CLI in preference
to making offline edits to the configuration files. External changes made to the configuration
files while processes are running will not be detected, and may be overwritten
• command line tool for use in scripts
MANAGEMENT
51. • Scriptable command line management tool
• Uses the management API internally
• Allows
access to high level user friendly commands
create-jms-queue --name testQueue
• Alsoallows direct access to the domain model, giving access
to the full functionality of the management API
MANAGEMENT VIA CLI
58. TESTING WITH ARQUILLIAN
• AS7 supports easy testing with Arquillian
• Arquillian
is used both in the internal test suite and by end
users to test their applications
• Combined with the fast startup speed of AS7 testing in the
container is just as easy as running normal JUnit tests.