Class SystemProperties

  • All Implemented Interfaces:
    ISystemProperties

    public class SystemProperties
    extends Object
    implements ISystemProperties
    This is the adapter class for amserver to the shared library. Mainly to provide system configuration information.
    • Constructor Detail

      • SystemProperties

        public SystemProperties()
        Creates a new instance of SystemProperties
    • Method Detail

      • get

        public String get​(String key)
        Returns system properties.
        Specified by:
        get in interface ISystemProperties
        Parameters:
        key - Key to the properties.
      • getOrDefault

        public String getOrDefault​(String key,
                                   String defaultValue)
        Description copied from interface: ISystemProperties
        Returns system property or the default value if not set.
        Specified by:
        getOrDefault in interface ISystemProperties
        Parameters:
        key - the system property to retrieve.
        defaultValue - the default value if the property is not set.
        Returns:
        the property value or the default.
      • getServiceURL

        public URL getServiceURL​(String serviceName,
                                 String protocol,
                                 String hostname,
                                 int port,
                                 String uri)
                          throws Exception
        Returns the URL of the specified service on the specified host.
        Specified by:
        getServiceURL in interface ISystemProperties
        Parameters:
        serviceName - The name of the service.
        protocol - The service protocol.
        hostname - The service host name.
        port - The service listening port.
        uri - The service deployment URI.
        Returns:
        The URL of the specified service on the specified host.
        Throws:
        Exception - if the URL could not be found.
      • initializeProperties

        public void initializeProperties​(String propertyName,
                                         String propertyValue)
        Initializes the properties map.
        Specified by:
        initializeProperties in interface ISystemProperties
        Parameters:
        propertyName - Name of properties.
        propertyValue - Value of properties.