pier        2004/03/30 08:19:06

  Modified:    src/kernel/org/apache/cocoon/kernel/deployment Deployer.java
  Log:
  Adding methods to manage reload of Instances in the Deployer.
  
  Revision  Changes    Path
  1.2       +53 -0     
cocoon-2.2/src/kernel/org/apache/cocoon/kernel/deployment/Deployer.java
  
  Index: Deployer.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.2/src/kernel/org/apache/cocoon/kernel/deployment/Deployer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Deployer.java     30 Mar 2004 13:30:37 -0000      1.1
  +++ Deployer.java     30 Mar 2004 16:19:06 -0000      1.2
  @@ -18,6 +18,7 @@
    * 
========================================================================== */
   package org.apache.cocoon.kernel.deployment;
   
  +import java.util.Iterator;
   import org.apache.cocoon.kernel.identification.Identifier;
   import org.apache.cocoon.kernel.archival.Library;
   
  @@ -40,6 +41,11 @@
        * but those will never be "instantiated" (like in Java ™
        * it is impossible to create new instances of interface classes).</p>
        *
  +     * <p>The returned [EMAIL PROTECTED] Instance} will not be deployed 
until the
  +     * [EMAIL PROTECTED] #deploy(Instance)} method is called, but it will be 
returned by
  +     * the [EMAIL PROTECTED] #instances()} method and its [EMAIL PROTECTED] 
Instance#deployed()}
  +     * will return <b>false</b>.</p>
  +     *
        * @param identifier the [EMAIL PROTECTED] Identifier} of the block to 
deploy.
        * @param name an optional (possibly unique) [EMAIL PROTECTED] String} 
instance name.
        * @return a <b>non null</b> block [EMAIL PROTECTED] Instance}.
  @@ -58,4 +64,51 @@
        */
       public void deploy(Instance instance)
       throws DeploymentException;
  +
  +    /**
  +     * <p>Replace the specified block [EMAIL PROTECTED] Instance} with 
another one.</p>
  +     *
  +     * <p>This method will replace a deployed [EMAIL PROTECTED] Instance} 
with another,
  +     * rewiring all wired blocks to the new [EMAIL PROTECTED] Instance}.</p>
  +     *
  +     * <p>The old [EMAIL PROTECTED] Instance} will not be destroyed, but 
still returned
  +     * by the [EMAIL PROTECTED] #instances()} method, but its [EMAIL 
PROTECTED] Instance#deployed()}
  +     * will return <b>false</b>.</p>
  +     *
  +     * @param old the old [EMAIL PROTECTED] Instance} instance to replace.
  +     * @param instance the [EMAIL PROTECTED] Instance} replacing the old 
[EMAIL PROTECTED] Instance}.
  +     * @throws DeploymentException if the specified [EMAIL PROTECTED] 
Instance} could
  +     *                             not be replaced for any reason.
  +     */
  +    public void replace(Instance old, Instance instance)
  +    throws DeploymentException;
  +
  +    /**
  +     * <p>Destroy the specified deployed block [EMAIL PROTECTED] 
Instance}.</p>
  +     *
  +     * <p>If the specified [EMAIL PROTECTED] Instance} is deployed 
<b>and</b> is required
  +     * by any other block (there is an active wiring), this method will throw
  +     * a [EMAIL PROTECTED] DeploymentException}.</p>
  +     *
  +     * <p>If this [EMAIL PROTECTED] Instance} has been replaced by another 
or has not been
  +     * wired to any other block, all the eventual wirings to it will be cut 
and
  +     * it will be destroyed.</p>
  +     *
  +     * @param instance the [EMAIL PROTECTED] Instance} instance to deploy.
  +     * @throws DeploymentException if the specified [EMAIL PROTECTED] 
Instance} could
  +     *                             not be deployed for any reason.
  +     */
  +    public void destroy(Instance instance)
  +    throws DeploymentException;
  +
  +    /**
  +     * <p>Return an [EMAIL PROTECTED] Iterator} over all [EMAIL PROTECTED] 
Instance}s known by this
  +     * [EMAIL PROTECTED] Deployer}.</p>
  +     *
  +     * <p>This method will return all instances known by this [EMAIL 
PROTECTED] Deployer},
  +     * whether they have been simply installed, deployed, or have been 
replaced
  +     * by other instances. To check if an [EMAIL PROTECTED] Instance} is 
actively deployed
  +     * the [EMAIL PROTECTED] Instance#deployed()} method can be called.</p>
  +     */
  +    public Iterator instances();
   }
  
  
  

Reply via email to