public class AppService extends java.lang.Object implements ApplicationService
TopologyProvider
.
registered
can be submitted through the control ApplicationServiceMXBean
registered with the ControlService
for the topology provider.
ALIAS, SYSTEM_APP_PREFIX
Constructor and Description |
---|
AppService(TopologyProvider provider,
DirectSubmitter<Topology,Job> submitter,
java.lang.String alias)
Create an
ApplicationService instance. |
Modifier and Type | Method and Description |
---|---|
static ApplicationService |
createAndRegister(TopologyProvider provider,
DirectSubmitter<Topology,Job> submitter)
Create an register an application service using the default alias
ApplicationService.ALIAS . |
java.util.Set<java.lang.String> |
getApplicationNames()
Returns the names of applications registered with this service.
|
void |
registerJar(java.lang.String jarURL,
java.lang.String jsonConfig)
Create a new class loader for the jar and register any
topology application that is registered as a service provider.
|
void |
registerTopology(java.lang.String applicationName,
BiConsumer<Topology,com.google.gson.JsonObject> builder)
Add a topology that can be started though a control mbean.
|
public AppService(TopologyProvider provider, DirectSubmitter<Topology,Job> submitter, java.lang.String alias)
ApplicationService
instance.provider
- Provider to create topology instances for registered applications.submitter
- Submitter for registered applications.alias
- Alias used to register the control MBean.public static ApplicationService createAndRegister(TopologyProvider provider, DirectSubmitter<Topology,Job> submitter)
ApplicationService.ALIAS
.provider
- Provider to create topology instances for registered applications.submitter
- Submitter for registered applications.public void registerTopology(java.lang.String applicationName, BiConsumer<Topology,com.google.gson.JsonObject> builder)
ApplicationService
submit
is invoked builder.accept(topology, config)
is called passing:
topology
- An empty topology with the name applicationName
.
config
- JSON submission configuration from
submit
.
builder.accept(topology, config)
returns it is submitted
to the Submitter
associated with the implementation of this service.
Application names starting with edgent
are reserved
for system applications.
registerTopology
in interface ApplicationService
applicationName
- Application name to register.builder
- How to build the topology for this application.ApplicationServiceMXBean
public void registerJar(java.lang.String jarURL, java.lang.String jsonConfig) throws java.lang.Exception
registerJar
in interface ApplicationService
jarURL
- URL of Jar containing new applications.jsonConfig
- Configuration information, currently unused.java.lang.Exception
- if failurepublic java.util.Set<java.lang.String> getApplicationNames()
ApplicationService
getApplicationNames
in interface ApplicationService
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641