JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.distribution
Class DeploymentRule

java.lang.Object
  |
  +--org.objectweb.jac.aspects.distribution.DeploymentRule
All Implemented Interfaces:
Serializable

public class DeploymentRule
extends Object
implements Serializable

A deployment rule parametrizes the deployment scheme of a set of objects identified by a regular expression.

Each object that is named by the naming aspect so that it matches the regular expression will be deployed regarding the deployment rule.

The deployment aspect component uses a set of deployment rules to know how to handle a newly used object.

Author:
Renaud Pawlak
See Also:
DeploymentAC, Deployment, Topology, Serialized Form

Constructor Summary
DeploymentRule(AspectComponent ac, String type, String nameRegexp, String contRegexp, boolean state)
          Creates a new deployment rule in the general case.
 
Method Summary
 void applyTo(Object object)
          Applies the rule to the given object.
 String getType()
          Returns a readable string representation of the type of this distribution rule.
 boolean isApplicableTo(Object candidate)
          Returns true if the deployment rule must by applied on a given object.
 boolean isAppliedTo(Object object)
          Tells if the rule is already applied to a given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeploymentRule

public DeploymentRule(AspectComponent ac,
                      String type,
                      String nameRegexp,
                      String contRegexp,
                      boolean state)
Creates a new deployment rule in the general case.

Parameters:
type - a string that contains a readable representation of what the rule is doing
nameRegexp - a regular expression that filters the objects to which this rule will be applied
contRegexp - a regular expression that defines a set of remote container where the objects of the rule will be deployed
state - if true, the states of the objects are replicated, else, it only deploys empty objects
Method Detail

isApplicableTo

public boolean isApplicableTo(Object candidate)
Returns true if the deployment rule must by applied on a given object.

Parameters:
candidate - the tested object
Returns:
true if the candiate matches the rule

isAppliedTo

public boolean isAppliedTo(Object object)
Tells if the rule is already applied to a given object.

Parameters:
object - the object to test
Returns:
true if the rule is applied to the object

applyTo

public void applyTo(Object object)
Applies the rule to the given object.

Parameters:
object - the object on which the deployment rule will be applied to

getType

public String getType()
Returns a readable string representation of the type of this distribution rule.

Returns:
the type

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli