org.licas

## Class Service

- java.lang.Object
- - java.lang.Thread
  - - org.licas.module.LicasModule
    - - org.licas.module.FrameworkModule
      - - org.licas.module.ServiceModule
        - - org.licas.Service

- All Implemented Interfaces:
    java.lang.AutoCloseable, java.lang.Runnable, ServiceDef
  Direct Known Subclasses:
    DataService, ServiceInterface, ServiceMediator, ServiceWrapperLegacy

      public abstract class Service
      extends ServiceModule
      implements java.lang.AutoCloseable

  This is the base class that can be used to create a licas service. This class provides the default functionality for storing service details, such as admin and metadata (`ServiceAdmin`), or links (`ServiceLinks`), and provides the communication framework for invoking service methods. The system is now more modular and services that are stored can be either `FrameworkModule` modules or full `Service` services. The modules would be for local actions only, inside of this service, and two default ones are the service behaviour `sm` and data `dm` modules. Any other ones can be stored as child services (@code addService}, but would not be accessible externally.

  This base class also has a built-in security mechanism through using wrappers and passwords, to protect the method invocation. The `Auto` class then extends this class with more agent-based or autonomous functionality.

  When a service is created, it passes some metadata to the `ESB` server, to be stored in a `ServiceRepository`. This is used for query retrieval where only limited metadata allowing for the service to be found and described is stored. This is returned as a `ServiceMeta` object, that has a number of metadata fields, including other external values, notably in the `Const`.`OTHERMETA`, or `DATA` sections. The `Data` section is transferred to the `DataModule` as a `Resource` object that can store static data or reference online data, for example.

  A service can also be initialised with specific metadata through an admin script. The script can include the metadata fields and also an `INSTANCEVALUES` section that can be used to initialise any internal service variable or field. If complex objects are declared, then the `Parsers` object needs to have a related parser. There is also `PARAMETERS` section in the script that will set constructor parameters, as part of more advanced and dynamic programming. For this initialisation to work, the service need to include some methods directly in its class code, as described in the documentation. This can mostly be ignored however. See also the code section that needs to be added to use this advanced metadata.

  Any `Service-derived` class that is loaded, is added to the server with a `ServiceWrapper` wrapper. If the object is not a licas service (`legacy code`) then a `ServiceWrapperLegacy` wrapper is used instead. Any service that is added to another service should probably be considered as a utility service to that one and is added with one of these wrappers. A base `Auto`-derived service however gets wrapped with an `AutonomicManager`, which by default is empty. The service wrapper is still useful however because it can add the licas-framework functionality to a wrapped legacy object and gives some added protection.

  Three types of link are available: Permanent links are static and made only between services on the same server. Each one can be created through a single call to the `createPermanentLinkTo` method. The permanent links are stored as a list of references in the `ServiceLinks`.`permanentLinks` structure. Dynamic links can then span across servers and are reference-only. They can be created through a novel linking mechanism that can be added to any service, as a module. In particular, there are two implementations called `Link` or `Link_M`. These would typically be added with the uuid of `ServiceConst`.`LINKER`. Dynamic links then build up over time through reinforcement, where they can be created and also destroyed. There are also simply service associations, or references to any service from any other service. These are added or removed in one go, can be used for anything and are stored again as a list of references in `ServiceLinks`.`serviceAssociations`.

  Any communication IDs saved in the service that are older than 3 days are automatically removed. This is checked in `addCommunicationID`. This class also extends `Thread`, but that is only used first in the `Auto` class.

  Author:
    Kieran Greer

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.lang.Thread

      `java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `canAccessMeta` True if allow to return the service metadata, false if force to hide the metadata.
    `protected boolean` | `canAccessNested` True if allow access to nested services, false otherwise.
    `protected DataModule` | `dm` Module to manage the service's data object.
    `protected boolean` | `finalised` True if `finaliseInitialisation` already called, in case construction is different
    `protected boolean` | `isRemoteCall` True if the current call to the object being invoked is remote.
    `protected MessageStore` | `messageStore` Communication IDs to identify the calling components and replies for stored method results.
    `protected ServiceAdmin` | `serviceAdmin` Lookup facility for this service
    `protected java.lang.String` | `serviceGrade` The service grade, for example `ServiceConst`.{code BASE} or `UTILITY`
    `protected ServiceInitialiseDef` | `serviceInitialise` To perform some final automatic initialisations
    `protected ServiceLinks` | `serviceLinks` Permanent links between services
    `protected java.lang.String` | `serviceState` The current state of the service if known
    `protected SM_Service` | `sm` Module to manage the service behaviour, allows for a more flexible plugin system.
    `protected org.licas_xml.abs.Element` | `toLoadScript` The last script part used to load a service, through the initialisation process

    - ### Fields inherited from class org.licas.module.ServiceModule

      `shutDown`

    - ### Fields inherited from class org.licas.module.FrameworkModule

      `passwordHandler, service, serviceType`

    - ### Fields inherited from class org.licas.module.LicasModule

      `jarFile, syncOn, uuid`

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Service()` Creates a new instance of Service.
    `Service(java.lang.String thisPassword, java.lang.String thisAdminKey)` Creates a new instance of Service.
    `Service(java.lang.String thisPassword, java.lang.String thisAdminKey, org.licas_xml.abs.Element adminXml)` Creates a new instance of Service.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `addCommunicationID(java.lang.String commID, java.lang.Object clientURI)` Store the commID with the related client URI, stored as `MessageInfo` objects with timestamps.
    `boolean` | `addDefaultService(java.lang.String serviceType, java.lang.String adminKey)` Add a default service to this service.
    `boolean` | `addDefaultService(java.lang.String serviceUuid, java.lang.String serviceType, java.util.ArrayList<?> params, org.licas_xml.abs.Element adminXml, java.lang.String adminKey)` Add a default service to this service.
    `boolean` | `addDefaultService(java.lang.String serviceUuid, java.lang.String serviceType, java.util.ArrayList<?> params, java.lang.String adminKey)` Add a default service to this service.
    `boolean` | `addDefaultService(java.lang.String serviceUuid, java.lang.String serviceType, java.lang.String adminKey)` Add a default service to this service.
    `boolean` | `addLinkFromService(java.lang.String serviceID, java.lang.Object theReference)` Add a link from another service locally in this service.
    `protected boolean` | `addLinkToService(java.lang.String serviceID, java.lang.Object theReference)` Add a link reference to another service locally in this service.
    `protected void` | `addMessageMetrics(MethodInfo messageInfo, java.lang.String thePassword)` Add metric or stat values for the message object.
    `boolean` | `addService(java.lang.String thePassword, java.lang.String serviceName, java.lang.String serviceType, java.util.ArrayList<java.lang.String> jarFile, java.lang.Object theService, boolean startService)` Add the service Object to this one.
    `boolean` | `addService(java.lang.String thePassword, java.lang.String serviceName, java.lang.String serviceType, java.util.ArrayList<java.lang.String> jarFile, java.lang.String className, java.util.ArrayList<java.lang.Object> params)` Load the service class and add as a service, but do not start its thread.
    `boolean` | `addService(java.lang.String thePassword, java.lang.String serviceName, java.lang.String serviceType, java.util.ArrayList<java.lang.String> jarFile, java.lang.String className, boolean startService, java.util.ArrayList<java.lang.Object> params)` Load the service class and add as a service.
    `boolean` | `addService(java.lang.String thePassword, java.lang.String serviceName, java.lang.String serviceType, java.lang.Object theService)` Add the service Object to this one.
    `boolean` | `addServiceAssociation(java.lang.String adminKey, org.licas_xml.abs.Element serviceUri, java.lang.String servicePassword)` Add a new URI for a link to a (probably remote) service.
    `void` | `addServicePassword(java.lang.String serviceUuid, java.lang.String servicePassword, java.lang.String adminKey)` Add a new service password to this service.
    `protected java.lang.String` | `addTempPassword(boolean addPassword)` Add a new temporary password to the temp passwords list.
    `boolean` | `allowAddService(java.lang.String adminKey, boolean allow)` Set the `allowAddService` variable to allow services to be added.
    `boolean` | `canAccess(java.lang.String thePassword, java.util.ArrayList<java.lang.reflect.Method> theMethods)` Return true if the password allows the calling component to access this component.
    `boolean` | `canAccess(java.lang.String thePassword, java.lang.reflect.Method theMethod)` Return true if the password allows the calling component to access this component.
    `boolean` | `canAccess(java.lang.String thePassword, java.lang.String methodName)` Return true if the password allows the calling component to access this component.
    `protected boolean` | `canAccess(java.lang.String thePassword, java.lang.String methodName, java.lang.reflect.Method theMethod)` Return true if the password allows the calling component to access this component.
    `boolean` | `canAccessMeta()` Return true if the service allows you to access its metadata, or false if access is not allowed.
    `boolean` | `canAccessNested()` Return true if the service allows you to access any of its nested services.
    `boolean` | `canAccessTemp(java.lang.String thePassword)` Return true if the password allows the calling component to access this component by a temporary password.
    `boolean` | `canRun()` Return the thread value indicating if the thread can be run.
    `protected boolean` | `classNameOK(java.lang.String className)` Check that the class name path is not illegal.
    `protected void` | `clearServiceLinks(java.util.ArrayList<?> serviceIDs, java.lang.String adminKey)` Clear the links for the named services.
    `boolean` | `clearServices(java.util.ArrayList<?> serviceIDs, java.lang.String adminKey)` Clear all existing services or service modules, with names on the list.
    `boolean` | `clearServices(java.lang.String adminKey)` Clear all existing services and service modules.
    `void` | `close()` Clean-up before shutting down the service.
    `ServiceMeta` | `createMetaForRepos(java.lang.String theAdminKey)` Create a metadata description of this service for the server repository.
    `ServiceMeta` | `createMetaFull(java.util.ArrayList<java.lang.String> jarFile, java.lang.String theAdminKey)` Create a full metadata description of this service.
    `boolean` | `createPermanentLinkTo(java.lang.String adminKey, java.lang.String serviceTo, java.lang.String servicePassword, org.licas_xml.abs.Element serviceUri)` Create a permanent link from this service to another service.
    `protected ServiceWrapperDef` | `createServiceWrapper(java.lang.Object serviceObj, java.lang.String serviceName, java.lang.String serviceType, java.util.ArrayList<java.lang.String> jarFiles, org.licas_xml.abs.Element adminXml)` Create a service wrapper for storing the service object.
    `static java.util.ArrayList<java.lang.String>` | `defaultAdminToRemove()` Create and return a list of admin info that should probably not be returned to a user for display purposes.
    `org.licas_xml.abs.Element` | `dynamicLinkQuery(LinkQueryConfig queryConfig)` Perform a query over the link paths to return matching sources.
    `void` | `dynamicLinksToPermanent(java.lang.String adminKey)` Convert any dynamic links to permanent ones, or remove any permanent links that do not now exist as dynamic ones.
    `org.licas_xml.abs.Element` | `dynamicLinksToXml()` Return all linked sources in XML format.
    `org.licas_xml.abs.Element` | `dynamicLinksToXml(java.lang.String adminKey)` Return all linked sources in XML format, including all link levels and the source weight values.
    `java.lang.Object` | `execute(MethodInfo methodInfo, boolean addTempPassword)` Execute the specified method and return the result.
    `protected void` | `finaliseInitialisation()` Finalise the initialisation of this service.
    `protected void` | `finaliseInitialisation(org.licas_xml.abs.Element servicesXml)` Finalise the initialisation of this service.
    `protected void` | `finaliseModule(ServiceDef module)` Finalise the module initialisation.
    `protected void` | `finaliseThisConfig()` Finalise the configuration of this service, for specific variable values.
    `java.lang.String` | `GET()` This is a method to be invoked by something like a RESTFul or HTTP Server call.
    `protected java.util.ArrayList<java.lang.Object>` | `getAllLinkToService()` Get all source references for a links to another service.
    `boolean` | `getAllowAddService()` Return the value indicating if a service can be added to this one.
    `org.licas_xml.abs.Element` | `getAutonomicManagerConfig(java.lang.String theAdminKey)` If the service has an admin document, check it for an autonomic manager section.
    `protected java.lang.Object` | `getCommunicationClientURI(java.lang.String commID)` Get the client URI stored in the message info for a communication ID.
    `java.lang.Object` | `getData()` Get the data value only, as a java object.
    `java.lang.Object` | `getData(org.licas_xml.abs.Element dataDescr)` Get the data value only, not converted into XML, based on some condition.
    `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.
    `protected java.lang.Object` | `getInstanceValue(java.lang.String varName)` Get the value of the specified variable if it exists.
    `boolean` | `getIsRemoteCall()` Return a value indicating if current call is remote.
    `java.lang.Object` | `getLinkFromService(java.lang.String serviceID)` Get the source reference for a link from another service.
    `java.lang.Object` | `getLinkToService(java.lang.String serviceID)` Get the source reference for a link to another service.
    `protected java.lang.String` | `getLocalRemoteID(org.licas_xml.abs.Element serviceUri)` If the Handle-style URI is for a local service running on the same server, then just return its ID, otherwise convert the whole URI to a string.
    `protected Service` | `getParent()` Get the parent component representation.
    `Service` | `getParent(java.lang.String adminKey)` Get the parent component representation.
    `java.lang.String` | `getPassword(java.lang.String theAdminKey)` Get the password for this service.
    `java.lang.String` | `getPassword(java.lang.String clientID, Contract clientContract)` Get this service's password, depending on the calling component's contract description.
    `java.lang.String` | `getPassword(java.lang.String serviceUuid, java.lang.String theAdminKey)` Get the password for the specified service.
    `protected PasswordHandler` | `getPasswordHandler()` Get the password handler.
    `protected java.util.ArrayList<java.lang.String>` | `getPrivateMethods()` Get the list of public-level methods that should not be invoked externally, maybe from an interface.
    `java.util.ArrayList<java.lang.String>` | `getPublicMethods()` Get the list of methods that can be freely called on a Service in general, without even requiring a password.
    `java.lang.String` | `getPublicServiceClassname(java.lang.String serviceType)` Get the class type for a standard default service, known by the service factory or this service.
    `protected java.lang.String` | `getServerPassword()` Get the local server password if it is stored.
    `ServiceWrapperDef` | `getService(java.lang.String serviceName, java.lang.String thePassword)` Return the service or module for the related service name.
    `java.lang.Object` | `getService(java.lang.String serviceName, java.lang.String thePassword, java.lang.String adminKey)` Return the service or module for the related service name.
    `ServiceAdmin` | `getServiceAdmin(java.lang.String adminKey)` Get this service's service admin, including its metadata info.
    `java.util.HashMap<java.lang.String,java.lang.String>` | `getServiceClasses(java.lang.String theAdminKey)` Get the class types for all services that are stored.
    `java.lang.String` | `getServiceGrade()` Get the grade for this service.
    `ServiceLinks` | `getServiceLinks(java.lang.String adminKey)` Get this service's linking structure.
    `java.util.ArrayList<java.lang.String>` | `getServiceNames()` Get all child service and module names.
    `java.util.ArrayList<java.lang.String>` | `getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes)` Return all child or module service names for a list of service types.
    `java.util.ArrayList<java.lang.String>` | `getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes, boolean reciprocal)` Return all child or module service names for a list of service types.
    `int` | `getServiceNumber(java.lang.String serviceType)` Return a count of how many services of the specified type are on this service.
    `FrameworkModule` | `getServiceOrWrapper(java.lang.String serviceName, java.lang.String thePassword, java.lang.String adminKey)` Return the service, module or its wrapper for the related service name.
    `java.lang.String` | `getServiceState(java.lang.String adminKey)` This method returns a value indicating the what current service state is.
    `java.lang.String` | `getServiceType(java.lang.String serviceName)` Get the service type for the named child service if it exists.
    `java.util.ArrayList<java.lang.String>` | `getServiceTypes()` Return all service types for all stored services and modules.
    `boolean` | `handshake(org.licas_xml.abs.Element serverURI, java.lang.String serverPassword, java.lang.String serviceID, java.lang.String servicePassword)` Checks if the calling client exists and can connect with it.
    `boolean` | `hasCommunicationID(java.lang.String commID)` Return true if this service currently stores a conversation with the specified communication ID.
    `boolean` | `hasLinkTo(java.lang.String serviceID)` Return true if this service has a permanent local link (`PermanentLink` only) to the service with the specified service ID.
    `protected boolean` | `hasServerPassword()` Return true if the local server password is stored.
    `boolean` | `hasService(java.lang.String serviceID)` Return true if a service with the specified id is running on this one.
    `boolean` | `hasServiceType(java.lang.String serviceType)` Return true if a service with the specified type is running on this one.
    `boolean` | `interrupt(java.lang.String adminKey)` You must call this method to interrupt the thread.
    `boolean` | `isCorrectPassword(java.lang.String methodName, java.lang.String thePassword)` Return true if the password is the correct one to call the method.
    `protected boolean` | `isPrivateMethod(java.lang.String methodName)` Return true if the method is a public-level method that should not be accessed externally.
    `boolean` | `isPublicMethod(java.lang.String methodName)` Return true if the method is a public method that can be freely called, without a password even.
    `boolean` | `isStarted()` Return the thread value indicating if the thread is currently running.
    `org.licas_xml.abs.Element` | `linksToXml(java.lang.String adminKey)` Return all linked references in XML format.
    `org.licas_xml.abs.Element` | `passwordsStateToXml(java.lang.String adminKey)` Serialize the stored passwords list and the service state, and return as an XML-based description.
    `org.licas_xml.abs.Element` | `permanentLinksToXml()` Return all permanent linked-t0 services in XML format.
    `java.util.ArrayList<java.lang.reflect.Method>` | `reflectionMethods()` Get a list of public methods that can be accessed through the service.
    `protected java.lang.Object` | `reflectionObject(java.lang.reflect.Method method)` Get which object in the service is able to execute the method.
    `boolean` | `removeAllLinksTo(java.lang.String serviceID, java.lang.String adminKey)` Remove all non-dynamic links to the specified service from all other services.
    `void` | `removeAllServices(java.util.ArrayList<?> serviceIDs, java.lang.String adminKey)` Remove all child services and modules on the service list from this service and terminate their threads.
    `protected void` | `removeAllServices(java.lang.String adminKey)` Remove all child services and modules from this service and terminate their threads.
    `protected void` | `removeCommunicationID(java.lang.String communicationID)` Remove the communication ID reference.
    `void` | `removeLinkFromService(java.lang.String serviceID)` Remove the local link from the specified service if it exists.
    `protected void` | `removeLinkToService(java.lang.String serviceID)` Remove the local link to the specified service if it exists.
    `boolean` | `removePermanentLinkTo(java.lang.String adminKey, java.lang.String serviceTo, java.lang.String servicePassword, org.licas_xml.abs.Element serviceUri)` Remove a permanent link from this service to another service.
    `void` | `removeServiceAssociation(org.licas_xml.abs.Element serviceUri)` Remove a URI for a link to a (probably remote) service.
    `boolean` | `removeServiceID(java.lang.String serviceUuid, java.lang.String adminKey)` Remove the service or module with the indicated ID from the list and terminate it.
    `boolean` | `removeServicePath(org.licas_xml.abs.Element servicePath, java.lang.String adminKey)` Remove the service or module with the indicated path from the list and terminate it.
    `boolean` | `removeServicePath(org.licas_xml.abs.Element servicePath, java.lang.String adminKey, boolean stopThread)` Remove the service or module with the indicated path from the list.
    `protected void` | `removeTempPassword(java.lang.String tempPassword)` Remove the temporary password from the list if it exists.
    `Contract` | `serviceNegotiate(java.lang.String id, Contract clientContract)` Allow a client to negotiate with this service about a contract agreement.
    `org.licas_xml.abs.Element` | `serviceToXml(java.lang.String adminKey)` Serialize the service using the `ServiceSerialize` class.
    `org.licas_xml.abs.Element` | `serviceToXml(java.lang.String adminKey, java.util.ArrayList<java.lang.String> adminToRemove, java.util.ArrayList<java.lang.String> toSerialize)` Serialize the service using the `ServiceSerialize` class.
    `void` | `setAdminInfo(org.licas_xml.abs.Element adminXml, java.lang.String adminKey)` Set a full admin info description for the service.
    `void` | `setCanAccessMeta(boolean thisCanAccessMeta, java.lang.String adminKey)` Set the variable indicating if the service metadata can be accessed.
    `void` | `setCanAccessNested(boolean thisCanAccessNested, java.lang.String adminKey)` Set the variable indicating if nested child services can be directly accessed.
    `boolean` | `setData(org.licas_xml.abs.Element dataXml, java.lang.String adminKey)` Set the value that this service will use as its data source.
    `protected void` | `setDataModule()` Set the data module to process a `Resource`, as described in the admin document.
    `boolean` | `setDataModule(java.lang.String adminKey)` Set the data module to process a `Resource`, as described in the admin document.
    `boolean` | `setDescription(org.licas_xml.abs.Element descriptionXml, java.lang.String adminKey)` Set the service description value only.
    `protected void` | `setInstanceValues(org.licas_xml.abs.Element instanceValues)` Set actual values for variable instances if they are defined.
    `void` | `setIsRemoteCall(boolean thisIsRemoteCall)` Set the value indicating a remote call.
    `boolean` | `setOtherMeta(org.licas_xml.abs.Element otherMetaXml, java.lang.String adminKey)` Set the additional metadata value.
    `protected boolean` | `setParent(Service thisParent)` Set the parent component value.
    `boolean` | `setParent(Service thisParent, java.lang.String adminKey)` Set the parent component value.
    `protected void` | `setSerializeValues(org.licas_xml.abs.Element serializeXml)` Set actual values for serialized variable instances if they are defined.
    `protected void` | `setServerPassword(java.lang.String thePassword)` Set the password that will allow this service to access the server it runs on.
    `protected void` | `setServiceGrade(java.lang.String thisServiceGrade)` Set the service grade or function class.
    `protected void` | `setServiceModule()` Set the outer-most module that provides the essential service methods.
    `void` | `setServiceState(java.lang.String theServiceState, java.lang.String adminKey)` This sets a value indicating the current service state.
    `boolean` | `startAllThreads(java.lang.String serviceType, java.lang.String adminKey)` Start the threads for all child services of the specified component type.
    `boolean` | `startThread(java.lang.String adminKey)` Start this service's thread running.
    `boolean` | `stopAllThreads(java.lang.String serviceType, java.lang.String adminKey)` Stop the threads for all child services of the specified component type.
    `void` | `syncToAsync(MethodInfo methodInfo)` This method can be invoked by a client that maybe does not have constant access to the server.
    `MessageInfo` | `syncToAsyncReply(java.lang.String replyID)` Retrieve a stored method reply.
    `boolean` | `syncToAsyncTransit(java.lang.String replyID)` Return true if a reply id for a method invocation has been registered and the method execution is still on-going.
    `boolean` | `xmlToDynamicLinks(org.licas_xml.abs.Element linksXml, java.lang.String adminKey)` Parse the links descriptions and add to the service.
    `static java.lang.Object` | `xmlToService(org.licas_xml.abs.Element serviceXml, java.lang.String password)` Create the service from the description using the `ServiceSerialize` class.

    - ### Methods inherited from class org.licas.module.ServiceModule

      `getShutDown, setShutDown, setShutDown`

    - ### Methods inherited from class org.licas.module.FrameworkModule

      `canAccess, getPasswordHandler, getServicePassword, getServiceType, isAdminKey, setServiceDetails, setServiceType`

    - ### Methods inherited from class org.licas.module.LicasModule

      `getJarFile, getUUID, loadObject, setJarFile, setUUID, threadAliveState`

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

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

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

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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

      `getUUID, setJarFile, setUUID`

- - ### Field Detail

    - #### canAccessMeta

          protected boolean canAccessMeta

      True if allow to return the service metadata, false if force to hide the metadata. The default value is true.

    - #### canAccessNested

          protected boolean canAccessNested

      True if allow access to nested services, false otherwise. If true then the nested service's password is still required. If false then the call is blocked regardless of what password is used. Nested services could typically be utility services of this one, when allowing access to them from a client might not be suitable. The default value is true.

    - #### finalised

          protected boolean finalised

      True if `finaliseInitialisation` already called, in case construction is different

    - #### serviceGrade

          protected java.lang.String serviceGrade

      The service grade, for example `ServiceConst`.{code BASE} or `UTILITY`

    - #### serviceState

          protected java.lang.String serviceState

      The current state of the service if known

    - #### toLoadScript

          protected org.licas_xml.abs.Element toLoadScript

      The last script part used to load a service, through the initialisation process

    - #### sm

          protected SM_Service sm

      Module to manage the service behaviour, allows for a more flexible plugin system. Service has the most lightweight set of variables.

    - #### dm

          protected DataModule dm

      Module to manage the service's data object. This is stored as a `Resource` to some local or remote data.

    - #### serviceAdmin

          protected ServiceAdmin serviceAdmin

      Lookup facility for this service

    - #### serviceLinks

          protected ServiceLinks serviceLinks

      Permanent links between services

    - #### serviceInitialise

          protected ServiceInitialiseDef serviceInitialise

      To perform some final automatic initialisations

    - #### messageStore

          protected MessageStore messageStore

      Communication IDs to identify the calling components and replies for stored method results.

    - #### isRemoteCall

          protected boolean isRemoteCall

      True if the current call to the object being invoked is remote. By remote it is meant that the call is for a service on a different server. A call to a service on the same server can be made through local references and does not require a RPC mechanism.

  - ### Constructor Detail

    - #### Service

          public Service()
                  throws java.lang.Exception

      Creates a new instance of Service.
      Throws:
        `java.lang.Exception` - any error.

    - #### Service

          public Service(java.lang.String thisPassword,
                         java.lang.String thisAdminKey)
                  throws java.lang.Exception

      Creates a new instance of Service.
      Parameters:
        `thisPassword` - password to invoke this service.
        `thisAdminKey` - admin key for protected access.
      Throws:
        `java.lang.Exception` - any error.

    - #### Service

          public Service(java.lang.String thisPassword,
                         java.lang.String thisAdminKey,
                         org.licas_xml.abs.Element adminXml)
                  throws java.lang.Exception

      Creates a new instance of Service.
      Parameters:
        `thisPassword` - password to invoke this service.
        `thisAdminKey` - admin key for this service.
        `adminXml` - the admin info or description of this service.
      Throws:
        `java.lang.Exception` - any error.

  - ### Method Detail

    - #### setServiceModule

          protected void setServiceModule()
                                   throws java.lang.Exception

      Set the outer-most module that provides the essential service methods. This should extend `SM_Service` for Service or `SM_Auto` for `Auto`.
      Throws:
        `java.lang.Exception` - any error.

    - #### setDataModule

          public boolean setDataModule(java.lang.String adminKey)
                                throws java.lang.Exception

      Set the data module to process a `Resource`, as described in the admin document. If there is no data processing then set the module to `null`.
      Parameters:
        `adminKey` - the service admin key.
      Returns:
        true if set, false if not set.
      Throws:
        `java.lang.Exception` - any error.

    - #### setDataModule

          protected void setDataModule()
                                throws java.lang.Exception

      Set the data module to process a `Resource`, as described in the admin document. If there is no data processing then set the module to `null`.
      Throws:
        `java.lang.Exception` - any error.

    - #### finaliseInitialisation

          protected void finaliseInitialisation()
                                         throws java.lang.Exception

      Finalise the initialisation of this service. If an admin document has been passed to the constructor, it might contain information on additional services or operations. As these might involve registering utility or other services, both with this service or the server, they should be loaded only after this service has been fully registered itself. This method therefore gets called automatically, but at a different place in the code, at the end of the `addService` methods. It uses an implementation of the `ServiceInitialise` class to finalise the initialisation process. To override, reset the `serviceInitialise` variable in your derived class (see `LinkService`, for example) to your new version and implement the default method as required.
      Throws:
        `java.lang.Exception` - any error.

    - #### finaliseInitialisation

          protected void finaliseInitialisation(org.licas_xml.abs.Element servicesXml)
                                         throws java.lang.Exception

      Finalise the initialisation of this service. If an admin document has been passed to the constructor, it might contain information on additional services or operations. As these might involve registering utility or other services, both with this service or the server, they should be loaded only after this service has been fully registered itself. This method therefore gets called automatically, but at a different place in the code, at the end of the `addService` methods. It uses an implementation of the `ServiceInitialise` class to finalise the initialisation process. To override, reset the `serviceInitialise` variable in your derived class (see `LinkService`, for example) to your new version and implement the default method as required.
      Parameters:
        `servicesXml` - services to load XML section. This is so that initialisation can be done from somewhere other than the exact registration place, for other loaded objects, for example.
      Throws:
        `java.lang.Exception` - any error.

    - #### finaliseThisConfig

          protected void finaliseThisConfig()
                                     throws java.lang.Exception

      Finalise the configuration of this service, for specific variable values.
      Throws:
        `java.lang.Exception` - any error.

    - #### finaliseModule

          protected void finaliseModule(ServiceDef module)
                                 throws java.lang.Exception

      Finalise the module initialisation. The module can probably be created with an empty parameter list.
      Parameters:
        `module` - the module to check.
      Throws:
        `java.lang.Exception` - any error.

    - #### setInstanceValues

          protected void setInstanceValues(org.licas_xml.abs.Element instanceValues)
                                    throws java.lang.Exception

      Set actual values for variable instances if they are defined.

      `NOTE:` you must add this method to your own derived class if you use it, so that the private variables in that class can be accessed.

      Parameters:
        `instanceValues` - the admin script part that defines instance values.
      Throws:
        `java.lang.Exception` - any error.

    - #### getInstanceValue

          protected java.lang.Object getInstanceValue(java.lang.String varName)
                                               throws java.lang.Exception

      Get the value of the specified variable if it exists.

      `NOTE:` you must add this method to your own derived class if you use it, so that the private variables in that class can be accessed. It is ignored unless it gets called through the script initialisation process.

      Parameters:
        `varName` - the name of the variable to check for.
      Returns:
        the variable value, or null if it does not exist.
      Throws:
        `java.lang.Exception` - any error.

    - #### setSerializeValues

          protected void setSerializeValues(org.licas_xml.abs.Element serializeXml)
                                     throws java.lang.Exception

      Set actual values for serialized variable instances if they are defined.

      `NOTE:` you must add this method to your own derived class if you use it, so that the private variables in that class can be accessed.

      Parameters:
        `serializeXml` - the admin script part that defines serialize instance values.
      Throws:
        `java.lang.Exception` - any error.

    - #### GET

          public java.lang.String GET()
                               throws java.lang.Exception

      This is a method to be invoked by something like a RESTFul or HTTP Server call. It is supposed to copy the HTTP GET protocol method and return the content of this service, as a String. This default version returns an empty String, so you need to override this method in your own classes to return any values. The `InformationService`, for example, should have a specific implementation.
      Returns:
        a String-based value representing the content of the service.
      Throws:
        `java.lang.Exception` - any error.

    - #### addMessageMetrics

          protected void addMessageMetrics(MethodInfo messageInfo,
                                           java.lang.String thePassword)
                                    throws java.lang.Exception

      Add metric or stat values for the message object. The metrics are added to the base service only, or the service directly loaded onto the ESB, not any utility service, so this firstly traverses back o the base service before adding any stats.
      Parameters:
        `messageInfo` - the message info with the message object.
        `thePassword` - the password for this service.
      Throws:
        `java.lang.Exception` - any error.

    - #### isStarted

          public boolean isStarted()

      Return the thread value indicating if the thread is currently running.
      Returns:
        true if thread state is anything but new, false otherwise.

    - #### canRun

          public boolean canRun()

      Return the thread value indicating if the thread can be run.
      Returns:
        true if thread state is new, false otherwise.

    - #### isCorrectPassword

          public boolean isCorrectPassword(java.lang.String methodName,
                                           java.lang.String thePassword)
                                    throws java.lang.Exception

      Return true if the password is the correct one to call the method.
      Parameters:
        `methodName` - the name of the method.
        `thePassword` - the password used to call the method.
      Returns:
        true if the method can be called using the password.
      Throws:
        `java.lang.Exception` - any error.

    - #### isPublicMethod

          public boolean isPublicMethod(java.lang.String methodName)

      Return true if the method is a public method that can be freely called, without a password even.
      Parameters:
        `methodName` - the name of the method.
      Returns:
        true if the method can be freely called.

    - #### isPrivateMethod

          protected boolean isPrivateMethod(java.lang.String methodName)

      Return true if the method is a public-level method that should not be accessed externally.
      Parameters:
        `methodName` - the name of the method.
      Returns:
        true if the method should not be called.

    - #### hasService

          public boolean hasService(java.lang.String serviceID)

      Return true if a service with the specified id is running on this one.
      Parameters:
        `serviceID` - the service uuid to check for.
      Returns:
        true if a service with that ID is running, false otherwise.

    - #### hasServiceType

          public boolean hasServiceType(java.lang.String serviceType)

      Return true if a service with the specified type is running on this one.
      Parameters:
        `serviceType` - the service type to check for.
      Returns:
        true if a service of that type is running, false otherwise.

    - #### hasCommunicationID

          public boolean hasCommunicationID(java.lang.String commID)

      Return true if this service currently stores a conversation with the specified communication ID.
      Parameters:
        `commID` - the communication ID to check for.
      Returns:
        true if the communication ID, false otherwise.

    - #### getServiceAdmin

          public ServiceAdmin getServiceAdmin(java.lang.String adminKey)

      Get this service's service admin, including its metadata info.
      Parameters:
        `adminKey` - the admin key for this service.
      Returns:
        the value of serviceAdmin.

    - #### getServiceLinks

          public ServiceLinks getServiceLinks(java.lang.String adminKey)

      Get this service's linking structure.
      Parameters:
        `adminKey` - the admin key for this service.
      Returns:
        the value of serviceLinks.

    - #### getAutonomicManagerConfig

          public org.licas_xml.abs.Element getAutonomicManagerConfig(java.lang.String theAdminKey)

      If the service has an admin document, check it for an autonomic manager section.
      Parameters:
        `theAdminKey` - the service key for this service.
      Returns:
        the auto man config document if it exists, null otherwise.

    - #### startThread

          public boolean startThread(java.lang.String adminKey)

      Start this service's thread running.
      Parameters:
        `adminKey` - the admin key for this service.
      Returns:
        true if started, false otherwise.

    - #### startAllThreads

          public boolean startAllThreads(java.lang.String serviceType,
                                         java.lang.String adminKey)
                                  throws java.lang.Exception

      Start the threads for all child services of the specified component type. If `Const`.`ALLSERVICES`, then any child service can be started.
      Parameters:
        `serviceType` - the service type. Can be general or a specific uuid.
        `adminKey` - the service key for this service.
      Returns:
        true if all services could be accessed or false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### stopAllThreads

          public boolean stopAllThreads(java.lang.String serviceType,
                                        java.lang.String adminKey)
                                 throws java.lang.Exception

      Stop the threads for all child services of the specified component type. If `Const`.`ALLSERVICES`, then any child service can be stopped.
      Parameters:
        `serviceType` - the service type. Can be general or a specific uuid.
        `adminKey` - the service key for this service.
      Returns:
        true if all services could be accessed or false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### getAllowAddService

          public boolean getAllowAddService()

      Return the value indicating if a service can be added to this one.
      Returns:
        the value of allowAddService.

    - #### allowAddService

          public boolean allowAddService(java.lang.String adminKey,
                                         boolean allow)

      Set the `allowAddService` variable to allow services to be added.
      Parameters:
        `adminKey` - the admin key for this service.
        `allow` - true if reset to allow adding of services, false to reset to block of adding services.
      Returns:
        true if the variable is set (adminKey OK), false otherwise.

    - #### setCanAccessMeta

          public void setCanAccessMeta(boolean thisCanAccessMeta,
                                       java.lang.String adminKey)
                                throws java.lang.Exception

      Set the variable indicating if the service metadata can be accessed.
      Parameters:
        `thisCanAccessMeta` - true if can access metadata, false if cannot.
        `adminKey` - the service key for this service.
      Throws:
        `java.lang.Exception` - any error.

    - #### canAccessMeta

          public boolean canAccessMeta()

      Return true if the service allows you to access its metadata, or false if access is not allowed.
      Returns:
        the value of canAccessMeta.

    - #### setCanAccessNested

          public void setCanAccessNested(boolean thisCanAccessNested,
                                         java.lang.String adminKey)
                                  throws java.lang.Exception

      Set the variable indicating if nested child services can be directly accessed. If set to false, the services are not accessible, even if the password is known.
      Parameters:
        `thisCanAccessNested` - true if can access nested services, false if cannot.
        `adminKey` - the service key for this service.
      Throws:
        `java.lang.Exception` - any error.

    - #### canAccessNested

          public boolean canAccessNested()

      Return true if the service allows you to access any of its nested services.
      Returns:
        true if the nested services can be called directly, or false if access is not allowed.

    - #### getPassword

          public java.lang.String getPassword(java.lang.String theAdminKey)

      Get the password for this service.
      Parameters:
        `theAdminKey` - the service key.
      Returns:
        the access password for this service.

    - #### getPassword

          public java.lang.String getPassword(java.lang.String serviceUuid,
                                              java.lang.String theAdminKey)
                                       throws java.lang.Exception

      Get the password for the specified service.
      Parameters:
        `serviceUuid` - the id of the service to ask the password for.
        `theAdminKey` - the service key.
      Returns:
        the password for the specified service or null if it cannot be retrieved.
      Throws:
        `java.lang.Exception` - any error.

    - #### getPassword

          public java.lang.String getPassword(java.lang.String clientID,
                                              Contract clientContract)
                                       throws java.lang.Exception

      Get this service's password, depending on the calling component's contract description. By default, a service is assigned a 'yes' contract, meaning that it is open and will always return its password to allow for method invocation. The other default option is a 'no' contract, meaning that there is no negotiation and the password must be known. This can also be changed by adding a different 'sla' contract for each service level in the service. You can therefore override this method to provide your own checks, using this as a guide.
      Parameters:
        `clientID` - the clientID of the calling component.
        `clientContract` - the description of the calling component's contract proposal. Note that the default `Contract`.`getYesContract()` can often be used.
      Returns:
        the value of the password for the specified service level if the contract is accepted, or null if it is not accepted. The default 'yes' contract always returns the password.
      Throws:
        `java.lang.Exception` - any error.

    - #### setServerPassword

          protected void setServerPassword(java.lang.String thePassword)
                                    throws java.lang.Exception

      Set the password that will allow this service to access the server it runs on.
      Parameters:
        `thePassword` - the server password.
      Throws:
        `java.lang.Exception` - any error.

    - #### hasServerPassword

          protected boolean hasServerPassword()
                                       throws java.lang.Exception

      Return true if the local server password is stored. This would imply a running server and the service has been registered with it.
      Returns:
        true if the local server password is saved, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### getServerPassword

          protected java.lang.String getServerPassword()
                                                throws java.lang.Exception

      Get the local server password if it is stored.
      Overrides:
        `getServerPassword` in class `FrameworkModule`
      Returns:
        the local server password.
      Throws:
        `java.lang.Exception` - any error.

    - #### canAccess

          public boolean canAccess(java.lang.String thePassword,
                                   java.lang.String methodName)
                            throws java.lang.Exception

      Return true if the password allows the calling component to access this component.
      Parameters:
        `thePassword` - the password to use.
        `methodName` - the method name that needs to be called.
      Returns:
        true if the entered password is the correct password or there is no password.
      Throws:
        `java.lang.Exception` - any error.

    - #### canAccess

          public boolean canAccess(java.lang.String thePassword,
                                   java.lang.reflect.Method theMethod)
                            throws java.lang.Exception

      Return true if the password allows the calling component to access this component.
      Parameters:
        `thePassword` - the password to use.
        `theMethod` - the method that needs to be called.
      Returns:
        true if the entered password is the correct password or there is no password.
      Throws:
        `java.lang.Exception` - any error.

    - #### canAccess

          public boolean canAccess(java.lang.String thePassword,
                                   java.util.ArrayList<java.lang.reflect.Method> theMethods)
                            throws java.lang.Exception

      Return true if the password allows the calling component to access this component.
      Parameters:
        `thePassword` - the password to use.
        `theMethods` - a list of possible legal methods to call.
      Returns:
        true if the entered password is the correct password or there is no password.
      Throws:
        `java.lang.Exception` - any error.

    - #### canAccess

          protected boolean canAccess(java.lang.String thePassword,
                                      java.lang.String methodName,
                                      java.lang.reflect.Method theMethod)
                               throws java.lang.Exception

      Return true if the password allows the calling component to access this component. The `execute` method is always allowed because it will invoke another method.
      Parameters:
        `thePassword` - the password to use.
        `methodName` - the method name that needs to be called.
        `theMethod` - the method that needs to be called.
      Returns:
        true if the entered password is the correct password or there is no password.
      Throws:
        `java.lang.Exception` - any error.

    - #### canAccessTemp

          public boolean canAccessTemp(java.lang.String thePassword)

      Return true if the password allows the calling component to access this component by a temporary password.
      Specified by:
        `canAccessTemp` in interface `ServiceDef`
      Overrides:
        `canAccessTemp` in class `FrameworkModule`
      Parameters:
        `thePassword` - the password to use.
      Returns:
        true if the entered password is the valid.

    - #### serviceNegotiate

          public Contract serviceNegotiate(java.lang.String id,
                                           Contract clientContract)
                                    throws java.lang.Exception

      Allow a client to negotiate with this service about a contract agreement.
      Parameters:
        `id` - the id of the calling component.
        `clientContract` - the description of the calling component's contract proposal.
      Returns:
        the reply to the proposed contract. If this is OK, it then needs to be sent to the `getPassword` method as the agreed contract, to retrieve the service password.
      Throws:
        `java.lang.Exception` - any error.

    - #### addServicePassword

          public void addServicePassword(java.lang.String serviceUuid,
                                         java.lang.String servicePassword,
                                         java.lang.String adminKey)

      Add a new service password to this service.
      Parameters:
        `serviceUuid` - the full uuid description of the service the password is for.
        `servicePassword` - the service password.
        `adminKey` - the admin key for this service.

    - #### addTempPassword

          protected java.lang.String addTempPassword(boolean addPassword)
                                              throws java.lang.Exception

      Add a new temporary password to the temp passwords list.
      Parameters:
        `addPassword` - true if add a password.
      Returns:
        the newly created password or null if do not add.
      Throws:
        `java.lang.Exception` - any error.

    - #### removeTempPassword

          protected void removeTempPassword(java.lang.String tempPassword)

      Remove the temporary password from the list if it exists.
      Parameters:
        `tempPassword` - the temporary password.

    - #### getFullPath

          public 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.

    - #### addDefaultService

          public final boolean addDefaultService(java.lang.String serviceType,
                                                 java.lang.String adminKey)
                                          throws java.lang.Exception

      Add a default service to this service. The new service must be one of the known default services. This method will then automatically create a new instance of the correct class type and add it with the same password and admin key as this service, and with a uuid name equal to the service type. The new service will therefore not have unique passwords and so will have less security. Setting `canAccessNested` to false however, can block access from an external service to any nested service no matter what password is used.
      Parameters:
        `serviceType` - the type of service to create. This is also used as the service uuid.
        `adminKey` - the admin key for this service.
      Returns:
        true if the service as added, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### addDefaultService

          public final boolean addDefaultService(java.lang.String serviceUuid,
                                                 java.lang.String serviceType,
                                                 java.lang.String adminKey)
                                          throws java.lang.Exception

      Add a default service to this service. The new service must be one of the known default services. This method will then automatically create a new instance of the correct class type and add it with the same password and admin key as this service, but also with a unique uuid. The new service will therefore not have unique passwords and so will have less security. Setting `canAccessNested` to false however, can block access from an external service to any nested service no matter what password is used.
      Parameters:
        `serviceUuid` - the uuid for the new default service to add. This is not used for a linking service, which is assigned the 'LINKER' uuid name.
        `serviceType` - the type of service to create.
        `adminKey` - the admin key for this service.
      Returns:
        true if the service as added, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### addDefaultService

          public final boolean addDefaultService(java.lang.String serviceUuid,
                                                 java.lang.String serviceType,
                                                 java.util.ArrayList<?> params,
                                                 java.lang.String adminKey)
                                          throws java.lang.Exception

      Add a default service to this service. The new service must be one of the known default services. This method will then automatically create a new instance of the correct class type and add it, but with the password and admin key specified in the constructor params list. The new service will therefore have unique passwords as well.
      Parameters:
        `serviceUuid` - the uuid for the new default service to add. This is not used for a linking service, which is assigned the `ServiceConst`.`LINKER` uuid name.
        `serviceType` - the type of service to create.
        `params` - list of constructor parameters - should be password and admin key.
        `adminKey` - the admin key for this service.
      Returns:
        true if the service as added, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### addDefaultService

          public final boolean addDefaultService(java.lang.String serviceUuid,
                                                 java.lang.String serviceType,
                                                 java.util.ArrayList<?> params,
                                                 org.licas_xml.abs.Element adminXml,
                                                 java.lang.String adminKey)
                                          throws java.lang.Exception

      Add a default service to this service. The new service must be one of the known default services. This method will then automatically create a new instance of the correct class type and add it, but with the password and admin key specified in the constructor params list. The new service will therefore have unique passwords as well. Setting `canAccessNested` to false however, can block access from an external service to any nested service no matter what password is used.
      Parameters:
        `serviceUuid` - the uuid for the new default service to add. This is not used for a linking service, which is assigned the `ServiceConst`.`LINKER` uuid name.
        `serviceType` - the type of service to create.
        `params` - list of constructor parameters - should be password and admin key.
        `adminXml` - the admin info or description of the new service.
        `adminKey` - the admin key for this service.
      Returns:
        true if the service as added, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### addService

          public final boolean addService(java.lang.String thePassword,
                                          java.lang.String serviceName,
                                          java.lang.String serviceType,
                                          java.util.ArrayList<java.lang.String> jarFile,
                                          java.lang.String className,
                                          java.util.ArrayList<java.lang.Object> params)
                                   throws java.lang.Exception

      Load the service class and add as a service, but do not start its thread.
      Parameters:
        `thePassword` - the password to protect access to this component.
        `serviceName` - the name of the service.
        `serviceType` - the type of the service.
        `jarFile` - the jar files for a remote loading. Values are jar paths of type String.
        `className` - the name of the service class.
        `params` - a list of initialisation parameters.
      Returns:
        true if the service has been added, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### addService

          public final boolean addService(java.lang.String thePassword,
                                          java.lang.String serviceName,
                                          java.lang.String serviceType,
                                          java.util.ArrayList<java.lang.String> jarFile,
                                          java.lang.String className,
                                          boolean startService,
                                          java.util.ArrayList<java.lang.Object> params)
                                   throws java.lang.Exception

      Load the service class and add as a service. Start the thread if indicated.
      Parameters:
        `thePassword` - the password to protect access to this component.
        `serviceName` - the name of the service.
        `serviceType` - the type of the service.
        `jarFile` - the jar files for a remote loading. Values are jar paths of type String.
        `className` - the name of the service class.
        `startService` - true if start the service thread or false if do not.
        `params` - a list of initialisation parameters.
      Returns:
        true if the service has been added, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### addService

          public final boolean addService(java.lang.String thePassword,
                                          java.lang.String serviceName,
                                          java.lang.String serviceType,
                                          java.lang.Object theService)
                                   throws java.lang.Exception

      Add the service Object to this one. It can then be accessed directly if it extends the `Service` class. If it is a different object, then it can be accessed through the wrapper using Java Reflection. Do not start its thread.
      Parameters:
        `thePassword` - the password to protect access to this component.
        `serviceName` - the name of the service.
        `serviceType` - the type of the service.
        `theService` - the service to add.
      Returns:
        true if the service has been added, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### addService

          public final boolean addService(java.lang.String thePassword,
                                          java.lang.String serviceName,
                                          java.lang.String serviceType,
                                          java.util.ArrayList<java.lang.String> jarFile,
                                          java.lang.Object theService,
                                          boolean startService)
                                   throws ServiceException,
                                          java.lang.Exception

      Add the service Object to this one. It can then be accessed directly if it extends the `Service` class. If it is a different object, then it can be accessed through the wrapper using Java Reflection. Do not start its thread. Also, if it is a `Service`, then after it is added and initialised, its `finaliseInitialisation` method gets called from this method. Note services cannot be added to the `HttpServer`, apart from the `ESB` service that is added only once and with the name of `Const`.`HTTPSERVER`.
      Parameters:
        `thePassword` - the password to protect access to this component.
        `serviceName` - the name of the service.
        `serviceType` - the type of the service.
        `jarFile` - the jar files for a remote loading. Values are jar paths of type String.
        `theService` - the service to add.
        `startService` - true if start the service thread or false if do not.
      Returns:
        true if the service has been added, false otherwise.
      Throws:
        `ServiceException` - if the service should not be added.
        `java.lang.Exception` - any other error.

    - #### createServiceWrapper

          protected ServiceWrapperDef createServiceWrapper(java.lang.Object serviceObj,
                                                           java.lang.String serviceName,
                                                           java.lang.String serviceType,
                                                           java.util.ArrayList<java.lang.String> jarFiles,
                                                           org.licas_xml.abs.Element adminXml)
                                                    throws java.lang.Exception

      Create a service wrapper for storing the service object. This version returns a `ServiceWrapper` if the object is a licas `Service`, or a `ServiceWrapperLegacy` if the object is not a licas service. An autonomic manager is not added here, only at the ESB level.
      Parameters:
        `serviceObj` - the service object that is wrapped and managed.
        `serviceName` - the name of the service.
        `serviceType` - the type of the service.
        `jarFiles` - the jar files for a remote loading. Values are jar paths of type String.
        `adminXml` - the admin document describing the service wrapper.
      Returns:
        the correct service wrapper type.
      Throws:
        `java.lang.Exception` - any error.

    - #### classNameOK

          protected boolean classNameOK(java.lang.String className)

      Check that the class name path is not illegal.
      Parameters:
        `className` - full class name of service to load.
      Returns:
        true if safe path. Defaults to true here.

    - #### createMetaFull

          public ServiceMeta createMetaFull(java.util.ArrayList<java.lang.String> jarFile,
                                            java.lang.String theAdminKey)
                                     throws java.lang.Exception

      Create a full metadata description of this service. The description describes only this service and no nested services.
      Parameters:
        `jarFile` - list of remote jar files if loaded remotely.
        `theAdminKey` - the unique service key for admin purposes.
      Returns:
        a metadata description of this service.
      Throws:
        `java.lang.Exception` - any error.

    - #### createMetaForRepos

          public ServiceMeta createMetaForRepos(java.lang.String theAdminKey)
                                         throws java.lang.Exception

      Create a metadata description of this service for the server repository. Note that you can change this method in a derived class, to change the metadata that is stored in the server repository to represent this service. You can also dynamically update the contents. A Service also contains a metadata description in its admin objects, that might be changed separately. The description describes only this service and no nested services.
      Parameters:
        `theAdminKey` - the unique service key for admin purposes.
      Returns:
        a metadata description of this service.
      Throws:
        `java.lang.Exception` - any error.

    - #### getService

          public ServiceWrapperDef getService(java.lang.String serviceName,
                                              java.lang.String thePassword)
                                       throws ServiceException,
                                              java.lang.Exception

      Return the service or module for the related service name. This method returns a wrapper for the service with limited functionality. It should be used only to allow access to nested services on the called service or for invoking methods.
      Parameters:
        `serviceName` - the name of the service you want to retrieve.
        `thePassword` - the password for the service you want to retrieve.
      Returns:
        a wrapper containing the service that is retrieved.
      Throws:
        `ServiceException` - for service specific error.
        `java.lang.Exception` - any other error.

    - #### getServiceOrWrapper

          public FrameworkModule getServiceOrWrapper(java.lang.String serviceName,
                                                     java.lang.String thePassword,
                                                     java.lang.String adminKey)
                                              throws ServiceException,
                                                     java.lang.Exception

      Return the service, module or its wrapper for the related service name. This method requires the admin key as well, so that it can try to return a direct reference to the service object. If the service object is not derived from `Service`, then the wrapper is returned. If it is derived from Service, then a direct reference is returned.
      Parameters:
        `serviceName` - the name of the service you want to retrieve.
        `thePassword` - the password for the service you want to retrieve.
        `adminKey` - the admin key for the service you want to retrieve.
      Returns:
        the service object if it exists or null if it does not.
      Throws:
        `ServiceException` - for service specific error.
        `java.lang.Exception` - any other error.

    - #### getService

          public java.lang.Object getService(java.lang.String serviceName,
                                             java.lang.String thePassword,
                                             java.lang.String adminKey)
                                      throws ServiceException,
                                             java.lang.Exception

      Return the service or module for the related service name. This method requires the service admin key as well, but then returns a direct reference to the service object, no matter what the object type is.
      Parameters:
        `serviceName` - the name of the service you want to retrieve.
        `thePassword` - the password for the service you want to retrieve.
        `adminKey` - the admin key for the service you want to retrieve.
      Returns:
        the service object if it exists or null if it does not.
      Throws:
        `ServiceException` - for service specific error.
        `java.lang.Exception` - any other error.

    - #### clearServices

          public boolean clearServices(java.lang.String adminKey)
                                throws java.lang.Exception

      Clear all existing services and service modules.
      Parameters:
        `adminKey` - this service's admin key.
      Returns:
        true if services cleared.
      Throws:
        `java.lang.Exception` - any error.

    - #### clearServices

          public boolean clearServices(java.util.ArrayList<?> serviceIDs,
                                       java.lang.String adminKey)
                                throws java.lang.Exception

      Clear all existing services or service modules, with names on the list.
      Parameters:
        `serviceIDs` - list of IDs for services to remove. Should be String key or Element path.
        `adminKey` - this service's admin key.
      Returns:
        true if services cleared.
      Throws:
        `java.lang.Exception` - any error.

    - #### clearServiceLinks

          protected void clearServiceLinks(java.util.ArrayList<?> serviceIDs,
                                           java.lang.String adminKey)
                                    throws java.lang.Exception

      Clear the links for the named services.
      Parameters:
        `serviceIDs` - List of IDs for services to clear. Should be String key or Element path, `Null` for all services.
        `adminKey` - this service's admin key.
      Throws:
        `java.lang.Exception` - any error.

    - #### removeAllServices

          protected void removeAllServices(java.lang.String adminKey)
                                    throws PasswordException,
                                           java.lang.Exception

      Remove all child services and modules from this service and terminate their threads.
      Parameters:
        `adminKey` - this service's admin key.
      Throws:
        `PasswordException` - incorrect admin key.
        `java.lang.Exception` - any error.

    - #### removeAllServices

          public void removeAllServices(java.util.ArrayList<?> serviceIDs,
                                        java.lang.String adminKey)
                                 throws PasswordException,
                                        java.lang.Exception

      Remove all child services and modules on the service list from this service and terminate their threads.
      Parameters:
        `serviceIDs` - id list for service passwords to remove. Should be String key or Element path.
        `adminKey` - this service's admin key.
      Throws:
        `PasswordException` - incorrect admin key.
        `java.lang.Exception` - any error.

    - #### removeServiceID

          public boolean removeServiceID(java.lang.String serviceUuid,
                                         java.lang.String adminKey)
                                  throws java.lang.Exception

      Remove the service or module with the indicated ID from the list and terminate it.
      Parameters:
        `serviceUuid` - the uuid of the stored service to remove.
        `adminKey` - this service's admin key.
      Returns:
        true if the service has been removed.
      Throws:
        `java.lang.Exception` - any error.

    - #### removeServicePath

          public boolean removeServicePath(org.licas_xml.abs.Element servicePath,
                                           java.lang.String adminKey)
                                    throws java.lang.Exception

      Remove the service or module with the indicated path from the list and terminate it.
      Parameters:
        `servicePath` - the path to the service.
        `adminKey` - this service's admin key.
      Returns:
        true if the service has been removed.
      Throws:
        `java.lang.Exception` - any error.

    - #### removeServicePath

          public boolean removeServicePath(org.licas_xml.abs.Element servicePath,
                                           java.lang.String adminKey,
                                           boolean stopThread)
                                    throws java.lang.Exception

      Remove the service or module with the indicated path from the list.
      Parameters:
        `servicePath` - the path to the service.
        `adminKey` - this service's admin key.
        `stopThread` - true if stop the thread running.
      Returns:
        true if the service has been removed.
      Throws:
        `java.lang.Exception` - any error.

    - #### getServiceNames

          public java.util.ArrayList<java.lang.String> getServiceNames()

      Get all child service and module names.
      Returns:
        all service ids, of type String.

    - #### getServiceNames

          public java.util.ArrayList<java.lang.String> getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes)
                                                                throws LicasException

      Return all child or module service names for a list of service types.
      Parameters:
        `thisServiceTypes` - the service types list.
      Returns:
        the service names for the service types list.
      Throws:
        `LicasException` - if the service types input is `null`.

    - #### getServiceNames

          public java.util.ArrayList<java.lang.String> getServiceNames(java.util.ArrayList<java.lang.String> thisServiceTypes,
                                                                       boolean reciprocal)
                                                                throws LicasException

      Return all child or module service names for a list of service types.
      Parameters:
        `thisServiceTypes` - the service types list.
        `reciprocal` - is false return all service names of the service types, if true return all service names of all other types.
      Returns:
        the service names for the service types list.
      Throws:
        `LicasException` - if the service types input is `null`.

    - #### getServiceTypes

          public java.util.ArrayList<java.lang.String> getServiceTypes()

      Return all service types for all stored services and modules.
      Returns:
        all service types.

    - #### getServiceType

          public java.lang.String getServiceType(java.lang.String serviceName)

      Get the service type for the named child service if it exists.
      Parameters:
        `serviceName` - the name of the service to look for.
      Returns:
        the service type if it exists, or null otherwise.

    - #### getServiceNumber

          public int getServiceNumber(java.lang.String serviceType)
                               throws LicasException

      Return a count of how many services of the specified type are on this service.
      Parameters:
        `serviceType` - the service type. Can be `Const`.ALLSERVICES} for all services.
      Returns:
        the service names for the service types list.
      Throws:
        `LicasException` - if the service types input is `null`.

    - #### getPublicServiceClassname

          public java.lang.String getPublicServiceClassname(java.lang.String serviceType)

      Get the class type for a standard default service, known by the service factory or this service. This is assumed to be public information.
      Parameters:
        `serviceType` - the service type.
      Returns:
        the class name for the default service.

    - #### getServiceClasses

          public java.util.HashMap<java.lang.String,java.lang.String> getServiceClasses(java.lang.String theAdminKey)

      Get the class types for all services that are stored.
      Parameters:
        `theAdminKey` - the unique admin service key of this service.
      Returns:
        the service handles with the class types for the services of this component.

    - #### createPermanentLinkTo

          public boolean createPermanentLinkTo(java.lang.String adminKey,
                                               java.lang.String serviceTo,
                                               java.lang.String servicePassword,
                                               org.licas_xml.abs.Element serviceUri)
                                        throws LicasException,
                                               java.lang.Exception

      Create a permanent link from this service to another service. This method also calls the other service remotely to ask it to create a link to this service as well.
      Parameters:
        `adminKey` - the unique admin key of this service.
        `serviceTo` - the unique ID of the service to create a link to.
        `servicePassword` - the password to call the other service.
        `serviceUri` - the path to the other service.
      Returns:
        true if the link is successfully created.
      Throws:
        `LicasException` - if the link is to a remote service.
        `java.lang.Exception` - any error.

    - #### removePermanentLinkTo

          public boolean removePermanentLinkTo(java.lang.String adminKey,
                                               java.lang.String serviceTo,
                                               java.lang.String servicePassword,
                                               org.licas_xml.abs.Element serviceUri)
                                        throws java.lang.Exception

      Remove a permanent link from this service to another service. This method also calls the other service remotely to ask it to remove the same link from reference to this service.
      Parameters:
        `adminKey` - the unique admin key of this service.
        `serviceTo` - the unique ID of the service to remove a link to.
        `servicePassword` - the password to call the other service.
        `serviceUri` - the path to the other service.
      Returns:
        true if the link is successfully removed.
      Throws:
        `java.lang.Exception` - any error.

    - #### dynamicLinksToPermanent

          public void dynamicLinksToPermanent(java.lang.String adminKey)
                                       throws java.lang.Exception

      Convert any dynamic links to permanent ones, or remove any permanent links that do not now exist as dynamic ones. Before converting to a permanent link, this also checks that the link is between services running on the same server.
      Parameters:
        `adminKey` - the unique admin key of this service.
      Throws:
        `java.lang.Exception` - any error.

    - #### hasLinkTo

          public boolean hasLinkTo(java.lang.String serviceID)

      Return true if this service has a permanent local link (`PermanentLink` only) to the service with the specified service ID.
      Parameters:
        `serviceID` - the ID of the local service to check for a link with.
      Returns:
        true if a permanent link exists.

    - #### addLinkToService

          protected boolean addLinkToService(java.lang.String serviceID,
                                             java.lang.Object theReference)

      Add a link reference to another service locally in this service.
      Parameters:
        `serviceID` - a unique id to identify the service.
        `theReference` - the source reference (Object or XML URI).
      Returns:
        true if the link is added or false if the id already exists.

    - #### removeLinkToService

          protected void removeLinkToService(java.lang.String serviceID)

      Remove the local link to the specified service if it exists. This should not be called directly, but is called through the `removePermanentLinkTo` method.
      Parameters:
        `serviceID` - the id of the service being linked to.

    - #### getAllLinkToService

          protected java.util.ArrayList<java.lang.Object> getAllLinkToService()

      Get all source references for a links to another service.
      Returns:
        a list of all source references, or null if no links exist.

    - #### getLinkToService

          public java.lang.Object getLinkToService(java.lang.String serviceID)

      Get the source reference for a link to another service.
      Parameters:
        `serviceID` - the id of the service linked to.
      Returns:
        the value of source or null if no link exists.

    - #### addLinkFromService

          public boolean addLinkFromService(java.lang.String serviceID,
                                            java.lang.Object theReference)

      Add a link from another service locally in this service. This method should not be called directly, but is done through the `createPermanentLinkTo` method on the remote service creating the link.
      Parameters:
        `serviceID` - a unique id to identify the service.
        `theReference` - the source reference (Object or XML URI).
      Returns:
        true if the link is added or false if the id already exists.

    - #### removeLinkFromService

          public void removeLinkFromService(java.lang.String serviceID)

      Remove the local link from the specified service if it exists. This method should not be called directly, but is done through the `removePermanentLinkTo` method on the remote service removing the link.
      Parameters:
        `serviceID` - the id of the service being linked to.

    - #### getLinkFromService

          public java.lang.Object getLinkFromService(java.lang.String serviceID)

      Get the source reference for a link from another service.
      Parameters:
        `serviceID` - the id of the service linked to.
      Returns:
        the value of source or null if no link exists.

    - #### serviceToXml

          public org.licas_xml.abs.Element serviceToXml(java.lang.String adminKey)
                                                 throws java.lang.Exception

      Serialize the service using the `ServiceSerialize` class.
      Parameters:
        `adminKey` - the service admin key.
      Returns:
        an XML representation of all named elements, or null if the admin key is incorrect.
      Throws:
        `java.lang.Exception` - any error.

    - #### serviceToXml

          public org.licas_xml.abs.Element serviceToXml(java.lang.String adminKey,
                                                        java.util.ArrayList<java.lang.String> adminToRemove,
                                                        java.util.ArrayList<java.lang.String> toSerialize)
                                                 throws java.lang.Exception

      Serialize the service using the `ServiceSerialize` class.
      Parameters:
        `adminKey` - the service admin key.
        `adminToRemove` - if any section is indicated here through the XML tag name, it is removed first.
        `toSerialize` - list of service-local variable names to serialize.
      Returns:
        an XML representation of all named elements, or null if the admin key is incorrect.
      Throws:
        `java.lang.Exception` - any error.

    - #### xmlToService

          public static java.lang.Object xmlToService(org.licas_xml.abs.Element serviceXml,
                                                      java.lang.String password)
                                               throws java.lang.Exception

      Create the service from the description using the `ServiceSerialize` class.
      Parameters:
        `serviceXml` - a full XML description of the service.
        `password` - parent password, probably the server currently running. Need to use this instead of the stored value if a server.
      Returns:
        the re-created service, probably derived from `Service`, but it might be a wrapped object.
      Throws:
        `java.lang.Exception` - any error.

    - #### passwordsStateToXml

          public org.licas_xml.abs.Element passwordsStateToXml(java.lang.String adminKey)
                                                        throws java.lang.Exception

      Serialize the stored passwords list and the service state, and return as an XML-based description. This is used more internally, to save the whole server or SOA to a file. You can also use `PasswordHandler`.{code toXml} or {code fromXml} to serialize just the passwords.
      Parameters:
        `adminKey` - the service admin key.
      Returns:
        an XML representation of all passwords, or null if the admin key is incorrect.
      Throws:
        `java.lang.Exception` - any error.

    - #### dynamicLinkQuery

          public org.licas_xml.abs.Element dynamicLinkQuery(LinkQueryConfig queryConfig)
                                                     throws java.lang.Exception

      Perform a query over the link paths to return matching sources. Note that a linking service must be added first.
      Parameters:
        `queryConfig` - the query configuration.
      Returns:
        a list of source uris that match with the query.
      Throws:
        `java.lang.Exception` - any error.

    - #### linksToXml

          public org.licas_xml.abs.Element linksToXml(java.lang.String adminKey)
                                               throws java.lang.Exception

      Return all linked references in XML format.
      Parameters:
        `adminKey` - the service admin key.
      Returns:
        an XML representation of all linked source references.
      Throws:
        `java.lang.Exception` - any error.

    - #### permanentLinksToXml

          public org.licas_xml.abs.Element permanentLinksToXml()
                                                        throws java.lang.Exception

      Return all permanent linked-t0 services in XML format.
      Returns:
        an XML representation of all permanent links.
      Throws:
        `java.lang.Exception` - any error.

    - #### dynamicLinksToXml

          public org.licas_xml.abs.Element dynamicLinksToXml()
                                                      throws java.lang.Exception

      Return all linked sources in XML format. This returns a list of link URIs only. To retrieve all information, try the linking service `dynamicLinksToXml(adminKey)` or use `LinksParser` locally. Note that a linking service must be added first.
      Returns:
        an XML representation of all linked sources.
      Throws:
        `java.lang.Exception` - any error.

    - #### dynamicLinksToXml

          public org.licas_xml.abs.Element dynamicLinksToXml(java.lang.String adminKey)
                                                      throws java.lang.Exception

      Return all linked sources in XML format, including all link levels and the source weight values. Note that a linking service must be added first.
      Parameters:
        `adminKey` - the service admin key.
      Returns:
        an full XML representation of all linked sources, or null if the admin key is incorrect.
      Throws:
        `java.lang.Exception` - any error.

    - #### xmlToDynamicLinks

          public boolean xmlToDynamicLinks(org.licas_xml.abs.Element linksXml,
                                           java.lang.String adminKey)
                                    throws java.lang.Exception

      Parse the links descriptions and add to the service.
      Parameters:
        `linksXml` - a full set of links descriptions for the service.
        `adminKey` - the admin key.
      Returns:
        true if the links were parsed, false otherwise, for example, incorrect admin key.
      Throws:
        `java.lang.Exception` - any error.

    - #### addServiceAssociation

          public boolean addServiceAssociation(java.lang.String adminKey,
                                               org.licas_xml.abs.Element serviceUri,
                                               java.lang.String servicePassword)
                                        throws java.lang.Exception

      Add a new URI for a link to a (probably remote) service. This is simply an association link created from a single call. It is different to a permanent link in the sense that it probably does not make up any permanent network structure. It can act in the same way though. It is also different from a dynamic link which is built up over time through reinforcement. Including this link type simply covers the different types of service associations that you might want to make.
      Parameters:
        `adminKey` - the unique admin key of this service.
        `serviceUri` - the URI of the service to link to, as a Handle Element.
        `servicePassword` - the password for the service being linked to, so that it can be invoked.
      Returns:
        true if added or false if it already exists.
      Throws:
        `java.lang.Exception` - any other error.

    - #### removeServiceAssociation

          public void removeServiceAssociation(org.licas_xml.abs.Element serviceUri)
                                        throws java.lang.Exception

      Remove a URI for a link to a (probably remote) service.
      Parameters:
        `serviceUri` - the URI of the service to remove the link to, as a `Handle` Element.
      Throws:
        `java.lang.Exception` - any other error.

    - #### removeAllLinksTo

          public boolean removeAllLinksTo(java.lang.String serviceID,
                                          java.lang.String adminKey)
                                   throws java.lang.Exception

      Remove all non-dynamic links to the specified service from all other services.
      Parameters:
        `serviceID` - the id of the service to remove links to.
        `adminKey` - the admin key for the service to change.
      Returns:
        true if the admin key allows access, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### getCommunicationClientURI

          protected java.lang.Object getCommunicationClientURI(java.lang.String commID)

      Get the client URI stored in the message info for a communication ID.
      Parameters:
        `commID` - the communication ID.
      Returns:
        URI for the client in the conversation, or `null` if not exists.

    - #### addCommunicationID

          protected boolean addCommunicationID(java.lang.String commID,
                                               java.lang.Object clientURI)
                                        throws java.lang.Exception

      Store the commID with the related client URI, stored as `MessageInfo` objects with timestamps. The method now also checks the timestamps and removes any communicationIDs that are older than 3 days.
      Parameters:
        `commID` - the communication id.
        `clientURI` - the URI/reference for the calling client. If `null` or a server URI, then it is set to `Const`.`ANON` and only the commID is subsequently checked for.
      Returns:
        true if the id is new and can be added, or false if the comm id already exists, or cannot be added.
      Throws:
        `java.lang.Exception` - any error.

    - #### removeCommunicationID

          protected void removeCommunicationID(java.lang.String communicationID)

      Remove the communication ID reference.
      Parameters:
        `communicationID` - the communication ID.

    - #### syncToAsync

          public void syncToAsync(MethodInfo methodInfo)
                           throws java.lang.Exception

      This method can be invoked by a client that maybe does not have constant access to the server. You pass this method the full `MethodInfo` description of the method that you want to call on the service. This gets processed as normal and if allowed, the method is invoked, but the reply is then saved in a store instead of being returned. You therefore need to include a unique `communicationID` in the method info, to reference the stored object. After completion, you can call `messageRetrieve` to get and remove the method reply from the store.
      Parameters:
        `methodInfo` - full description of the method to invoke. So this is the parameter to the MethodInfo that is actually executed on the service. It is then passed through this service's execution process as normal.
      Throws:
        `java.lang.Exception` - any error.

    - #### syncToAsyncTransit

          public boolean syncToAsyncTransit(java.lang.String replyID)

      Return true if a reply id for a method invocation has been registered and the method execution is still on-going.
      Parameters:
        `replyID` - id for the method reply.
      Returns:
        true if the method for the id has not completed yet.

    - #### syncToAsyncReply

          public MessageInfo syncToAsyncReply(java.lang.String replyID)

      Retrieve a stored method reply.
      Parameters:
        `replyID` - id for the method reply. Similar to a comm id.
      Returns:
        the reply object, or null if one is not stored.

    - #### setIsRemoteCall

          public void setIsRemoteCall(boolean thisIsRemoteCall)

      Set the value indicating a remote call.
      Parameters:
        `thisIsRemoteCall` - true if current call is remote.

    - #### getIsRemoteCall

          public boolean getIsRemoteCall()

      Return a value indicating if current call is remote.
      Returns:
        the value of isRemoteCall.

    - #### execute

          public java.lang.Object execute(MethodInfo methodInfo,
                                          boolean addTempPassword)
                                   throws java.lang.Exception

      Execute the specified method and return the result.
      Parameters:
        `methodInfo` - the method call description with all of the required information.
        `addTempPassword` - if true add a temporary password to allow traversal through this service. If the service is referenced directly as an object then set this to false so that the caller must know this service's password.
      Returns:
        the reply, any object.
      Throws:
        `java.lang.Exception` - any error.

    - #### interrupt

          public boolean interrupt(java.lang.String adminKey)

      You must call this method to interrupt the thread. This also interrupts all nested services.
      Overrides:
        `interrupt` in class `ServiceModule`
      Parameters:
        `adminKey` - the key to identify unique loading of the service.
      Returns:
        true if the service is stopped.

    - #### getPasswordHandler

          protected PasswordHandler getPasswordHandler()

      Get the password handler.
      Overrides:
        `getPasswordHandler` in class `FrameworkModule`
      Returns:
        the value of passwordHandler.

    - #### setAdminInfo

          public void setAdminInfo(org.licas_xml.abs.Element adminXml,
                                   java.lang.String adminKey)
                            throws java.lang.Exception

      Set a full admin info description for the service.
      Parameters:
        `adminXml` - the full admin description.
        `adminKey` - the service key for this service.
      Throws:
        `java.lang.Exception` - any error.

    - #### setServiceGrade

          protected void setServiceGrade(java.lang.String thisServiceGrade)

      Set the service grade or function class.
      Parameters:
        `thisServiceGrade` - the service grade.

    - #### getServiceGrade

          public java.lang.String getServiceGrade()

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

    - #### setServiceState

          public void setServiceState(java.lang.String theServiceState,
                                      java.lang.String adminKey)

      This sets a value indicating the current service state.
      Parameters:
        `theServiceState` - the service state.
        `adminKey` - the admin key for this service..

    - #### getServiceState

          public java.lang.String getServiceState(java.lang.String adminKey)

      This method returns a value indicating the what current service state is. This default implementation returns `Const`.`READY` or 'Ready', meaning that it is ready for use. Any derived class can change this evaluation and set it to a value reflecting the current service state.
      Parameters:
        `adminKey` - the admin key for this service.
      Returns:
        the value of serviceState, or null if access is not allowed.

    - #### setDescription

          public boolean setDescription(org.licas_xml.abs.Element descriptionXml,
                                        java.lang.String adminKey)
                                 throws java.lang.Exception

      Set the service description value only.
      Parameters:
        `descriptionXml` - the description. This is only the service description and is not the full set of admin info values.
        `adminKey` - the service key for this service.
      Returns:
        true if access is allowed or false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### getDescription

          public 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.

    - #### setOtherMeta

          public boolean setOtherMeta(org.licas_xml.abs.Element otherMetaXml,
                                      java.lang.String adminKey)

      Set the additional metadata value.
      Parameters:
        `otherMetaXml` - the additional metadata not included as default.
        `adminKey` - the service key for this service.
      Returns:
        true if access is allowed or false otherwise.

    - #### setData

          public boolean setData(org.licas_xml.abs.Element dataXml,
                                 java.lang.String adminKey)
                          throws java.lang.Exception

      Set the value that this service will use as its data source. This method parses the data XML description to create the appropriate data `Resource` in the `DataModule`.
      Parameters:
        `dataXml` - the data description to parse.
        `adminKey` - the admin key for the service.
      Returns:
        true if set OK, false otherwise.
      Throws:
        `java.lang.Exception` - any error.

    - #### getData

          public java.lang.Object getData()
                                   throws java.lang.Exception

      Get the data value only, as a java object.
      Returns:
        the data value only, not wrapped in an XML element.
      Throws:
        `java.lang.Exception` - any error.

    - #### getData

          public java.lang.Object getData(org.licas_xml.abs.Element dataDescr)
                                   throws java.lang.Exception

      Get the data value only, not converted into XML, based on some condition.
      Parameters:
        `dataDescr` - a description of the data part that should be retrieved, but can be null and needs to be implemented in the resource.
      Returns:
        the data value only, not wrapped in an XML element.
      Throws:
        `java.lang.Exception` - any error.

    - #### setParent

          public boolean setParent(Service thisParent,
                                   java.lang.String adminKey)

      Set the parent component value. If the parent is the ESB server then it is not added, so only for child services.
      Parameters:
        `thisParent` - the parent component representation.
        `adminKey` - the admin key for this service.
      Returns:
        true if set, false if key incorrect, already set, or try to add server.

    - #### setParent

          protected boolean setParent(Service thisParent)

      Set the parent component value. If the parent is the ESB server then it is not added, so only for child services.
      Parameters:
        `thisParent` - the parent component representation.
      Returns:
        true if set, false if already set, or try to add server.

    - #### getParent

          public Service getParent(java.lang.String adminKey)

      Get the parent component representation.
      Parameters:
        `adminKey` - the admin key to access this information.
      Returns:
        the value of parent.

    - #### getParent

          protected Service getParent()

      Get the parent component representation.
      Returns:
        the value of parent.

    - #### getLocalRemoteID

          protected java.lang.String getLocalRemoteID(org.licas_xml.abs.Element serviceUri)
                                               throws java.lang.Exception

      If the Handle-style URI is for a local service running on the same server, then just return its ID, otherwise convert the whole URI to a string.
      Parameters:
        `serviceUri` - the full service URI path.
      Returns:
        the service ID (local) or full path (remote).
      Throws:
        `java.lang.Exception` - any error.

    - #### handshake

          public boolean handshake(org.licas_xml.abs.Element serverURI,
                                   java.lang.String serverPassword,
                                   java.lang.String serviceID,
                                   java.lang.String servicePassword)

      Checks if the calling client exists and can connect with it. Performs some of the default operations.
      Parameters:
        `serverURI` - uri of remote server to contact.
        `serverPassword` - server password.
        `serviceID` - uuid of service running on the server.
        `servicePassword` - service password.
      Returns:
        true if service can be contacted, false otherwise.

    - #### reflectionMethods

          public 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.

    - #### reflectionObject

          protected java.lang.Object reflectionObject(java.lang.reflect.Method method)

      Get which object in the service is able to execute the method.
      Parameters:
        `method` - reflection description of the method.
      Returns:
        this object or an inherited module that can execute the method, or null if false.

    - #### getPublicMethods

          public java.util.ArrayList<java.lang.String> getPublicMethods()

      Get the list of methods that can be freely called on a Service in general, without even requiring a password.
      Returns:
        the list of safe method names, but might still require passwords.

    - #### getPrivateMethods

          protected java.util.ArrayList<java.lang.String> getPrivateMethods()

      Get the list of public-level methods that should not be invoked externally, maybe from an interface.
      Returns:
        the list of public-level method names that should not be accessible externally.

    - #### defaultAdminToRemove

          public static java.util.ArrayList<java.lang.String> defaultAdminToRemove()

      Create and return a list of admin info that should probably not be returned to a user for display purposes.
      Returns:
        a list of admin info element types not to return.

    - #### close

          public void close()

      Clean-up before shutting down the service.
      Specified by:
        `close` in interface `java.lang.AutoCloseable`