org.sape.carbon.services.deployment
Class DefaultDeploymentServiceImpl

java.lang.Object
  |
  +--org.sape.carbon.services.deployment.DefaultDeploymentServiceImpl
All Implemented Interfaces:
Configurable, DeploymentService, FunctionalInterface, Startable, Suspendable

public class DefaultDeploymentServiceImpl
extends Object
implements DeploymentService, Configurable, Startable, Suspendable

This implementation of DeploymentService uses BootStrapper.getEnvironmentName and BootStrapper.getInstanceName to determine which environment and instance the current deployment is.

Since:
carbon 1.0
Version:
$Revision: 1.16 $($Author: dvoet $ / $Date: 2003/09/24 20:31:11 $)
Copyright 2002 Sapient
Author:
Douglas Voet, April 2002

Field Summary
protected  String currentDeploymentNodeName
          Holds name of the current deployment node.
protected  Folder deploymentsNode
          Holds a reference to the Node that contains deployment information.
protected  String targetNodeName
          Holds the name of the node with current deployment info.
 
Constructor Summary
DefaultDeploymentServiceImpl()
           
 
Method Summary
 void configure(ComponentConfiguration configuration)
          Fetches the deployment node and stores the CurrentDeploymentNodeName
protected  String constructTargetNodeName(ComponentConfiguration serviceConfig)
          Helper method that constructs the name of the node that will be used as the target of the deployment link.
protected  void createDeploymentLink()
          Helper method that does the work of creating the link to the current deployment configuration.
 void resume()
          Assumes the service has been reconfigured and recreates the link to the current deployment.
 void start()
          Creates the link to the current deployment.
 void stop()
          Stop the component.
 void suspend()
          Suspend the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deploymentsNode

protected Folder deploymentsNode
Holds a reference to the Node that contains deployment information.


currentDeploymentNodeName

protected String currentDeploymentNodeName
Holds name of the current deployment node.


targetNodeName

protected String targetNodeName
Holds the name of the node with current deployment info.

Constructor Detail

DefaultDeploymentServiceImpl

public DefaultDeploymentServiceImpl()
Method Detail

configure

public void configure(ComponentConfiguration configuration)
               throws DeploymentServiceException
Fetches the deployment node and stores the CurrentDeploymentNodeName

Specified by:
configure in interface Configurable
Parameters:
configuration - the configuration for this component
DeploymentServiceException
See Also:
Configurable.configure(ComponentConfiguration)

start

public void start()
           throws DeploymentServiceException
Creates the link to the current deployment.

Specified by:
start in interface Startable
DeploymentServiceException
See Also:
Startable.start()

stop

public void stop()
Description copied from interface: Startable
Stop the component. Prior to entry, the container will cease forwarding requests for service to the component. This is an opportunity to cleanly complete or abort any outstanding work. For example, a set of worker threads could be killed off, or a queue set to drain.

Specified by:
stop in interface Startable
See Also:
Startable.stop()

resume

public void resume()
            throws DeploymentServiceException
Assumes the service has been reconfigured and recreates the link to the current deployment.

Specified by:
resume in interface Suspendable
DeploymentServiceException
See Also:
Suspendable.resume()

suspend

public void suspend()
Description copied from interface: Suspendable
Suspend the component. This is an opportunity to 'pause' any ongoing work". Prior to calling this method, the container will block requests for service to the component.

Specified by:
suspend in interface Suspendable
See Also:
Suspendable.suspend()

createDeploymentLink

protected void createDeploymentLink()
                             throws DeploymentServiceException
Helper method that does the work of creating the link to the current deployment configuration.

Throws:
DeploymentServiceException - indicates an error creating the deployment link.

constructTargetNodeName

protected String constructTargetNodeName(ComponentConfiguration serviceConfig)
                                  throws DeploymentServiceException
Helper method that constructs the name of the node that will be used as the target of the deployment link. This node holds the actual configuration values that will be used in this deployment. This method is called from the configure lifecycle method. Override this method to change how the target node name is constructed.

Parameters:
serviceConfig - the configuration for this service (the config passed into the configure method)
Returns:
the path to the node that should be the target of the deployment link. Although it is not required, this should be a relative path.
DeploymentServiceException


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.