org.abstracthorizon.extend.server.deployment.tomcat
Class TomcatWarModuleLoader

java.lang.Object
  extended by org.abstracthorizon.extend.server.deployment.service.AbstractServiceModuleLoader
      extended by org.abstracthorizon.extend.support.spring.service.SpringAbstractServiceModuleLoader
          extended by org.abstracthorizon.extend.support.spring.service.ServiceModuleLoader
              extended by org.abstracthorizon.extend.server.deployment.tomcat.TomcatWarModuleLoader
All Implemented Interfaces:
ModuleLoader, ApplicationContextAware

public class TomcatWarModuleLoader
extends ServiceModuleLoader

Tomcat war archive (or directory) module loader (deployer). It checks if "WEB-INF" directory is present and if so deploys archive with (embedded) Tomcat.

Current implementation creates context and deploys it with current host (defined under "tomcat.host" name in tomcat service archive).

Author:
Daniel Sendula

Field Summary
 
Fields inherited from class org.abstracthorizon.extend.support.spring.service.ServiceModuleLoader
bufferSize, INITIAL_BUFFER_SIZE, redeployURLScanner
 
Fields inherited from class org.abstracthorizon.extend.support.spring.service.SpringAbstractServiceModuleLoader
root
 
Fields inherited from class org.abstracthorizon.extend.server.deployment.service.AbstractServiceModuleLoader
deploymentManager, extensions
 
Constructor Summary
TomcatWarModuleLoader()
          Empty constructor.
 
Method Summary
protected  void addFilesForScanning(AbstractApplicationContextModule module)
          Hook method that collects all important files from newly created module and adds then to the URL redeployment scanner.
 boolean canLoad(URI uri)
          Returns true if "WEB-INF" exists in specified directory.
protected  AbstractApplicationContextModule createModule(URL url)
          Creates new module TomcatWebApplicationContext module
protected  void preDefinitionProcessing(AbstractApplicationContextModule service)
          Called before module is pronounced defined
 void setApplicationContext(ApplicationContext applicationContext)
          Sets application context
 
Methods inherited from class org.abstracthorizon.extend.support.spring.service.ServiceModuleLoader
copy, downloadArchive, getBufferSize, getRedeployURLScanner, load, loadAs, postDefinitionProcessing, setBufferSize, setRedeployURLScanner, toModuleId, unpackArchive
 
Methods inherited from class org.abstracthorizon.extend.support.spring.service.SpringAbstractServiceModuleLoader
start
 
Methods inherited from class org.abstracthorizon.extend.server.deployment.service.AbstractServiceModuleLoader
getDeploymentManager, getExtensions, setDeploymentManager, setExtensions, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TomcatWarModuleLoader

public TomcatWarModuleLoader()
Empty constructor.

Method Detail

canLoad

public boolean canLoad(URI uri)
Returns true if "WEB-INF" exists in specified directory.

Specified by:
canLoad in interface ModuleLoader
Overrides:
canLoad in class SpringAbstractServiceModuleLoader
Parameters:
uri - URI
Returns:
true if "WEB-INF" exists in specified directory.

createModule

protected AbstractApplicationContextModule createModule(URL url)
Creates new module TomcatWebApplicationContext module

Overrides:
createModule in class ServiceModuleLoader
Parameters:
url - url for the module
Returns:
newly created module

preDefinitionProcessing

protected void preDefinitionProcessing(AbstractApplicationContextModule service)
Called before module is pronounced defined

Overrides:
preDefinitionProcessing in class ServiceModuleLoader
Parameters:
service - service

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException
Sets application context

Specified by:
setApplicationContext in interface ApplicationContextAware
Overrides:
setApplicationContext in class SpringAbstractServiceModuleLoader
Parameters:
applicationContext - application context this bean is created under
Throws:
BeansException

addFilesForScanning

protected void addFilesForScanning(AbstractApplicationContextModule module)
Hook method that collects all important files from newly created module and adds then to the URL redeployment scanner.

Overrides:
addFilesForScanning in class ServiceModuleLoader
Parameters:
module - module


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.