Package org.apache.tapestry5.ioc.internal

## Class ServiceDefImpl

- java.lang.Object
- - org.apache.tapestry5.ioc.internal.ServiceDefImpl

- All Implemented Interfaces:
    `AnnotationAccess`, `ServiceDef`, `ServiceDef2`, `ServiceDef3`

      public class ServiceDefImpl
      extends java.lang.Object
      implements ServiceDef3

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ObjectCreator` | `createServiceCreator​(ServiceBuilderResources resources)` | Returns an `ObjectCreator` that can create the core service implementation.
    `boolean` | `equals​(java.lang.Object obj)` |
    `AnnotationProvider` | `getClassAnnotationProvider()` | Returns a provider for annotations on the service class and interface.
    `java.util.Set<java.lang.Class>` | `getMarkers()` | Returns an optional set of marker annotations.
    `AnnotationProvider` | `getMethodAnnotationProvider​(java.lang.String methodName, java.lang.Class... argumentTypes)` | Returns a provider for annotations of a method of the class.
    `java.lang.String` | `getServiceId()` | Returns the service id, derived from the method name or the unqualified service interface name.
    `java.lang.Class` | `getServiceImplementation()` | Returns the service implementation associated with this service.
    `java.lang.Class` | `getServiceInterface()` | Returns the service interface associated with this service.
    `java.lang.String` | `getServiceScope()` | Returns the lifecycle defined for the service.
    `int` | `hashCode()` |
    `boolean` | `isEagerLoad()` | Returns true if the service should be eagerly loaded at Registry startup.
    `boolean` | `isPreventDecoration()` | Returns true if the service should not be decorated.
    `java.lang.String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### createServiceCreator

          public ObjectCreator createServiceCreator​(ServiceBuilderResources resources)

      Description copied from interface: `ServiceDef`
      Returns an `ObjectCreator` that can create the core service implementation.
      Specified by:
        `createServiceCreator` in interface `ServiceDef`
      Parameters:
        `resources` - used to resolve dependencies of the service, or access its configuration
      Returns:
        an object that can (later) be used to instantiate the service itself

    - #### getServiceId

          public java.lang.String getServiceId()

      Description copied from interface: `ServiceDef`
      Returns the service id, derived from the method name or the unqualified service interface name. Service ids must be unique among all services in all modules. Service ids are used in a heavy handed way to support ultimate disambiguation, but their primary purpose is to support service contribution methods.
      Specified by:
        `getServiceId` in interface `ServiceDef`

    - #### getServiceInterface

          public java.lang.Class getServiceInterface()

      Description copied from interface: `ServiceDef`
      Returns the service interface associated with this service. This is the interface exposed to the outside world, as well as the one used to build proxies. In cases where the service is not defined in terms of an interface, this will return the actual implementation class of the service. Services without a true service interface are not proxied, which has a number of ramifications (such as losing lazy instantiation capabilities and other more interesting lifecycles).
      Specified by:
        `getServiceInterface` in interface `ServiceDef`

    - #### getServiceImplementation

          public java.lang.Class getServiceImplementation()

      Description copied from interface: `ServiceDef3`
      Returns the service implementation associated with this service. When creating the proxies for the service interface, the implementation of the service interface methods will receive the annotations of the corresponding method in the service interface.
      Specified by:
        `getServiceImplementation` in interface `ServiceDef3`

    - #### getServiceScope

          public java.lang.String getServiceScope()

      Description copied from interface: `ServiceDef`
      Returns the lifecycle defined for the service. This is indicated by adding a `Scope` annotation to the service builder method for the service. Services that are not proxied will ignore their scope; such services are always treated as singletons.
      Specified by:
        `getServiceScope` in interface `ServiceDef`
      See Also:
        `ServiceLifecycle`, `ServiceLifecycleSource`

    - #### isEagerLoad

          public boolean isEagerLoad()

      Description copied from interface: `ServiceDef`
      Returns true if the service should be eagerly loaded at Registry startup.
      Specified by:
        `isEagerLoad` in interface `ServiceDef`
      See Also:
        `EagerLoad`

    - #### getMarkers

          public java.util.Set<java.lang.Class> getMarkers()

      Description copied from interface: `ServiceDef`
      Returns an optional set of marker annotations. Marker annotations are used to disambiguate services; the combination of a marker annotation and a service type is expected to be unique. The annotation is placed on the field or method/constructor parameter and the service is located by combining the marker with service type (the parameter or field type).
      Specified by:
        `getMarkers` in interface `ServiceDef`
      Returns:
        the marker annotations for the service (possibly empty), including any default marker annotations from the containing module.

    - #### isPreventDecoration

          public boolean isPreventDecoration()

      Description copied from interface: `ServiceDef2`
      Returns true if the service should not be decorated. Most services allow decoration, unless the `PreventServiceDecoration` annotation is present.
      Specified by:
        `isPreventDecoration` in interface `ServiceDef2`

    - #### getClassAnnotationProvider

          public AnnotationProvider getClassAnnotationProvider()

      Description copied from interface: `AnnotationAccess`
      Returns a provider for annotations on the service class and interface. This will reflect annotations defined by the implementation class itself, plus annotations defined by the service interface (implementation class annotations take precedence).
      Specified by:
        `getClassAnnotationProvider` in interface `AnnotationAccess`
      Returns:
        an AnnotationProvider instance.

    - #### getMethodAnnotationProvider

          public AnnotationProvider getMethodAnnotationProvider​(java.lang.String methodName,
                                                                java.lang.Class... argumentTypes)

      Description copied from interface: `AnnotationAccess`
      Returns a provider for annotations of a method of the class. This includes annotations on the implementation method, plus annotations on the corresponding service interface method (if such a method exists), with precedence on the implementation class method annotations.
      Specified by:
        `getMethodAnnotationProvider` in interface `AnnotationAccess`
      Parameters:
        `methodName` - the name of the method.
        `argumentTypes` - the types of the parameters of the method.
      Returns:
        an AnnotationProvider instance. *

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals​(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`