Package org.spongepowered.asm.service

## Interface IMixinService

- All Known Implementing Classes:
    `MixinServiceAbstract`

      public interface IMixinService

  Mixin Service interface. Mixin services connect the mixin subsytem to the underlying environment. It is something of a god interface at present because it contains all of the current functionality accessors for calling into launchwrapper. In the future once support for modlauncher is added, it is anticipated that the interface can be split down into sub-services which handle different aspects of interacting with the environment.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `beginPhase()` | Called whenever a new phase is started
    `void` | `checkEnv​(java.lang.Object bootSource)` | Check whether the supplied object is a valid boot source for mixin environment
    `IMixinAuditTrail` | `getAuditTrail()` | Return the audit trail for this service.
    `IClassBytecodeProvider` | `getBytecodeProvider()` | Return the class bytecode provider for this service.
    `IClassProvider` | `getClassProvider()` | Return the class provider for this service.
    `IClassTracker` | `getClassTracker()` | Return the class tracker for this service.
    `MixinEnvironment.Phase` | `getInitialPhase()` | Get the initial subsystem phase
    `ILogger` | `getLogger​(java.lang.String name)` | Retrieve a logger adapter with the specified name (id).
    `MixinEnvironment.CompatibilityLevel` | `getMaxCompatibilityLevel()` | Get the maximum compatibility level supported by this service.
    `MixinEnvironment.CompatibilityLevel` | `getMinCompatibilityLevel()` | Get the minimum compatibility level supported by this service.
    `java.util.Collection<IContainerHandle>` | `getMixinContainers()` | Get a collection of containers in the current environment which contain mixins we should process
    `java.lang.String` | `getName()` | Get the friendly name for this service
    `java.util.Collection<java.lang.String>` | `getPlatformAgents()` | Get additional platform agents for this service
    `IContainerHandle` | `getPrimaryContainer()` | Get the primary container for the current environment, this is usually the container which contains the Mixin classes but can be another type of container as required by the environment
    `ReEntranceLock` | `getReEntranceLock()` | Get the transformer re-entrance lock for this service, the transformer uses this lock to track transformer re-entrance when co-operative load and transform is performed by the service.
    `java.io.InputStream` | `getResourceAsStream​(java.lang.String name)` | Get a resource as a stream from the appropriate classloader, this is delegated via the service so that the service can choose the correct classloader from which to obtain the resource.
    `java.lang.String` | `getSideName()` | Get the detected side name for this environment
    `ITransformerProvider` | `getTransformerProvider()` | Return the transformer provider for this service.
    `void` | `init()` | Called at the end of subsystem boot
    `boolean` | `isValid()` | True if this service type is valid in the current environment
    `void` | `offer​(IMixinInternal internal)` | Called when the subsystem is offering internal components to the service, the service can determine whether to retain or ignore the component based on its own requirements.
    `void` | `prepare()` | Called at subsystem boot

- - ### Method Detail

    - #### getName

          java.lang.String getName()

      Get the friendly name for this service

    - #### isValid

          boolean isValid()

      True if this service type is valid in the current environment

    - #### prepare

          void prepare()

      Called at subsystem boot

    - #### getInitialPhase

          MixinEnvironment.Phase getInitialPhase()

      Get the initial subsystem phase

    - #### offer

          void offer​(IMixinInternal internal)

      Called when the subsystem is offering internal components to the service, the service can determine whether to retain or ignore the component based on its own requirements.
      Parameters:
        `internal` - Internal component being offered

    - #### init

          void init()

      Called at the end of subsystem boot

    - #### beginPhase

          void beginPhase()

      Called whenever a new phase is started

    - #### checkEnv

          void checkEnv​(java.lang.Object bootSource)

      Check whether the supplied object is a valid boot source for mixin environment
      Parameters:
        `bootSource` - boot source

    - #### getReEntranceLock

          ReEntranceLock getReEntranceLock()

      Get the transformer re-entrance lock for this service, the transformer uses this lock to track transformer re-entrance when co-operative load and transform is performed by the service.

    - #### getClassProvider

          IClassProvider getClassProvider()

      Return the class provider for this service. This component is required and services must not return `null`.

    - #### getBytecodeProvider

          IClassBytecodeProvider getBytecodeProvider()

      Return the class bytecode provider for this service. This component is required and services must not return `null`.

    - #### getTransformerProvider

          ITransformerProvider getTransformerProvider()

      Return the transformer provider for this service. This component is optional and is allowed to be `null` for services which do not support transformers, or don't support interacting with them.

    - #### getClassTracker

          IClassTracker getClassTracker()

      Return the class tracker for this service. This component is optional and is allowed to be `null` for services which do not support this functionality.

    - #### getAuditTrail

          IMixinAuditTrail getAuditTrail()

      Return the audit trail for this service. This component is optional and is allowed to be `null` for services which do not support this functionality.

    - #### getPlatformAgents

          java.util.Collection<java.lang.String> getPlatformAgents()

      Get additional platform agents for this service

    - #### getPrimaryContainer

          IContainerHandle getPrimaryContainer()

      Get the primary container for the current environment, this is usually the container which contains the Mixin classes but can be another type of container as required by the environment

    - #### getMixinContainers

          java.util.Collection<IContainerHandle> getMixinContainers()

      Get a collection of containers in the current environment which contain mixins we should process

    - #### getResourceAsStream

          java.io.InputStream getResourceAsStream​(java.lang.String name)

      Get a resource as a stream from the appropriate classloader, this is delegated via the service so that the service can choose the correct classloader from which to obtain the resource.
      Parameters:
        `name` - resource path
      Returns:
        input stream or null if resource not found

    - #### getSideName

          java.lang.String getSideName()

      Get the detected side name for this environment

    - #### getMinCompatibilityLevel

          MixinEnvironment.CompatibilityLevel getMinCompatibilityLevel()

      Get the minimum compatibility level supported by this service. Can return `null` if the service has no specific minimum compatibility level, however if a value is returned, it will be used as the minimum compatibility level and no lower levels will be supported.
      Returns:
        minimum supported `MixinEnvironment.CompatibilityLevel` or null

    - #### getMaxCompatibilityLevel

          MixinEnvironment.CompatibilityLevel getMaxCompatibilityLevel()

      Get the maximum compatibility level supported by this service. Can return `null` if the service has no specific maximum compatibility level. If a value is returned, a warning will be raised if a configuration attempts to se a higher compatibility level.
      Returns:
        minimum supported `MixinEnvironment.CompatibilityLevel` or null

    - #### getLogger

          ILogger getLogger​(java.lang.String name)

      Retrieve a logger adapter with the specified name (id). In general this method will be called many times for a given name so it is anticipated that the returned logger instances are cached by the service.

      There is no contractual requirement however that adapters are cached and that the same adapter is returned for every call to this method with the same name.

      This methood must not return `null`.

      Implementations should be thread-safe since loggers may be requested by threads other than the main application thread.

      Parameters:
        `name` - Logger name
      Returns:
        Logger adapter for the underlying logging subsystem