de.fzj.unicore.wsrflite.utils.deployment
Class ServiceConfigReader
java.lang.Object
org.xml.sax.helpers.DefaultHandler
de.fzj.unicore.wsrflite.utils.deployment.ServiceConfigReader
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, ErrorHandler
- Direct Known Subclasses:
- ServiceConfigReader
public class ServiceConfigReader
- extends DefaultHandler
Very basic config utility
configures services based on a file having the following format:
<services>
<!-- you can add properties here -->
<property name="...." value="...."/>
...
<!-- you can add global handlers that will be put on all services -->
<globalHandler type="in|out" class="...."/>
...
<service name="..." wsrf="true|false" persistent="true|false" [wsdlLocation=" ... "]>
<interface class="" /> <!-- the interface defining your service -->
<implementation class=""/> <!-- the implementation of the service -->
<handler type="in|out" class="..."/> <!-- an in/out handler to add -->
<initTask class="..."/> <!-- a Java Runnable to run after deployment-->
<shutdownTask class="..."/> <!-- a Java Runnable to run before un-deployment -->
</service>
...
</services>
- Author:
- schuller
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
propertyName
protected String propertyName
propertyValue
protected String propertyValue
monitorName
protected String monitorName
jarFilePath
protected String jarFilePath
initTask
protected String initTask
shutdownTask
protected String shutdownTask
WATCH_CONFIG
public static final String WATCH_CONFIG
- See Also:
- Constant Field Values
WATCH_CONFIG_INTERVAL
public static final String WATCH_CONFIG_INTERVAL
- See Also:
- Constant Field Values
ServiceConfigReader
public ServiceConfigReader()
ServiceConfigReader
public ServiceConfigReader(File configFile,
long period)
throws FileNotFoundException
- Configure from the given file. This file will be watched for changes using
the given period (use -1 to disable the watch)
- Parameters:
configFile - - the config fileperiod - - the file checking period in milliseconds
- Throws:
FileNotFoundException
configureServices
public void configureServices()
throws Exception
- Throws:
Exception
configureServices
public void configureServices(InputStream is)
throws SAXException,
ParserConfigurationException,
IOException
- configure the services
- Throws:
SAXException - - on parsing / XML syntax errors
IOException - - if the config stream cannot be read
ParserConfigurationException - - if no SAX parser can be set up
discoverHostName
protected void discoverHostName()
setDefaultPort
protected void setDefaultPort()
validate
protected void validate()
- sanity check on properties
makeBaseUrl
protected String makeBaseUrl()
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
- Specified by:
startElement in interface ContentHandler- Overrides:
startElement in class DefaultHandler
- Throws:
SAXException
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException,
ServiceDeploymentException
- Specified by:
endElement in interface ContentHandler- Overrides:
endElement in class DefaultHandler
- Throws:
SAXException
ServiceDeploymentException
reInit
protected void reInit()
deployService
protected org.codehaus.xfire.service.Service deployService()
throws Exception
- Throws:
Exception
addInHandlers
protected void addInHandlers(org.codehaus.xfire.service.Service s,
List<String> handlers)
addOutHandlers
protected void addOutHandlers(org.codehaus.xfire.service.Service s,
List<String> handlers)
getInitTasks
public List<Runnable> getInitTasks()
- return the list of
Runnable that were defined in the configuration as service init tasks
Copyright © 2010. All Rights Reserved.