Class ModelUtilInternal


  • public class ModelUtilInternal
    extends java.lang.Object
    Client model utility methods which are not in the public API.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static com.comsol.model.util.impl.IMphServerConnectionProvider serverConnectionProvider
      Server connection provider.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ModelUtilInternal()
      Static class not intended to be instantiated.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void cancelRunnable()
      Cancels the currently running command, if possible.
      static com.comsol.model.util.impl.IMphServerConnectionInternal connect()
      Connects to a server.
      static com.comsol.model.util.impl.IMphServerConnectionInternal connect​(java.lang.String host, int port)
      Connects to a server using the specified host and port.
      static com.comsol.model.util.impl.IMphServerConnectionInternal connect​(java.lang.String host, int port, boolean encryption)
      Connects to a server using the specified host, port, and encryption.
      static com.comsol.model.util.impl.IMphServerConnectionInternal connect​(java.lang.String host, int port, boolean encryption, java.lang.String user, java.lang.String passWord)
      Connects to a server using the specified host, port, encryption, user, and password.
      static com.comsol.model.util.impl.IMphServerConnectionInternal connect​(java.lang.String host, int port, java.lang.String user, java.lang.String passWord)
      Connects to a server using the specified host, port, user, and password.
      static java.lang.Boolean getConnectedEncryption()
      Returns whether the currently connected server uses a secure connection or not, or null if not connected.
      static java.lang.String getConnectedHost()
      Returns the host of the currently connected server, or null if not connected.
      static java.lang.Integer getConnectedPort()
      Returns the port of the currently connected server, or null if not connected.
      private static com.comsol.model.util.impl.IMphServerConnectionProvider getConnectionProvider()
      Returns the provider of server connections.
      static boolean isApplicationServer()
      Returns true if running in an application server.
      static boolean isGraphicsServer()
      Returns true if running in a graphics server.
      static java.lang.String[] path()
      Returns the search path.
      static void path​(java.lang.String[] path)
      Sets the search path.
      static void setCosimCallbackHandler​(CosimCallbackHandler cosimCallbackHandler)
      Register a handler for cosimulation callbacks, or null to unregister.
      static void setMethodExecImpl​(com.comsol.model.util.impl.IModelUtilImpl modelUtilImpl)  
      static void stopRunnable​(int stopLevel)
      Stops the currently running command at the given stop level, if possible.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • serverConnectionProvider

        private static com.comsol.model.util.impl.IMphServerConnectionProvider serverConnectionProvider
        Server connection provider.
    • Constructor Detail

      • ModelUtilInternal

        private ModelUtilInternal()
        Static class not intended to be instantiated.
    • Method Detail

      • getConnectionProvider

        private static com.comsol.model.util.impl.IMphServerConnectionProvider getConnectionProvider()
        Returns the provider of server connections.
      • connect

        public static com.comsol.model.util.impl.IMphServerConnectionInternal connect()
        Connects to a server.
      • connect

        public static com.comsol.model.util.impl.IMphServerConnectionInternal connect​(java.lang.String host,
                                                                                      int port)
        Connects to a server using the specified host and port.
      • connect

        public static com.comsol.model.util.impl.IMphServerConnectionInternal connect​(java.lang.String host,
                                                                                      int port,
                                                                                      boolean encryption)
        Connects to a server using the specified host, port, and encryption.
      • connect

        public static com.comsol.model.util.impl.IMphServerConnectionInternal connect​(java.lang.String host,
                                                                                      int port,
                                                                                      java.lang.String user,
                                                                                      java.lang.String passWord)
        Connects to a server using the specified host, port, user, and password.
      • connect

        public static com.comsol.model.util.impl.IMphServerConnectionInternal connect​(java.lang.String host,
                                                                                      int port,
                                                                                      boolean encryption,
                                                                                      java.lang.String user,
                                                                                      java.lang.String passWord)
        Connects to a server using the specified host, port, encryption, user, and password.
      • path

        public static java.lang.String[] path()
        Returns the search path. Note: This function is called from the test framework for model .m-tests.
        Returns:
        Directories to search, ordered from first to last.
      • path

        public static void path​(java.lang.String[] path)
        Sets the search path. Note: This function is called from the test framework for model .m-tests.
        Parameters:
        path - Directories to search, ordered from first to last.
      • getConnectedHost

        public static java.lang.String getConnectedHost()
        Returns the host of the currently connected server, or null if not connected.
        Returns:
        The connected server host computer, or null if not connected.
      • getConnectedPort

        public static java.lang.Integer getConnectedPort()
        Returns the port of the currently connected server, or null if not connected.
        Returns:
        The connected port, or null if not connected.
      • getConnectedEncryption

        public static java.lang.Boolean getConnectedEncryption()
        Returns whether the currently connected server uses a secure connection or not, or null if not connected.
        Returns:
        Boolean.TRUE if the current connection is secure, Boolean.FALSE if it's not secure, or null if not connected.
      • isGraphicsServer

        public static boolean isGraphicsServer()
        Returns true if running in a graphics server.
      • isApplicationServer

        public static boolean isApplicationServer()
        Returns true if running in an application server.
      • setCosimCallbackHandler

        public static void setCosimCallbackHandler​(CosimCallbackHandler cosimCallbackHandler)
        Register a handler for cosimulation callbacks, or null to unregister.
        Parameters:
        cosimCallbackHandler - The handler for cosimulation callbacks.
      • cancelRunnable

        public static void cancelRunnable()
        Cancels the currently running command, if possible.
      • stopRunnable

        public static void stopRunnable​(int stopLevel)
        Stops the currently running command at the given stop level, if possible.
      • setMethodExecImpl

        public static void setMethodExecImpl​(com.comsol.model.util.impl.IModelUtilImpl modelUtilImpl)