|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.systinet.wasp.Wasp
This static class allows you to initialize Wasp with custom settings
(see init(Map)
and init(String)
) as well as destroy the
server (see destroy()
), start transport servers of your choice
(see startServer(String)
) and translate between relative and
absolute paths of services (see getLocalPath(String)
,
getAbsolutePath(String)
).
// init is optional (we can set 'wasp.location' property when Java is started) Wasp.init("/home/googoo/wasp45"); Wasp.startServer("http"); ... Wasp.destroy();
Method Summary | |
static void |
destroy()
Stops all transport servers and destroys WSO2 SOA Enablement Server. |
static java.lang.String[] |
getAbsolutePath(java.lang.String path)
Returns all possible endpoints for local path of current started transports or null if no server transport is available. |
static java.lang.String |
getAbsolutePath(java.lang.String scheme,
java.lang.String path)
Returns the first endpoint for local path of current started transports registered for given scheme or null if no such server transport
is available. |
static java.util.Map |
getInitialArguments()
Returns the initial arguments when WSO2 SOA Enablement Server was initialized. |
static java.lang.String |
getLocalPath(java.lang.String endpoint)
Returns null if the endpoint does not point to any
local server accepting incoming messages or the local
path (without the WSO2 SOA Enablement Server context) of the endpoint. |
static java.lang.String |
getWaspLocation()
Returns the URL of the system WSO2 SOA Enablement Server directory. |
static void |
init()
Initializes WSO2 SOA Enablement Server with default settings. |
static void |
init(java.util.Map arguments)
Initializes WSO2 SOA Enablement Server with given arguments. |
static void |
init(java.lang.String waspLocation)
Initializes WSO2 SOA Enablement Server with specified wasp.location property. |
static Transport |
startServer(java.lang.String endpoint)
Starts a new server on given endpoint or gets the server if it's already started. |
static Transport |
startServer(java.lang.String scheme,
Configurable configuration)
Starts a new server with given configuration: |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static final void init() throws WaspInternalException
WaspInternalException
- when some internal error occursinit(Map)
public static final void init(java.lang.String waspLocation) throws WaspInternalException
wasp.location
property.
waspLocation
- directory where WSO2 SOA Enablement Server was installed to
(path on local filesystem i.e. c:\wasp
)
WaspInternalException
- when some internal error occursinit(Map)
public static final void init(java.util.Map arguments) throws WaspInternalException
META-INF/wasp.properties
property file which is
loaded as resource from class loader. If the argument isn't in
this file, the default value is taken - parameter in brackets.
Possible arguments:wasp.location
- installed locationwasp.config.location
- relative (to wasp.location) path of
configuration file (conf/clientconf.xml)wasp.config.include
- list of additional configs to
include, delimited by commaswasp.configurator.class
- which org.idoox.config.Configurator
implementation is used (com.idoox.config.xml.XMLConfigurator
)idoox.debug.level
- determines the number of logging messages
(2 - errors, warnings)idoox.debug.logger
- specifies logging system, e.g. log4j,
if you do not want to use log4j set this property to waspLogger (waspLogger)
log4j.configuration
- specifies path to the property
configuration file for lo4j
. If it contains relarive path then
it will be evaluated relatively to wasp.location
wasp.impl.classpath
- classpath of WSO2 SOA Enablement Server implementationwasp.shutdownhook
- if true WSO2 SOA Enablement Server should be automatically destroyed
just before JVM is destroyed, false - if client wants to manage shutdown process (true)
arguments
- map of initial arguments
WaspInternalException
- when some internal error occurspublic static final void destroy()
public static final Transport startServer(java.lang.String endpoint) throws TransportStartException, java.net.MalformedURLException, WaspInternalException
https
- starts HTTPS server on port from configuration or it is a string like
http://googoo:8080/wasp
which means that HTTP server should
be started on port 8080
with context /wasp
.
The endpoint string is passed to Transport.start(URI)
method.
Transport.stop()
method on particular transport.
endpoint
- address where to start server
TransportStartException
- when some error occurs during transport
starting
WaspInternalException
- when some error occurs during WSO2 SOA Enablement Server
initialization
java.net.MalformedURLException
- when the endpoint is not valid URLTransport.start(org.idoox.transport.URI)
public static final Transport startServer(java.lang.String scheme, Configurable configuration) throws TransportStartException, WaspInternalException
Configurable config = Configurator.newRuntimeConfigurable(); HttpServerConfig httpConfig = (HttpServerConfig)config.narrow(HttpServerConfig.class); httpConfig.setPort(4040); httpConfig.setMaxThreads(50); httpConfig.setMaxReadTime(10000); Wasp.startServer("http", config);Passed configuration takes default values from a server transport which is registered as default server transport for given scheme. It can not be reused for another server configuration because the started server has registered listener (
Configurable.addVetoableChangeListener(java.beans.VetoableChangeListener)
) on
the configurable and it acts accordingly on given change. If the WSO2 SOA Enablement Server
was not initialized it is automatically initialized.
scheme
- the transport schemeconfiguration
- additional onfiguration for started transport
TransportStartException
- when some error occurs during transport
starting
WaspInternalException
- when some error occurs during WSO2 SOA Enablement Server
initializationstartServer(String)
,
Transport.start(org.idoox.transport.URI)
public static final java.lang.String getLocalPath(java.lang.String endpoint) throws java.net.MalformedURLException
null
if the endpoint does not point to any
local server accepting incoming messages or the local
path (without the WSO2 SOA Enablement Server context) of the endpoint. For
example, if WSO2 SOA Enablement Server is deployed to
http://localhost:6060/wasp
, then call with the
endpoint http://localhost:6060/wasp/a/
returns
/a/
path, while
http://localhost:6060/wasp1/a/
or
http://localhost/wasp/a/
(default port for HTTP is
80) returns null
.
endpoint
- the endpoint being tested
null
java.net.MalformedURLException
- when the endpoint is not valid URLpublic static final java.lang.String getAbsolutePath(java.lang.String scheme, java.lang.String path) throws java.net.MalformedURLException
null
if no such server transport
is available.
For example, for http
scheme and /Hello
path it returns http://localhost:6060/Hello
.
scheme
- scheme of the transportpath
- the local path of the endpoint
null
java.net.MalformedURLException
- when server endpoint is not valid URLpublic static final java.lang.String[] getAbsolutePath(java.lang.String path) throws java.net.MalformedURLException
null
if no server transport is available.
For example, for /Hello
path it returns
http://localhost:6060/Hello
and
https://localhost:6062/Hello
endpoints.
path
- the local path of the endpoint
null
java.net.MalformedURLException
- when some server endpoint is not valid URLpublic static final java.lang.String getWaspLocation()
null
if the WSO2 SOA Enablement Server isn't
initializedpublic static final java.util.Map getInitialArguments()
init(java.util.Map)
for list of these arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |