units, and if they are not currently satisfied in the en-
vironment, new activities have to be added to the plan
to fulfill all the necessary requirements. Specifically,
each unit exports a set of resources and has dependen-
cies with other units, which export resources required
for its execution. Moreover, units have constraints
that need to be fulfilled by the container in which the
deployment will be carried out (e.g. EJB container,
glassfish server,...). Deployment unit data are stored
in the Deployment Repository.
The information to be considered depends on the
activity to be performed on a software unit. For ex-
ample, to start a unit requires to verify that all de-
pendent units are available, while to stop a unit needs
to consider if this unit is being used by others. To
manage such information, two different dependency
graphs are used, one manages the units required by a
unit, it means its dependencies, while the other ana-
lyzes the deployed units that are using and are used
by a unit, it means the relations among runtime units
in the current environment.
2.2 Knowledge-based System
Using a knowledge-based system for the validation of
the deployment of software units allows domain ex-
pert users to define the checks to perform during the
validation and the most appropriate actions to follow
in each case. Inference engine takes this information,
stored in the knowledge base, to verify the operations
of the deployment plan that is going to be executed,
considering the requirements of the software units in-
volved in the plan and the current state of the environ-
ment related to that plan.
A rule-based system has been used to specify con-
ditions and actions to perform under specific situa-
tions. Rules are represented in a decision table, en-
abling their updating in the future in an easy way.
Table columns contain the conditions and associated
actions to execute in each case, determining the sys-
tem behavior. Therefore, each row of the table corre-
sponds to a rule, that are classified into several groups:
• Initialization, this rule starts the verification of the
deployment environment related to the plan.
• Environment elements, this set of rules verifies
that the nodes and containers of the deployment
environment are in a correct state.
• Deployed units, these rules check if the unit as-
sociated to an activity is already deployed on the
environment and analyzes its state.
• Necessary units, in this case, rules are used to
check if dependencies imposed by the unit are sat-
isfied by the environment. For example, if a unit
that depends on another is going to be started, it is
necessary to verify if the required unit is currently
launched.
• Overversion units, these rules check if there are
other units with the same name but different ver-
sion already deployed on the environment.
• Completion, these rules end the validation pro-
cess.
The execution order of the rules corresponds to
the order in which they are exposed, for example, if
a container is not available (feature considered in the
environment elements, the second group of rules), the
validation ends and a report is created to inform the
user about this fact.
2.3 Results
The result of the validation of each activity is com-
posed of a list of messages, each of them contains the
type of the response and a text, which explains the
reason and the cause of the response. In particular,
possible answers are:
• NONE indicates that the outcome of the valida-
tion has been positive and the activity can be exe-
cuted.
• NEXT, in this case, the result of the activity to per-
form is already implemented in the environment,
so this activity is not necessary to be carried out.
• WARNING indicates that there is a conflict and
the execution of the activity can cause problems.
• ABORT implies that there is a problem in the en-
vironment and the associated activity can not be
executed.
For example, if one of the plan activities consists
of launching a deployment unit that is not present
in the container, validation system will report an
ABORT message, in which the text will indicate that
the unit is not present in the container, showing also
the data related to that unit.
If an activity has to be aborted, all activities that
depend on it will generate an ABORT response too.
3 IMPLEMENTATION
The validation system has been developed as an OSGi
bundle. OSGi (OSGi Alliance, 2009) is a Java-based
service platform that implements a dynamic compo-
nent model. Each component or bundle is a dynam-
ically loadable set of classes, configuration files, and
resources, that hides its implementation details and
A KNOWLEDGE-BASED SYSTEM FOR THE VALIDATION OF THE DEPLOYMENT OF SOFTWARE UNITS
307