Package jadex.publishservicejetty.impl
Class ServerManager
java.lang.Object
jadex.publishservicejetty.impl.ServerManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static ServerManager
The servers per port.protected Map
<jadex.providedservice.IServiceIdentifier, org.eclipse.jetty.server.Server> The servers per service id.protected Map
<jadex.providedservice.IServiceIdentifier, jadex.common.Tuple2<org.eclipse.jetty.server.Server, org.eclipse.jetty.server.handler.ContextHandler>> Infos for unpublishing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPortServer
(int port, org.eclipse.jetty.server.Server server) void
addSidServer
(jadex.providedservice.IServiceIdentifier sid, org.eclipse.jetty.server.Server server) void
addUnpublishInfo
(jadex.providedservice.IServiceIdentifier serviceid, org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.handler.ContextHandler ch) static String[]
findVariables
(String str) getCleanPublishId
(String id, jadex.core.IComponent component) Get the cleaned publish id.jadex.future.IFuture
<Object> getHttpServer
(URI uri, jadex.publishservice.impl.PublishInfo info) Get or start an api to the http server.static ServerManager
org.eclipse.jetty.server.Server
getServer
(int port) void
publishHMTLPage
(String pid, String vhost, String html, jadex.core.IComponent component) Publish a static page (without ressources).jadex.future.IFuture
<Void> publishResources
(String pid, String rootpath, jadex.core.IComponent component) Publish file resources from the classpath.jadex.future.IFuture
<Void> publishService
(jadex.providedservice.IServiceIdentifier serviceid, jadex.publishservice.impl.PublishInfo info, jadex.core.IComponent component) Publish a service.jadex.common.Tuple2
<org.eclipse.jetty.server.Server, org.eclipse.jetty.server.handler.ContextHandler> removeUnpublishInfo
(jadex.providedservice.IServiceIdentifier serviceid) void
terminateServers
(Set<Integer> ports) void
unpublishService
(jadex.providedservice.IServiceIdentifier sid) Unpublish a service.
-
Field Details
-
sidservers
The servers per service id. -
portservers
The servers per port. -
unpublishinfos
protected Map<jadex.providedservice.IServiceIdentifier,jadex.common.Tuple2<org.eclipse.jetty.server.Server, unpublishinfosorg.eclipse.jetty.server.handler.ContextHandler>> Infos for unpublishing. -
instance
-
-
Constructor Details
-
ServerManager
public ServerManager()
-
-
Method Details
-
getInstance
-
publishService
public jadex.future.IFuture<Void> publishService(jadex.providedservice.IServiceIdentifier serviceid, jadex.publishservice.impl.PublishInfo info, jadex.core.IComponent component) Publish a service.- Parameters:
cl
- The classloader.service
- The original service.pid
- The publish id (e.g. url or name).
-
getHttpServer
public jadex.future.IFuture<Object> getHttpServer(URI uri, jadex.publishservice.impl.PublishInfo info) Get or start an api to the http server. -
unpublishService
public void unpublishService(jadex.providedservice.IServiceIdentifier sid) Unpublish a service.- Parameters:
sid
- The service identifier.
-
publishHMTLPage
Publish a static page (without ressources). -
publishResources
public jadex.future.IFuture<Void> publishResources(String pid, String rootpath, jadex.core.IComponent component) Publish file resources from the classpath. -
terminateServers
-
getCleanPublishId
Get the cleaned publish id. Square brackets for the optional host and context part are removed. -
findVariables
-
getServer
public org.eclipse.jetty.server.Server getServer(int port) -
addPortServer
public void addPortServer(int port, org.eclipse.jetty.server.Server server) -
addSidServer
public void addSidServer(jadex.providedservice.IServiceIdentifier sid, org.eclipse.jetty.server.Server server) -
addUnpublishInfo
public void addUnpublishInfo(jadex.providedservice.IServiceIdentifier serviceid, org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.handler.ContextHandler ch) -
removeUnpublishInfo
public jadex.common.Tuple2<org.eclipse.jetty.server.Server,org.eclipse.jetty.server.handler.ContextHandler> removeUnpublishInfo(jadex.providedservice.IServiceIdentifier serviceid)
-