|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.abstracthorizon.extend.server.deployment.service.AbstractServiceModuleLoader org.abstracthorizon.extend.support.spring.service.SpringAbstractServiceModuleLoader org.abstracthorizon.extend.support.spring.service.ServiceModuleLoader
public class ServiceModuleLoader
Service module loader. It loads "service.xml" file as spring's application context xml configuration file. TODO: explain donwloading and unpacking of archives
Field Summary | |
---|---|
protected int |
bufferSize
Buffer for downlaod size |
static int |
INITIAL_BUFFER_SIZE
Initial buffer size |
protected RedeployURLScanner |
redeployURLScanner
Redeployment URL scanner |
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 | |
---|---|
ServiceModuleLoader()
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. |
protected void |
copy(InputStream is,
OutputStream os)
|
protected AbstractApplicationContextModule |
createModule(URL url)
Creates new module that is extension of AbstractApplicationContextModule |
protected void |
downloadArchive(URL url,
File file)
Downloads the archive |
int |
getBufferSize()
Returns buffer size for downloading |
RedeployURLScanner |
getRedeployURLScanner()
Returns redeploy URL scanner |
Module |
load(URI uri)
Creates ServiceApplicationContextModule and initialises it. |
Module |
loadAs(URI uri,
ModuleId moduleId)
Creates ServiceApplicationContextModule and initialises it. |
protected void |
postDefinitionProcessing(AbstractApplicationContextModule service)
Called after module is defined |
protected void |
preDefinitionProcessing(AbstractApplicationContextModule service)
Called before module is pronounced defined |
void |
setBufferSize(int bufferSize)
Sets buffer size for downloading |
void |
setRedeployURLScanner(RedeployURLScanner redeployURLScanner)
Sets redeploy URL scanner |
ModuleId |
toModuleId(URI uri)
Translates URI to moduleId |
protected void |
unpackArchive(File from,
File to)
Unpacks the archive to run |
Methods inherited from class org.abstracthorizon.extend.support.spring.service.SpringAbstractServiceModuleLoader |
---|
canLoad, setApplicationContext, 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 |
Field Detail |
---|
public static final int INITIAL_BUFFER_SIZE
protected int bufferSize
protected RedeployURLScanner redeployURLScanner
Constructor Detail |
---|
public ServiceModuleLoader()
Method Detail |
---|
public ModuleId toModuleId(URI uri)
uri
- uri
null
public Module load(URI uri)
ServiceApplicationContextModule
and initialises it.
This implementation checks if file or directory is supplied as URI (directory has distinct "/" at the end of the file path). If it is directory then it has to be on filesystem - url with "file" protocol. If it is a file then it is assimed to be jar file. If file is remote file (url's protocol is not "file") then file is firstly downloaded.
uri
- url for module to be loaded from
ServiceApplicationContextModule
public Module loadAs(URI uri, ModuleId moduleId)
ServiceApplicationContextModule
and initialises it.
This implementation checks if file or directory is supplied as URI (directory has distinct "/" at the end of the file path). If it is directory then it has to be on filesystem - url with "file" protocol. If it is a file then it is assimed to be jar file. If file is remote file (url's protocol is not "file") then file is firstly downloaded.
uri
- url for module to be loaded frommoduleId
- module id
ServiceApplicationContextModule
protected AbstractApplicationContextModule createModule(URL url)
AbstractApplicationContextModule
url
- url for the module
protected void preDefinitionProcessing(AbstractApplicationContextModule service)
service
- serviceprotected void postDefinitionProcessing(AbstractApplicationContextModule service)
service
- serviceprotected void addFilesForScanning(AbstractApplicationContextModule module)
public RedeployURLScanner getRedeployURLScanner()
public void setRedeployURLScanner(RedeployURLScanner redeployURLScanner)
redeployURLScanner
- redeploy URL scannerprotected void downloadArchive(URL url, File file)
url
- url to download archive fromfile
- result fileprotected void unpackArchive(File from, File to)
from
- archive fileto
- result directorypublic int getBufferSize()
public void setBufferSize(int bufferSize)
bufferSize
- buffer size for downloadingprotected void copy(InputStream is, OutputStream os) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |