com.telelogic.rhapsody.core
Class RhapsodyAppServer

java.lang.Object
  extended by com.telelogic.rhapsody.core.RhapsodyAppServer

public class RhapsodyAppServer
extends java.lang.Object

The RhapsodyAppServer class contains methods relating to accessing an instance of Rhapsody.


Field Summary
protected static com.telelogic.rhapsody.core.JavaPluginsManager m_javaPluginsManager
          For internal use only.
 
Constructor Summary
RhapsodyAppServer()
           
 
Method Summary
static IRPApplication actualCreateRhapsodyApplicationDllServer()
          For internal use only.
static IRPApplication actualCreateUninitializedRhapsodyApplicationDllServer()
          For internal use only.
static void actualInitializeRhapsodyApplicationDllServer(long comInterface)
          For internal use only.
static boolean addToClassPath(java.lang.String cls)
          Adds one or more classes to the classpath.
static boolean addToLibPath(java.lang.String libPath)
          Adds a directory to the libpath.
static IRPModelElement attachToIRPModelElement(long nativeRPModelElement)
          For internal use only.
static IRPApplication attachToRhapsodyApplication(long nativeRhapsodyApp)
          For internal use only.
static void CloseSession()
          For internal use only.
static void CloseSessionNative()
          For internal use only.
protected static void createJavaPluginManager(IRPApplication rhpApp)
          For internal use only.
static IRPApplication createRhapsodyApplication()
          Creates a new instance of Rhapsody and provides access to it.
static IRPApplication createRhapsodyApplicationDllServer()
          For internal use only.
static IRPApplication createUninitializedRhapsodyApplicationDllServer()
          For internal use only.
static java.lang.Class findClass(java.lang.String className)
          For internal use only.
static IRPApplication getActiveRhapsodyApplication()
          Accesses the currently running instance of Rhapsody.
static IRPApplication getActiveRhapsodyApplicationByID(java.lang.String serverName)
          Accesses the instance of Rhapsody that is registered in the ROT (Running Object Table) with the specified ID.
static java.util.List getActiveRhapsodyApplicationIDList()
          Returns a list of the strings representing the Rhapsody instances currently registered in the ROT (Running Object Table).
static com.telelogic.rhapsody.core.JavaPluginsManager getJavaPluginManager()
          For internal use only.
static void initializeRhapsodyApplicationDllServer(IRPApplication rhpApp)
          For internal use only.
static boolean registerAsActiveObject(IRPApplication app)
          For internal use only.
static void resetCurrentContextClassFactory()
          For internal use only.
protected static void setClassFactory(RPExtendedRPClassesFactory factory, boolean isDefaultFactory)
          For internal use only.
static void setCollectionCachingMode(boolean mode)
          For internal use only.
static void setCollectionCashingMode(boolean mode)
          For internal use only.
static void setCurrentContextClassFactory(RPExtendedRPClassesFactory factory)
          For internal use only.
static void setDefultClassFactory(RPExtendedRPClassesFactory factory)
          For internal use only.
static void setDelayedReleaseInterfacesMode(boolean mode)
          For internal use only.
static void setLogFile(java.lang.String logFile)
          Specifies a log file to use for recording API actions.
static void setReleaseInterfacesOnGBMode(boolean mode)
          For internal use only.
static boolean unRegisterAsActiveObject(IRPApplication app)
          For internal use only.
static void writeToLog(java.lang.String msg)
          Writes the specified text to the Rhapsody API log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_javaPluginsManager

protected static com.telelogic.rhapsody.core.JavaPluginsManager m_javaPluginsManager
For internal use only.

Constructor Detail

RhapsodyAppServer

public RhapsodyAppServer()
Method Detail

addToClassPath

public static boolean addToClassPath(java.lang.String cls)
Adds one or more classes to the classpath.

Parameters:
cls - the path and name of the class or .jar file to add to the classpath, for example, "D:\\myclasses org.mypackage.MyClass" or "D:\\myclasses\\libraryFiles.jar"
Returns:
true if the classpath was modified successfully, false otherwise

addToLibPath

public static boolean addToLibPath(java.lang.String libPath)
Adds a directory to the libpath.

Parameters:
libPath - the directory to add to the libpath
Returns:
true if the libpath was modified successfully, false otherwise

attachToIRPModelElement

public static IRPModelElement attachToIRPModelElement(long nativeRPModelElement)
For internal use only.


attachToRhapsodyApplication

public static IRPApplication attachToRhapsodyApplication(long nativeRhapsodyApp)
For internal use only.


CloseSession

public static void CloseSession()
For internal use only.


CloseSessionNative

public static void CloseSessionNative()
For internal use only.


createRhapsodyApplication

public static IRPApplication createRhapsodyApplication()
Creates a new instance of Rhapsody and provides access to it. If you start Rhapsody with this method, you can display the GUI by calling IRPApplication.bringWindowToTop. You can terminate Rhapsody by calling IRPApplication.quit.

Returns:
the IRPApplication object that represents the new instance of Rhapsody

createRhapsodyApplicationDllServer

public static IRPApplication createRhapsodyApplicationDllServer()
For internal use only.


actualCreateRhapsodyApplicationDllServer

public static IRPApplication actualCreateRhapsodyApplicationDllServer()
For internal use only.


createUninitializedRhapsodyApplicationDllServer

public static IRPApplication createUninitializedRhapsodyApplicationDllServer()
For internal use only. returns an interface to **uninitialized** application


actualCreateUninitializedRhapsodyApplicationDllServer

public static IRPApplication actualCreateUninitializedRhapsodyApplicationDllServer()
For internal use only.


initializeRhapsodyApplicationDllServer

public static void initializeRhapsodyApplicationDllServer(IRPApplication rhpApp)
For internal use only. initializations for an uninitialized application


actualInitializeRhapsodyApplicationDllServer

public static void actualInitializeRhapsodyApplicationDllServer(long comInterface)
For internal use only.


findClass

public static java.lang.Class findClass(java.lang.String className)
For internal use only.


getActiveRhapsodyApplication

public static IRPApplication getActiveRhapsodyApplication()
Accesses the currently running instance of Rhapsody.

Returns:
the IRPApplication object that represents the instance of Rhapsody that is running
 static IRPApplication app = RhapsodyAppServer.getActiveRhapsodyApplication();
 if(app != null) {
    app.createNewProject("d:\\temp\\_sample_code", "Class_Tricks");
    IRPProject prj = app.openProject("d:\\temp\\_sample_code\\Class_Tricks.rpy");
 }
 
 

getActiveRhapsodyApplicationIDList

public static java.util.List getActiveRhapsodyApplicationIDList()
Returns a list of the strings representing the Rhapsody instances currently registered in the ROT (Running Object Table). This method can be used in conjunction with the method getActiveRhapsodyApplicationByID in order to communicate with a specific instance of Rhapsody when there is more than one instance running.

Returns:
a list of the strings representing the Rhapsody instances currently registered in the ROT

getActiveRhapsodyApplicationByID

public static IRPApplication getActiveRhapsodyApplicationByID(java.lang.String serverName)
Accesses the instance of Rhapsody that is registered in the ROT (Running Object Table) with the specified ID.

Parameters:
serverName - the ID of the Rhapsody instance in the ROT, as returned by the method getActiveRhapsodyApplicationIDList. The strings used for instances of Rhapsody take the form Rhapsody.Release:PID, for example, "Rhapsody.8.0.2.0:12236"
Returns:
the IRPApplication object that represents the specified instance of Rhapsody

resetCurrentContextClassFactory

public static void resetCurrentContextClassFactory()
For internal use only.


setClassFactory

protected static void setClassFactory(RPExtendedRPClassesFactory factory,
                                      boolean isDefaultFactory)
For internal use only.


setCollectionCachingMode

public static void setCollectionCachingMode(boolean mode)
For internal use only.


setCollectionCashingMode

public static void setCollectionCashingMode(boolean mode)
For internal use only.


setCurrentContextClassFactory

public static void setCurrentContextClassFactory(RPExtendedRPClassesFactory factory)
For internal use only.


setDefultClassFactory

public static void setDefultClassFactory(RPExtendedRPClassesFactory factory)
For internal use only.


setDelayedReleaseInterfacesMode

public static void setDelayedReleaseInterfacesMode(boolean mode)
For internal use only.


setLogFile

public static void setLogFile(java.lang.String logFile)
Specifies a log file to use for recording API actions. You can write text to the log file using the writeToLog method. Note that if you use this method to specify a log file, that log file will be used even if your rhapsody.ini file specifies a different file with the JavaAPILogFile variable. You can stop logging by calling setLogFile with null as the parameter.

Parameters:
logFile - the full path of the file to use as the log file, for example, "D:\\temp\\api_log_file.txt".

writeToLog

public static void writeToLog(java.lang.String msg)
Writes the specified text to the Rhapsody API log file. Note that this will work only if you first call the method RhapsodyAppServer.setLogFile. It will not write to a log file that was specified using the JavaAPILogFile variable in the rhapsody.ini file.

Parameters:
msg - the text to write to the log file

setReleaseInterfacesOnGBMode

public static void setReleaseInterfacesOnGBMode(boolean mode)
For internal use only.


createJavaPluginManager

protected static void createJavaPluginManager(IRPApplication rhpApp)
For internal use only.


registerAsActiveObject

public static boolean registerAsActiveObject(IRPApplication app)
For internal use only.


unRegisterAsActiveObject

public static boolean unRegisterAsActiveObject(IRPApplication app)
For internal use only.


getJavaPluginManager

public static com.telelogic.rhapsody.core.JavaPluginsManager getJavaPluginManager()
For internal use only.