public class EmbdServContHTTPService extends AbstractAuthenticatedService implements HTTPService
ServletService (an embedded servlet
container). This delegates to the AristaFlowHTTPService-servlet
implementingdoGet and doPost-methods.| Modifier and Type | Field and Description |
|---|---|
protected AristaFlowHTTPService |
httpService
The HTTP service (servlet) handling the requests.
|
protected static java.lang.String |
WEB_APP_CONTEXT
The hierarchical context of the servlet.
|
protected static java.lang.String |
WEB_APP_NAME
The name used for the publishing the servlet, that is as servlet name.
|
| Constructor and Description |
|---|
EmbdServContHTTPService(Configuration configuration,
Registry registry)
Registers the HTTP-service-servlet at an embedded servlet container.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deregisterReplyHandler(SessionToken session,
java.lang.String sessionID)
Deregisters a reply handler for the activity with the designated
sessionID. |
boolean |
isActive()
Allows waiting reply handlers to retrieve the state of the HTTP-service.
|
void |
registerReplyHandler(SessionToken session,
java.lang.String sessionID,
HTTPReplyHandler replayHandler)
Registers a reply handler for the activity with the designated
sessionID. |
void |
shutdown(boolean emergency)
Removes the HTTP-service-servlet from the
ServletService. |
void |
start()
Adds the HTTP-service-servlet to the
ServletService. |
protected static final java.lang.String WEB_APP_NAME
protected static final java.lang.String WEB_APP_CONTEXT
protected final AristaFlowHTTPService httpService
public EmbdServContHTTPService(Configuration configuration,
Registry registry)
throws ConfigurationException
configuration - The configuration providing the user credentials for
this service.registry - The registry for accessing the servlet services.ConfigurationException - If there are problems parsing the user
credentials from the configuration, a
ConfigurationException will be thrown.public void registerReplyHandler(SessionToken session,
java.lang.String sessionID,
HTTPReplyHandler replayHandler)
throws java.net.MalformedURLException
HTTPServicesessionID. This creates an own URL for the reply handler.
It will be called as soon as a HTTP-request (the reply for the activity) is
received by this HTTP-service.registerReplyHandler in interface HTTPServicesession - The session which is used to check for access rights on this
method.sessionID - The session ID for the executed activity. It is used to
create an appropriate URL.replayHandler - The handler for the HTTP-replies sent to this service.java.net.MalformedURLException - If the designated sessionID does not allow to
create a valid URL, a MalformedURLException will
be thrown.public void deregisterReplyHandler(SessionToken session,
java.lang.String sessionID)
HTTPServicesessionID. A reply handler may be deregistered any time. In
case a reply handling is currently running, it will be allowed to finish.deregisterReplyHandler in interface HTTPServicesession - The session which is used to check for access rights on this
method.sessionID - The session ID identifying the executed activity and
therefore also the handler for the reply sent via HTTP.public void start()
throws AbortServiceException
ServletService.AbortServiceException - If the base URL (servlet URL having the
URL-pattern appended) cannot be created, an
AbortServiceException will be thrown.ServiceNotKnownException - If the servlet container cannot be
retrieved from the registry, a
ServiceNotKnownException will be thrown.public void shutdown(boolean emergency)
ServletService.public boolean isActive()