Class MWSLibrary

java.lang.Object
com.webmethods.sc.mws.MWSLibrary

public class MWSLibrary extends Object
MWSLibrary class is used to intialize and shutdown IBM My webMethods Server shared component.

MWSLibrary is initialized by calling into init() method. If API has been already initialized this call does nothing. Before initializing the client must set some configuration system properties:

MWS Database configuration. IBM My webMethods Server component needs to access MWS database where all necessary configuration is stored. There are two ways to configure this connectivity:

  • Shared MWS Configuration

    This relies on the fact that Shared MWS library component is used by the WM application which is installed in the same place where local MWS server is installed (for example when installing full set of WM products). If that is the case then container app must set SYSTEM_PROP_MWS_INSTALL_DIR property to point to the the installation folder for WM products, if MWS is present there it will read database connectivity configuration directly from MWS

  • Shared JDBC Pool

    This requires container to configure shared JDBC Pool and set configuration property SYSTEM_PROP_JDBC_POOL_ALIAS the name of the alias set for this JDBC pool. Then MWSLibrary obtain connections from this pool instead of creating and managing its own internal pool

  • JDBC Pool connection parameters

    Another way to configure MWS database connectivity is to supply database driver/url/credentials using following properties: SYSTEM_PROP_DB_DRIVER, #SYSTEM_MWS_DB_URL, #SYSTEM_MWS_DB_USER, #SYSTEM_MWS_DB_PASSWORD

Any audit logging done by directory component is done to #LOG_CATEGORY_NAME Log4J category logger. It is up to container using this API to provide logging configuration for this category

  • Field Details

    • SYSTEM_PROP_MWS_INSTALL_DIR

      public static final String SYSTEM_PROP_MWS_INSTALL_DIR
      System property which value identifies root path to installed WM products, e.g. c:\webMethods. This is used to read MWS database configuration and requires a local configured MWS instance. Either this property of DB_URL property should be specified
      See Also:
    • SYSTEM_PROP_JDBC_POOL_ALIAS

      public static final String SYSTEM_PROP_JDBC_POOL_ALIAS
      System property which identifies the name of JDBC pool alias which should be used to connect to MWS database
      See Also:
    • SYSTEM_PROP_DB_URL

      public static final String SYSTEM_PROP_DB_URL
      System property which identifies connection url. Either this property or SYSTEM_PROP_MWS_INSTALL_DIR property should be specified
      See Also:
    • SYSTEM_PROP_DB_DRIVER

      public static final String SYSTEM_PROP_DB_DRIVER
      System property which identifies database driver.
      See Also:
    • SYSTEM_PROP_DB_USER

      public static final String SYSTEM_PROP_DB_USER
      System property which identifies database connection user.
      See Also:
    • SYSTEM_PROP_DB_PASSWORD

      public static final String SYSTEM_PROP_DB_PASSWORD
      System property which identifies database connection password. Once MWSLibrary is initialized password value is not required in the System properties anymore
      See Also:
    • SYSTEM_PROP_MIN_CONNECTIONS

      @Deprecated public static final String SYSTEM_PROP_MIN_CONNECTIONS
      Deprecated.
      No longer used for 10.1 or later
      System property which identifies the minimum number of established connections that should be kept in the pool at all times.
      See Also:
    • SYSTEM_PROP_MIN_CONNECTIONS_DEFAULT

      @Deprecated public static final int SYSTEM_PROP_MIN_CONNECTIONS_DEFAULT
      Deprecated.
      No longer used for 10.1 or later
      The default value for the minimum number of established connections that should be kept in the pool at all times.
      See Also:
    • SYSTEM_PROP_MAX_CONNECTIONS

      @Deprecated public static final String SYSTEM_PROP_MAX_CONNECTIONS
      Deprecated.
      No longer used for 10.1 or later
      System property which identifies the maximum number of established connections that should be kept in the pool at all times.
      See Also:
    • SYSTEM_PROP_MAX_CONNECTIONS_DEFAULT

      @Deprecated public static final int SYSTEM_PROP_MAX_CONNECTIONS_DEFAULT
      Deprecated.
      No longer used for 10.1 or later
      The default value for the maximum number of established connections that should be kept in the pool at all times.
      See Also:
    • SYSTEM_PROP_IDLE_TIMEOUT

      @Deprecated public static final String SYSTEM_PROP_IDLE_TIMEOUT
      Deprecated.
      No longer used for 10.1 or later
      System property which identifies the minimum amount of time in milliseconds an object may sit idle in the pool before it is eligible for evication.
      See Also:
    • SYSTEM_PROP_IDLE_TIMEOUT_DEFAULT

      @Deprecated public static final int SYSTEM_PROP_IDLE_TIMEOUT_DEFAULT
      Deprecated.
      No longer used for 10.1 or later
      The default value for the minimum amount of time in milliseconds an object may sit idle in the pool before it is eligible for evication.
      See Also:
    • SYSTEM_PROP_CLEANUP_PERIOD

      @Deprecated public static final String SYSTEM_PROP_CLEANUP_PERIOD
      Deprecated.
      No longer used for 10.1 or later
      System property which identifies the amount of time in milliseconds to sleep between runs of the idle connection validation/cleaner thread.
      See Also:
    • SYSTEM_PROP_CLEANUP_PERIOD_DEFAULT

      @Deprecated public static final int SYSTEM_PROP_CLEANUP_PERIOD_DEFAULT
      Deprecated.
      No longer used for 10.1 or later
      The default value for the amount of time in milliseconds to sleep between runs of the idle connection validation/cleaner thread.
      See Also:
    • SYSTEM_PROP_MAX_WAITTIME

      @Deprecated public static final String SYSTEM_PROP_MAX_WAITTIME
      Deprecated.
      No longer used for 10.1 or later
      System property which identifies the amount of time in milliseconds to sleep between runs of the idle connection validation/cleaner thread.
      See Also:
    • SYSTEM_PROP_MAX_WAITTIME_DEFAULT

      @Deprecated public static final int SYSTEM_PROP_MAX_WAITTIME_DEFAULT
      Deprecated.
      No longer used for 10.1 or later
      The default value for the amount of time in milliseconds to sleep between runs of the idle connection validation/cleaner thread.
      See Also:
    • SYSTEM_PROP_CDS_JOURNAL_LOGGER

      @Deprecated public static final String SYSTEM_PROP_CDS_JOURNAL_LOGGER
      Deprecated.
      No longer used for 10.1 or later
      System property which identifies the fully qualified class name for WmJournalLogger used by CDS. If not present, MWSLibrary will try to load the DEFAULT_CDS_JOURNAL_LOGGER
      See Also:
    • SYSTEM_PROP_CDS_LOG_PROPERTIES_FILE

      @Deprecated public static final String SYSTEM_PROP_CDS_LOG_PROPERTIES_FILE
      Deprecated.
      No longer used for 10.1 or later
      System property which identifies the location of external log4j properties file for configuring the CDS logger
      See Also:
  • Method Details

    • init

      public static void init() throws Exception
      Initializes MWSLibrary. It establishes connection to configured and initialized MWS database and load all required configuration data
      Throws:
      Exception - if there was an exception during MWSLibrary initialization
    • shutdown

      public static void shutdown()
      Shuts down previously initialized MWSLibrary. It cleans all cached resources and disconnects from MWS database
    • isInitialized

      public static boolean isInitialized()
      Returns true if MWSLibrary is already initialized
    • createSAXParser

      protected static SAXParser createSAXParser(boolean namespaceAware) throws ParserConfigurationException, SAXException
      Throws:
      ParserConfigurationException
      SAXException