org.apache.pluto.descriptors.services.impl
Class AbstractWebAppDescriptorService

java.lang.Object
  extended by org.apache.pluto.descriptors.services.impl.AbstractCastorDescriptorService
      extended by org.apache.pluto.descriptors.services.impl.AbstractWebAppDescriptorService
All Implemented Interfaces:
WebAppDescriptorService
Direct Known Subclasses:
ContextWebAppDescriptorServiceImpl, FileWebAppDescriptorServiceImpl

public abstract class AbstractWebAppDescriptorService
extends AbstractCastorDescriptorService
implements WebAppDescriptorService

Abstract Implementation of the Web Application Deployment Descriptor service. Provides default implementation of the service; requiring only that subclasses provide the input streams to/from the actual descriptor.

Since:
Mar 5, 2005
Version:
$Id: AbstractWebAppDescriptorService.java 156743 2005-03-10 05:50:30Z ddewolf $
Author:
David H. DeWolf

Field Summary
private  boolean create
          Flag to determine if an empty deployment descriptor should be created (in memory) if the actual descriptor does not exist.
static java.lang.String WEB_XML_MAPPING
           
 
Constructor Summary
protected AbstractWebAppDescriptorService(java.lang.String contextPath)
          Default Constructor.
protected AbstractWebAppDescriptorService(java.lang.String contextPath, boolean create)
          Secondary Constructor.
 
Method Summary
protected  Mapping getCastorMapping()
          Read and Retrieve the Web Application's Castor Mapping resource.
protected  java.lang.String getDTDUri()
          Retrieve the Web Application Deployment descriptor's DTD uri.
protected  java.lang.String getPublicId()
          Retrieve the Web Application Deployment descriptor's public Id.
 WebAppDD read()
          Read the Web Application Deployment Descriptor.
 void write(WebAppDD webApp)
          Write the deployment descriptor.
 
Methods inherited from class org.apache.pluto.descriptors.services.impl.AbstractCastorDescriptorService
getContextPath, getIgnoreExtraElements, getInputStream, getOutputStream, readInternal, writeInternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.pluto.descriptors.services.WebAppDescriptorService
getContextPath
 

Field Detail

WEB_XML_MAPPING

public static final java.lang.String WEB_XML_MAPPING
See Also:
Constant Field Values

create

private boolean create
Flag to determine if an empty deployment descriptor should be created (in memory) if the actual descriptor does not exist.

Constructor Detail

AbstractWebAppDescriptorService

protected AbstractWebAppDescriptorService(java.lang.String contextPath)
Default Constructor.


AbstractWebAppDescriptorService

protected AbstractWebAppDescriptorService(java.lang.String contextPath,
                                          boolean create)
Secondary Constructor. Create an instance and specify whether or not a default/empty instance should be returned if no descriptor is available.

Parameters:
create -
Method Detail

read

public WebAppDD read()
              throws java.io.IOException
Read the Web Application Deployment Descriptor.

Specified by:
read in interface WebAppDescriptorService
Returns:
WebAppDD instance representing the descriptor.
Throws:
java.io.IOException

write

public void write(WebAppDD webApp)
           throws java.io.IOException
Write the deployment descriptor.

Specified by:
write in interface WebAppDescriptorService
Parameters:
webApp -
Throws:
java.io.IOException

getPublicId

protected java.lang.String getPublicId()
Retrieve the Web Application Deployment descriptor's public Id.

Specified by:
getPublicId in class AbstractCastorDescriptorService
Returns:

getDTDUri

protected java.lang.String getDTDUri()
Retrieve the Web Application Deployment descriptor's DTD uri.

Specified by:
getDTDUri in class AbstractCastorDescriptorService
Returns:

getCastorMapping

protected Mapping getCastorMapping()
                            throws java.io.IOException,
                                   MappingException
Read and Retrieve the Web Application's Castor Mapping resource.

Specified by:
getCastorMapping in class AbstractCastorDescriptorService
Returns:
Throws:
java.io.IOException
MappingException