org.apache.axis2.engine
Class DeployableChain

java.lang.Object
  extended by org.apache.axis2.engine.DeployableChain

public class DeployableChain
extends java.lang.Object

A DeployableChain is a container which manages dependencies between Deployables. You deploy() them in, then call rebuild() which will set up a chain, correctly ordered according to the constraints in the Deployables.


Constructor Summary
DeployableChain()
           
 
Method Summary
 void addRelationship(java.lang.String before, java.lang.String after)
          Adds a before/after relationship to the active constraints.
 void deploy(Deployable deployable)
          Deploy a Deployable into this chain.
 java.util.List getChain()
          Get the chain - once rebuild() has been called this will be the chain of target objects.
 void rebuild()
          Taking into account all the active constraints, order the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeployableChain

public DeployableChain()
Method Detail

deploy

public void deploy(Deployable deployable)
            throws java.lang.Exception
Deploy a Deployable into this chain. Note that this does NOT order yet. The idea is to deploy everything first, then call rebuild() to generate the fully ordered chain. This method will validate the Deployable, including confirming that it's compatible with any previously deployed item of the same name.

Parameters:
deployable - Deployable to deploy.
Throws:
java.lang.Exception - if there is a deployment error.

rebuild

public void rebuild()
             throws java.lang.Exception
Taking into account all the active constraints, order the list. This blows away the old order. Could improve this slightly with a "dirty" flag.

Throws:
java.lang.Exception - if there's an ordering conflict

addRelationship

public void addRelationship(java.lang.String before,
                            java.lang.String after)
Adds a before/after relationship to the active constraints.

Parameters:
before - name of the Deployable that must come first
after - name of the Deployable that must come later

getChain

public java.util.List getChain()
Get the chain - once rebuild() has been called this will be the chain of target objects.

Returns:
a List of target objects in the correct order


Copyright © 2007 Apache Web Services Project. All Rights Reserved.