|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.espertech.esperio.http.config.ConfigurationHTTPAdapter
public class ConfigurationHTTPAdapter
Constructor Summary | |
---|---|
ConfigurationHTTPAdapter()
|
Method Summary | |
---|---|
ConfigurationHTTPAdapter |
configure()
Use the configuration specified in an application resource named esper.cfg.xml. |
ConfigurationHTTPAdapter |
configure(java.io.File configFile)
Use the ConfigurationHTTPAdapter specified in the given application file. |
ConfigurationHTTPAdapter |
configure(java.lang.String resource)
Use the ConfigurationHTTPAdapter specified in the given application resource. |
ConfigurationHTTPAdapter |
configure(java.net.URL url)
Use the ConfigurationHTTPAdapter specified by the given URL. |
ConfigurationHTTPAdapter |
configureFromString(java.lang.String xml)
Use the ConfigurationHTTPAdapter specified by the given XML String. |
protected static java.io.InputStream |
getConfigurationInputStream(java.lang.String resource)
Get the ConfigurationHTTPAdapter file as an InputStream. |
java.util.List<GetHandler> |
getGetHandlers()
|
java.util.List<Request> |
getRequests()
|
protected static java.io.InputStream |
getResourceAsStream(java.lang.String resource)
Returns an input stream from an application resource in the classpath. |
java.util.Map<java.lang.String,Service> |
getServices()
|
void |
setGetHandlers(java.util.List<GetHandler> getHandlers)
|
void |
setRequests(java.util.List<Request> requests)
|
void |
setServices(java.util.Map<java.lang.String,Service> services)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfigurationHTTPAdapter()
Method Detail |
---|
public java.util.Map<java.lang.String,Service> getServices()
public void setServices(java.util.Map<java.lang.String,Service> services)
public java.util.List<GetHandler> getGetHandlers()
public void setGetHandlers(java.util.List<GetHandler> getHandlers)
public java.util.List<Request> getRequests()
public void setRequests(java.util.List<Request> requests)
public ConfigurationHTTPAdapter configure() throws java.lang.RuntimeException
java.lang.RuntimeException
- thrown to indicate error reading configurationpublic ConfigurationHTTPAdapter configure(java.lang.String resource) throws java.lang.RuntimeException
resource
- if the file name of the resource
java.lang.RuntimeException
- thrown to indicate error reading configurationprotected static java.io.InputStream getConfigurationInputStream(java.lang.String resource) throws java.lang.RuntimeException
See getResourceAsStream for information on how the resource name is resolved.
resource
- is the resource name
java.lang.RuntimeException
- thrown to indicate error reading configurationpublic ConfigurationHTTPAdapter configureFromString(java.lang.String xml) throws java.lang.RuntimeException
xml
- XML string
java.lang.RuntimeException
- is thrown when the URL could not be accesspublic ConfigurationHTTPAdapter configure(java.net.URL url) throws java.lang.RuntimeException
url
- URL from which you wish to load the configuration
java.lang.RuntimeException
- is thrown when the URL could not be accessprotected static java.io.InputStream getResourceAsStream(java.lang.String resource)
The method first removes the '/' character from the resource name if the first character is '/'.
The lookup order is as follows:
If a thread context class loader exists, use Thread.currentThread().getResourceAsStream to obtain an InputStream.
If no input stream was returned, use the Configuration.class.getResourceAsStream. to obtain an InputStream.
If no input stream was returned, use the Configuration.class.getClassLoader().getResourceAsStream. to obtain an InputStream.
If no input stream was returned, throw an Exception.
resource
- to get input stream for
public ConfigurationHTTPAdapter configure(java.io.File configFile) throws java.lang.RuntimeException
configFile
- File from which you wish to load the configuration
java.lang.RuntimeException
- when the file could not be found
|
© 2006-2016 EsperTech Inc. All rights reserved. Visit us at espertech.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |