Package jadex.extension.rs.publish
Class GrizzlyRestPublishService
- java.lang.Object
-
- jadex.extension.rs.publish.AbstractRestPublishService
-
- jadex.extension.rs.publish.GrizzlyRestPublishService
-
- All Implemented Interfaces:
IPublishService
,IWebPublishService
public class GrizzlyRestPublishService extends AbstractRestPublishService
Publish service without Jersey directly using Grizly container.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jadex.extension.rs.publish.AbstractRestPublishService
AbstractRestPublishService.MappingInfo, AbstractRestPublishService.RequestInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Integer,org.glassfish.grizzly.http.server.HttpServer>
portservers
The servers per port.protected java.util.Map<IServiceIdentifier,org.glassfish.grizzly.http.server.HttpServer>
sidservers
The servers per service id.-
Fields inherited from class jadex.extension.rs.publish.AbstractRestPublishService
ASYNC_CONTEXT_INFO, component, converters, FINISHED, HEADER_JADEX_CALLFINISHED, HEADER_JADEX_CALLID, HEADER_JADEX_CLIENTTIMEOUT, HEADER_JADEX_TERMINATE, PARAMETER_MEDIATYPES, requestinfos, requestspercall
-
Fields inherited from interface jadex.bridge.service.types.publish.IPublishService
DEFAULT_RSPUBLISH_COMPONENTS, PUBLISH_RS, PUBLISH_WS
-
-
Constructor Summary
Constructors Constructor Description GrizzlyRestPublishService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getHttpServer(java.net.URI uri, PublishInfo info)
Get or start an api to the http server.IFuture<java.lang.Boolean>
isSupported(java.lang.String publishtype)
Test if publishing a specific type is supported (e.g.IFuture<java.lang.Void>
mirrorHttpServer(java.net.URI sourceserveruri, java.net.URI targetserveruri, PublishInfo info)
IFuture<java.lang.Void>
publishExternal(java.net.URI uri, java.lang.String rootpath)
Publish file resources from the file system.IFuture<java.lang.Void>
publishHMTLPage(java.lang.String uri, java.lang.String vhost, java.lang.String html)
Publish a static page (without ressources).IFuture<java.lang.Void>
publishRedirect(java.net.URI uri, java.lang.String html)
IFuture<java.lang.Void>
publishResources(java.lang.String uri, java.lang.String rootpath)
Publish file resources from the classpath.IFuture<java.lang.Void>
publishService(IServiceIdentifier serviceid, PublishInfo info)
Publish a service.IFuture<java.lang.Void>
shutdownHttpServer(java.net.URI uri)
IFuture<java.lang.Void>
unpublish(java.lang.String vhost, java.net.URI uri)
IFuture<java.lang.Void>
unpublishService(IServiceIdentifier sid)
Unpublish a service.-
Methods inherited from class jadex.extension.rs.publish.AbstractRestPublishService
addConverter, addEntry, complete, convertJsonValue, convertParameter, convertParameter, evaluateMapping, extractCallerValues, getAsyncContext, getCleanPublishId, getParameterInfos, getRequestTimeout, getServiceInfo, getServletHost, getServletUrl, guessRestType, handleRequest, hasStringConvertableParameters, init, isComplete, loadFunctionJS, loadStyleCSS, main, mapParameters, mapResult, parseMimetypes, removeConverter, saveRequestContext, splitQueryString, writeResponse, writeResponse, writeResponseContent, writeResponseHeader
-
-
-
-
Field Detail
-
sidservers
protected java.util.Map<IServiceIdentifier,org.glassfish.grizzly.http.server.HttpServer> sidservers
The servers per service id.
-
portservers
protected java.util.Map<java.lang.Integer,org.glassfish.grizzly.http.server.HttpServer> portservers
The servers per port.
-
-
Method Detail
-
isSupported
public IFuture<java.lang.Boolean> isSupported(java.lang.String publishtype)
Test if publishing a specific type is supported (e.g. web service).- Specified by:
isSupported
in interfaceIPublishService
- Overrides:
isSupported
in classAbstractRestPublishService
- Parameters:
publishtype
- The type to test.- Returns:
- True, if can be published.
-
publishService
public IFuture<java.lang.Void> publishService(IServiceIdentifier serviceid, PublishInfo info)
Publish a service.- Specified by:
publishService
in interfaceIPublishService
- Specified by:
publishService
in classAbstractRestPublishService
- Parameters:
cl
- The classloader.service
- The original service.pid
- The publish id (e.g. url or name).
-
getHttpServer
public java.lang.Object getHttpServer(java.net.URI uri, PublishInfo info)
Get or start an api to the http server.- Specified by:
getHttpServer
in classAbstractRestPublishService
-
unpublishService
public IFuture<java.lang.Void> unpublishService(IServiceIdentifier sid)
Unpublish a service.- Parameters:
sid
- The service identifier.
-
publishHMTLPage
public IFuture<java.lang.Void> publishHMTLPage(java.lang.String uri, java.lang.String vhost, java.lang.String html)
Publish a static page (without ressources).
-
publishResources
public IFuture<java.lang.Void> publishResources(java.lang.String uri, java.lang.String rootpath)
Publish file resources from the classpath.
-
publishExternal
public IFuture<java.lang.Void> publishExternal(java.net.URI uri, java.lang.String rootpath)
Publish file resources from the file system.
-
publishRedirect
public IFuture<java.lang.Void> publishRedirect(java.net.URI uri, java.lang.String html)
-
unpublish
public IFuture<java.lang.Void> unpublish(java.lang.String vhost, java.net.URI uri)
-
mirrorHttpServer
public IFuture<java.lang.Void> mirrorHttpServer(java.net.URI sourceserveruri, java.net.URI targetserveruri, PublishInfo info)
-
shutdownHttpServer
public IFuture<java.lang.Void> shutdownHttpServer(java.net.URI uri)
-
-