Interface DeploymentPhaseContext

  • All Superinterfaces:
    Attachable

    public interface DeploymentPhaseContext
    extends Attachable
    The deployment unit processor context. Maintains state pertaining to the current cycle of deployment/undeployment. This context object will be discarded when processing is complete; data which must persist for the life of the deployment should be attached to the DeploymentUnit.
    Author:
    David M. Lloyd, Richard Opalka
    • Method Detail

      • getPhaseServiceName

        org.jboss.msc.service.ServiceName getPhaseServiceName()
        Get the service name of the current deployment phase.
        Returns:
        the deployment phase service name
      • getServiceTarget

        @Deprecated(forRemoval=true)
        default org.jboss.msc.service.ServiceTarget getServiceTarget()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Get the service target into which this phase should install services. Please note that services added via this context do not have any implicit dependencies by default; any root-level deployment services that you add should depend on the service name of the current phase, acquired via the getPhaseServiceName() method.
        Returns:
        the service target
      • getRequirementServiceTarget

        RequirementServiceTarget getRequirementServiceTarget()
        Returns the target into which this phase should install services. Please note that services added via this context do not have any implicit dependencies by default; any root-level deployment services that you add should depend on the service name of the current phase, acquired via the getPhaseServiceName() method.
        Returns:
        the service target
      • getServiceRegistry

        org.jboss.msc.service.ServiceRegistry getServiceRegistry()
        Get the service registry for the container, which may be used to look up services.
        Returns:
        the service registry
      • getDeploymentUnit

        DeploymentUnit getDeploymentUnit()
        Get the persistent deployment unit context for this deployment unit.
        Returns:
        the deployment unit context
      • getPhase

        Phase getPhase()
        Get the phase that this processor applies to.
        Returns:
        the phase
      • addDependency

        <T> void addDependency​(org.jboss.msc.service.ServiceName serviceName,
                               AttachmentKey<T> attachmentKey)
        Adds a dependency on the service to the next phase service. The service value will be make available as an attachment under the DeploymentPhaseContext for the phase.

        If the attachment represents an AttachmentList type then the value is added to the attachment list.

        Type Parameters:
        T - the type of the injected value
        Parameters:
        serviceName - The service name to add to Attachments.NEXT_PHASE_DEPS
        attachmentKey - The AttachmentKey to attach the service result under.
        Throws:
        IllegalStateException - If this is the last phase
      • requires

        <T> void requires​(org.jboss.msc.service.ServiceName serviceName,
                          DelegatingSupplier<T> supplier)
        Adds a dependency on the service to the next phase service.
        Type Parameters:
        T - the type of the injected value
        Parameters:
        serviceName - the service name to add to Attachments.NEXT_PHASE_DEPS
        supplier - the supplier into which the dependency value is injected
        Throws:
        IllegalStateException - If this is the last phase
      • addDeploymentDependency

        <T> void addDeploymentDependency​(org.jboss.msc.service.ServiceName serviceName,
                                         AttachmentKey<T> attachmentKey)
        Adds a dependency on the service to the next phase service. The service value will be make available as an attachment to the DeploymentUnit. This attachment will be removed when the phase service for the next phase stops.

        If the attachment represents an AttachmentList type then the value is added to the attachment list.

        Type Parameters:
        T - The type of the injected value
        Parameters:
        serviceName - The service name to add to Attachments.NEXT_PHASE_DEPS
        attachmentKey - The AttachmentKey to attach the service result under.
        Throws:
        IllegalStateException - If this is the last phase