Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
titleDeploymentContext
linenumberstrue
public interface DeploymentContext {

  GatewayConfig getGatewayConfig();
...
  Topology getTopology();

@Deprecated
  WebArchivevoid getWebArchivecontributeFilter();

  WebAppDescriptor getWebAppDescriptor();

  GatewayDescriptor getGatewayDescriptor();

  void contributeChain( Service service,
      ServiceResourceDescriptor serviceresource,
      ResourceDescriptorString resourcerole,
      String chainNamename,
      List<ServiceParamDescriptor>List<FilterParamDescriptor> params );

  void addDescriptorcontributeChain( String name, Object descriptor );

  <T> T getDescriptor( String name );

      Service service,
      ResourceDescriptor resource,
      String chainName,
      List<ServiceParamDescriptor> params );
  ...
}
Code Block
java
java
titleServiceDeploymentContributor
linenumberstrue
public interface ServiceDeploymentContributor {

  // The role of this service deployment contributor.  e.g. WEBHDFS
  String getRole();

  // The name of this service deployment contributor.  Not used yet.
  String getName();

  // Called after provider initializeContribution methods and in arbitrary order relative to other service contributors.
  void initializeContribution( DeploymentContext context );

  // Called per service based on the service's role.
  // Returns a list of resources it added to the descriptor.
  void contributeService( DeploymentContext context, Service service ) throws Exception;

  // Called after all contributors and before provider finalizeContribution methods.
  void finalizeContribution( DeploymentContext context );

...
}
Code Block
java
java
titleProviderDeploymentContributor
linenumberstrue
public interface ProviderDeploymentContributor {

  // The role this provider supports (e.g. authentication)
  String getRole();

  // In the topology the provider will have an optional name element.  If it is present
  // then the framework will look for the the provider deployment contributor with the correct
  // role and name.
  String getName();

  // All provider initializeContribution methods are called first in arbitrary order.
  void initializeContribution( DeploymentContext context );

  // Called for each provider in the topology based on the role and optionally name.
  void contributeProvider( DeploymentContext context, Provider provider );

  // This will be called indirectly by a ServiceDeploymentContributor when it needs a filterasks
  // contributed for this providers role.  A ServiceDeploymentContributor may request a specific
chain to //be providercontributed by role and name otherwise the default provider for the role will be usedvia DeploymentContext.contributeChain.
  void contributeFilter(
      DeploymentContext context,
      Provider provider,
      Service service,
      ResourceDescriptor resource,
      List<FilterParamDescriptor> params );

  // All provider finalizeContribution methods are called last in arbitrary order.
  void finalizeContribution( DeploymentContext context );
PlantUML
title
  ...
Sample Sequences
PlantUML
@startuml
title Contribute Chain
hide footbox
autonumber

participant "Deployment\nFactory\n(df)" as df
participant "Deployment\nContext\n(dc)" as dc
participant "Service\nDeployment\nContributor\n(sdc)" as sdc
participant "Provider\nDeployment\nContributor\n(pdc)" as pdc

activate df
create dc
df -> dc: new
df -> sdc: contributeService(dc)
  activate sdc
  sdc -> dc: contributeChain()
    activate dc
    dc -> pdc: contributeFilter()
    deactivate dc
  sdc --> df
  deactivate sdc
deactivate df
@endup