org.licas.def

## Interface ServiceWrapperDef

- All Superinterfaces:
    ServiceDef
  All Known Implementing Classes:
    AutonomicManager, AutonomicManagerDefault, ServiceWrapper, ServiceWrapperLegacy

      public interface ServiceWrapperDef
      extends ServiceDef

  This interface contains some methods that a `ServiceWrapper` should have public. The wrapper needs to send certain requested information to its parent service, or to a server. The required methods are implemented in the default `ServiceWrapper` or `ServiceWrapperLegacy` classes. Note that the service now also stores some metrics or the message passed to a service.
  Author:
    Kieran Greer

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMetrics(MethodInfo messageObj, java.lang.String theAdminKey)` Add some metrics values relating to the current message.
    `void` | `copyFromService()` Reset the wrapper settings based on the wrapped object if a service.
    `void` | `copyToService(java.lang.Object parentService)` Copy and set certain settings between the service object and the wrapper.
    `org.licas_xml.abs.Element` | `getDescription()` Get the description value.
    `org.licas_xml.abs.Element` | `getFullPath()` Get the fully qualified uuid path back to the first parent object and server.
    `Metrics` | `getMetrics()` Get the default message/transaction metrics.
    `java.lang.Class` | `getObjClass()` Get the class type of the stored object.
    `java.lang.Object` | `getObjService(java.lang.String adminKey)` Get the stored object service.
    `java.lang.String` | `getServiceGrade()` Get the grade for this service.
    `WorkInfo` | `getWorkInfo()` Get the work protocol details for the service.
    `java.lang.Object` | `invokeObj(java.lang.reflect.Method theMethod, java.lang.Object[] params)` Invoke the method on the stored object with the specified parameters.
    `java.util.ArrayList<java.lang.reflect.Method>` | `reflectionMethods()` Get a list of public methods that can be accessed through the service.
    `void` | `setObjService(java.lang.Object theObj)` Set the wrapped object that is typically derived from `Service`, but can be a legacy object of any type.
    `boolean` | `storesLegacy()` Return true if the stored object is legacy code, false if a licas service.

    - ### Methods inherited from interface org.licas.def.ServiceDef

      `canAccess, canAccessTemp, getServiceType, getUUID, isAdminKey, setJarFile, setServiceType, setUUID`

- - ### Method Detail

    - #### storesLegacy

          boolean storesLegacy()

      Return true if the stored object is legacy code, false if a licas service.
      Returns:
        true if stores a legacy object, not a licas service.

    - #### getServiceGrade

          java.lang.String getServiceGrade()

      Get the grade for this service.
      Returns:
        the value of serviceGrade.

    - #### getDescription

          org.licas_xml.abs.Element getDescription()

      Get the description value. This is just the description and not the full set of admin rules.
      Returns:
        the service description.

    - #### getFullPath

          org.licas_xml.abs.Element getFullPath()
                                         throws java.lang.Exception

      Get the fully qualified uuid path back to the first parent object and server.
      Returns:
        the fully qualified path to access this component on the server.
      Throws:
        `java.lang.Exception` - any error.

    - #### getWorkInfo

          WorkInfo getWorkInfo()

      Get the work protocol details for the service.
      Returns:
        the service's `workInfo` details.

    - #### invokeObj

          java.lang.Object invokeObj(java.lang.reflect.Method theMethod,
                                     java.lang.Object[] params)
                              throws java.lang.Exception

      Invoke the method on the stored object with the specified parameters.
      Parameters:
        `theMethod` - the method to invoke.
        `params` - the parameter list.
      Returns:
        the result of the method invocation.
      Throws:
        `java.lang.Exception` - any error.

    - #### addMetrics

          void addMetrics(MethodInfo messageObj,
                          java.lang.String theAdminKey)

      Add some metrics values relating to the current message.
      Parameters:
        `messageObj` - the message object.
        `theAdminKey` - the admin key for the parent service.

    - #### getMetrics

          Metrics getMetrics()

      Get the default message/transaction metrics.
      Returns:
        the value of metrics.

    - #### copyToService

          void copyToService(java.lang.Object parentService)
                      throws java.lang.Exception

      Copy and set certain settings between the service object and the wrapper.
      Parameters:
        `parentService` - the parent of the wrapper.
      Throws:
        `java.lang.Exception` - any error.

    - #### copyFromService

          void copyFromService()

      Reset the wrapper settings based on the wrapped object if a service.

    - #### getObjClass

          java.lang.Class getObjClass()

      Get the class type of the stored object.
      Returns:
        the stored object classname.

    - #### setObjService

          void setObjService(java.lang.Object theObj)

      Set the wrapped object that is typically derived from `Service`, but can be a legacy object of any type.
      Parameters:
        `theObj` - the value of obj.

    - #### getObjService

          java.lang.Object getObjService(java.lang.String adminKey)

      Get the stored object service.
      Parameters:
        `adminKey` - the admin key for the object or wrapper.
      Returns:
        the stored object, or null if not the admin key.

    - #### reflectionMethods

          java.util.ArrayList<java.lang.reflect.Method> reflectionMethods()

      Get a list of public methods that can be accessed through the service.
      Returns:
        a list of Reflection method descriptions, not the licas descriptions.