Class DefaultDeployableFactory

  • All Implemented Interfaces:
    DeployableFactory, Loggable

    public class DefaultDeployableFactory
    extends AbstractIntrospectionGenericHintFactory<Deployable>
    implements DeployableFactory
    Default deployable factory that returns deployables for a given container. The reason deployable can be different for different containers is because for some container Cargo understand container-specific files. For example for Tomcat Cargo understand the context.xml file.
    • Constructor Detail

      • DefaultDeployableFactory

        public DefaultDeployableFactory()
        Register deployable classes mappings.
    • Method Detail

      • registerDeployable

        public void registerDeployable​(String containerId,
                                       DeployableType deployableType,
                                       Class<? extends Deployable> deployableClass)
        Registers a deployable implementation against a container.
        Specified by:
        registerDeployable in interface DeployableFactory
        Parameters:
        containerId - the container id attached to this deployable class
        deployableType - the type to differentiate this deployable from others for the specified container
        deployableClass - the deployable implementation class to register
      • registerDeployable

        public void registerDeployable​(String containerId,
                                       DeployableType deployableType,
                                       String deployableClassName)
        Registers a deployable using a class specified as a String.
        Parameters:
        containerId - Container id.
        deployableType - Deployable type.
        deployableClassName - Deployable implementation class to register as a String
        See Also:
        registerDeployable(String, DeployableType, Class)
      • isDeployableRegistered

        public boolean isDeployableRegistered​(String containerId,
                                              DeployableType deployableType)
        Checks if the deployable specified by the deployable type is registered for a specific container.
        Specified by:
        isDeployableRegistered in interface DeployableFactory
        Parameters:
        containerId - the container id attached to the deployable type class
        deployableType - the type to differentiate this deployable from others for the specified container
        Returns:
        true if the specified deployable is already registered or false otherwise
      • createDeployable

        public Deployable createDeployable​(String containerId,
                                           String deployableLocation,
                                           DeployableType deployableType)
        Creates an Deployable instance, wrapping a file or a directory.
        Specified by:
        createDeployable in interface DeployableFactory
        Parameters:
        containerId - the container id for which to create the deployable for
        deployableLocation - the location of the deployable being wrapped, which must point to a file or a directory (for an expanded deployable)
        deployableType - the deployable type to create
        Returns:
        the Deployable instance