net.sf.appinfo.reader
Class ServletContextManifestReader

java.lang.Object
  extended by net.sf.appinfo.reader.AbstractManifestReader
      extended by net.sf.appinfo.reader.ServletContextManifestReader
All Implemented Interfaces:
ManifestReader

public class ServletContextManifestReader
extends AbstractManifestReader

ManifestReader implementation using ServletContext. To be used in web applications. TODO: MZA: Write some integration tests (with Arquillian?)

Author:
Marcin ZajÄ…czkowski, 2010-11-03

Constructor Summary
ServletContextManifestReader(javax.servlet.ServletContext servletContext)
           
 
Method Summary
protected  Manifest initializeAndReturnManifest()
          Delegated initialization (and return of) Manifest object.
 
Methods inherited from class net.sf.appinfo.reader.AbstractManifestReader
getManifest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletContextManifestReader

public ServletContextManifestReader(javax.servlet.ServletContext servletContext)
Method Detail

initializeAndReturnManifest

protected Manifest initializeAndReturnManifest()
                                        throws ReaderInitializationException,
                                               IOException
Description copied from class: AbstractManifestReader
Delegated initialization (and return of) Manifest object. Should be implemented in concreate classes which create Manifest from data in file, JAR, etc. Throwing IOException isn't very pretty, but it allows to remove duplication and move conversion IOException to ReaderInitializationException to a superclass. It's only internal method in ManifestReader hierarchy and doesn't complicate cooperation with other classes.

Specified by:
initializeAndReturnManifest in class AbstractManifestReader
Returns:
initialized Manifest object
Throws:
ReaderInitializationException - other (no IO) error during Manifest initialization
IOException - error during Manifest initialization


Copyright © 2010-2011. All Rights Reserved.