com.borland.jbuilder.enterprise.ejb
Class AppServer

java.lang.Object
  |
  +--com.borland.jbuilder.paths.PathSet
        |
        +--com.borland.jbuilder.enterprise.ejb.AppServer

public abstract class AppServer
extends PathSet

This class should be extended to refer to an application server that will be used in JBuilder. All such implementations will be loaded at open-tools reading time, and will be available from the Enterprise tab of the Project Properties dialog. If the project gets saved, application server values get saved in a appserver.properties file, and will include any changes the user made to the default settings (i.e. VM parameters). The next time the project is opened, the application server property values will be loaded from the appserver.properties file.


Fields inherited from class com.borland.jbuilder.paths.PathSet
collection, EMPTY_ARRAY, hasChanged, lastFullUpdate, lastModified, requiredNames
 
Constructor Summary
AppServer()
           
AppServer(java.lang.String name)
           
 
Method Summary
abstract  java.lang.String customizeParameters(java.lang.String currentParameters, java.util.ArrayList ejbJarFiles, Project project, java.util.Map propertyMap)
          This routine is called before the appServer parameters are used, just in case some special parameters need to be added that include the ejb jar files (i.e.
abstract  java.lang.String customizeVmParameters(java.lang.String currentVmParameters, java.util.ArrayList ejbJarFiles, Project project, java.util.Map propertyMap)
          This routine is called before the vm parameters are used, just in case some special parameters need to be added that include the ejb jar files (i.e.
 void deploy(java.lang.String[] ejbJars)
          Runs whatever tool is appropriate for this application server to deploy the argument jar files.
 java.lang.String getClassName()
           
abstract  java.lang.String getDefaultClassName()
           
abstract  Url[] getDefaultClassPath()
          This function returns the array of default directories/.jars that are necessary to run this appserver.
abstract  Url getDefaultHomeDirectory()
          This function returns the default home directory for this appserver
abstract  java.lang.String getDefaultName()
           
abstract  java.lang.String getDefaultNecessaryParameters()
          These parameters are ones without which the app server will not run.
abstract  java.lang.String getDefaultNecessaryVmParameters()
          These VM parameters are ones without which the app server will not run.
abstract  java.lang.String getDefaultParameters()
           
abstract  java.lang.String getDefaultServerName()
          Returns a name that is used to uniquely identify the current instance of the application server.
abstract  java.lang.String getDefaultVersion()
           
abstract  java.lang.String getDefaultVmParameters()
           
 EjbDeployer getEjbDeployer()
           
protected  java.lang.String getFileNameBasedOnProtocol(java.lang.String protocol, java.lang.String name)
           
 java.lang.String getFullClassPathString()
           
 java.lang.String getFullName()
           
 Url getHomeDirectory()
           
static java.lang.String getNameFromFullName(java.lang.String fullName)
          This function retrieves just the name part of the full name.
 java.lang.String getNecessaryParameters()
           
 java.lang.String getNecessaryVmParameters()
           
 java.lang.String getNewParametersBasedOnNewHomeDirectory(java.lang.String newHomeDirectory)
           
 Url[] getNewPathsBasedOnNewHomeDirectory(java.lang.String newHomeDirectory)
          Returns a Url[] paths list based on the newHomeDirectory.
 java.lang.String getNewVmParametersBasedOnNewHomeDirectory(java.lang.String newHomeDirectory)
           
 java.lang.String getParameters()
           
static AppServerTargeting getRegisteredTargeting(java.lang.String name, java.lang.String version)
          Returns the last registered AppServerTargeting for the given name or a default implementation if none found.
 AppServerTargeting getTargeting()
          Returns the targeting interface class.
 Url[] getUniqueRunDebugClassPath(Url[] checkClassPath)
           
 java.lang.String getVersion()
           
 java.lang.String getVmParameters()
           
 boolean hasEjbDeployer()
           
 boolean isDefault()
           
abstract  boolean isSetup()
          This function is useful if the app server has a setup defined that needs to be run before this app server can actually be used.
abstract  java.lang.String isValidSetupDirectory(java.lang.String setupDirectory)
          This function is useful if the app server has a setup defined that needs to be run before this AppServer can actually be used.
static java.lang.String makeFullName(java.lang.String name, java.lang.String version)
          This function defines a mechanism for getting the full name of an appServer.
static void registerTargeting(java.lang.String name, java.lang.String version, AppServerTargeting targeting)
          OpenTools registration for an interface used to provide customization and verify of deployment descriptors.
 void restoreFrom(AppServer appServer)
           
 void setClassName(java.lang.String className)
          Sets the className for this AppServer
 void setEjbDeployer(EjbDeployer ejbDeployer)
           
 void setHomeDirectory(Url homeDirectory)
          Sets the home directory for this AppServer.
 void setName(java.lang.String name)
          Changes this PathSet's name.
 void setNecessaryParameters(java.lang.String necessaryParameters)
          Sets parameters without which this AppServer cannot be run.
 void setNecessaryVmParameters(java.lang.String necessaryVmParameters)
          Sets VM parameters without which this AppServer cannot be run.
 void setParameters(java.lang.String parameters)
          Sets the parameters with which this AppServer should be run.
 void setVersion(java.lang.String version)
          Sets the version for this AppServer
 void setVmParameters(java.lang.String vmParameters)
          Sets the VM parameters used to run this AppServer.
abstract  boolean shutdown(Project project, java.util.Map propertyMap, RunJavaProcessTracker tracker)
          This function is called before the appserver process terminates.
abstract  boolean supportsMinimalJars()
           
abstract  boolean supportsPoolNames()
          This function indicates whether the appserver supports the specification of a pool name in the deployment descriptor of CMP entity beans.
abstract  boolean supportsPrimitivePrimaryKeys()
          This function indicates whether the appserver allows single field primary keys to be primitive types, or whether they must be classes.
 void updateClassPathWithNewHomeDirectory(java.lang.String newHomeDirectory)
          Modifies the current classpath to use new home directory as base for all directoriess that start with the old home directory.
protected  void updateLastModified()
          Records a new last modified date for this path set and updates the global last updated time so that other path sets can rebuild their "full path" cache.
abstract  void updateSetup(java.awt.Component owner)
          This function is useful if the app server has a setup defined that needs to be run before this app server can actually be used.
 
Methods inherited from class com.borland.jbuilder.paths.PathSet
addEntries, addUniquePath, addUniquePath, addUniquePaths, addUniquePathsIfEnabled, buildFullPaths, delete, getClassPath, getCollection, getDocPath, getFullClassPath, getFullDocPath, getFullSourcePath, getLastModified, getName, getNames, getNames, getRequired, getRequiredNames, getResolver, getSourcePath, getUrl, isEmpty, isEnabled, isReadOnly, load, parseLibraries, resolveRequired, save, setClassPath, setCollection, setDocPath, setRequired, setRequired, setRequired, setSourcePath, setUrl, updateFullPaths
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppServer

public AppServer()

AppServer

public AppServer(java.lang.String name)
Method Detail

registerTargeting

public static void registerTargeting(java.lang.String name,
                                     java.lang.String version,
                                     AppServerTargeting targeting)
OpenTools registration for an interface used to provide customization and verify of deployment descriptors.
Parameters:
name - Name of AppServer.
version - Version of AppServer.
targeting - An interface which can provide target AppServer deployment descriptors.

getRegisteredTargeting

public static AppServerTargeting getRegisteredTargeting(java.lang.String name,
                                                        java.lang.String version)
Returns the last registered AppServerTargeting for the given name or a default implementation if none found.
Parameters:
name - Name of AppServer.
version - Version of AppServer.
Returns:
Returns last registered AppServerTargeting for this AppServer, or a default if none found.

getVersion

public java.lang.String getVersion()
Returns:
appServer/container version string -- this string cannot contain any spaces.

setVersion

public void setVersion(java.lang.String version)
Sets the version for this AppServer
Parameters:
version - The version string of the AppServer

getClassName

public java.lang.String getClassName()
Returns:
full appServer/container class name

setClassName

public void setClassName(java.lang.String className)
Sets the className for this AppServer
Parameters:
className - The name of the class used to run/debug this AppServer

getParameters

public java.lang.String getParameters()
Returns:
the parameters with which this AppServer should be run.

setParameters

public void setParameters(java.lang.String parameters)
Sets the parameters with which this AppServer should be run.
Parameters:
parameters - The parameters for this AppServer when it is run/debugged

getNecessaryParameters

public java.lang.String getNecessaryParameters()
Returns:
parameters without which this AppServer cannot be run.

setNecessaryParameters

public void setNecessaryParameters(java.lang.String necessaryParameters)
Sets parameters without which this AppServer cannot be run. This setting doesn't have a UI in the AppServer properties dialog, and can only be set through a custom extension of the AppServer class. These parameters will be added in front of the other parameters used to run/debug this AppServer at runtime.

getVmParameters

public java.lang.String getVmParameters()
Returns:
the java VM parameters used to run this AppServer.

setVmParameters

public void setVmParameters(java.lang.String vmParameters)
Sets the VM parameters used to run this AppServer.
Parameters:
vmParameters - The VM parameters for running/debugging this AppServer

getNecessaryVmParameters

public java.lang.String getNecessaryVmParameters()
Returns:
vm parameters without which this appServer cannot be run.

setNecessaryVmParameters

public void setNecessaryVmParameters(java.lang.String necessaryVmParameters)
Sets VM parameters without which this AppServer cannot be run. This setting doesn't have a UI in the AppServer properties dialog, and can only be set through a custom extension of the AppServer class. These VM parameters will be added in front of the other VM parameters used to run/debug this AppServer at runtime.

getHomeDirectory

public Url getHomeDirectory()
Returns:
home directory for this appServer

setHomeDirectory

public void setHomeDirectory(Url homeDirectory)
Sets the home directory for this AppServer. This should be the base directory where this AppServer is installed.
Parameters:
homeDirectory - The home directory for this AppServer

setEjbDeployer

public void setEjbDeployer(EjbDeployer ejbDeployer)

getEjbDeployer

public EjbDeployer getEjbDeployer()

restoreFrom

public void restoreFrom(AppServer appServer)

getFullClassPathString

public java.lang.String getFullClassPathString()

getNewPathsBasedOnNewHomeDirectory

public Url[] getNewPathsBasedOnNewHomeDirectory(java.lang.String newHomeDirectory)
Returns a Url[] paths list based on the newHomeDirectory. Entries that have current homeDirectory as their base will have newHomeDirectory as their base (first in path) directory. Otherwise, the first directory entry in each path will be replaced with newHomeDirectory. This function doesn't modify the actual classPath for this appServer.

getFileNameBasedOnProtocol

protected java.lang.String getFileNameBasedOnProtocol(java.lang.String protocol,
                                                      java.lang.String name)

updateClassPathWithNewHomeDirectory

public void updateClassPathWithNewHomeDirectory(java.lang.String newHomeDirectory)
Modifies the current classpath to use new home directory as base for all directoriess that start with the old home directory.

getNewVmParametersBasedOnNewHomeDirectory

public java.lang.String getNewVmParametersBasedOnNewHomeDirectory(java.lang.String newHomeDirectory)

getNewParametersBasedOnNewHomeDirectory

public java.lang.String getNewParametersBasedOnNewHomeDirectory(java.lang.String newHomeDirectory)

isDefault

public boolean isDefault()

hasEjbDeployer

public boolean hasEjbDeployer()

deploy

public void deploy(java.lang.String[] ejbJars)
Runs whatever tool is appropriate for this application server to deploy the argument jar files. If no such tool is registered, brings up a message that indicates no deployment tool. Note: Wherever this function is called from, need to make sure that isSetup() is called before to make sure that everything is set up properly. In the case of JBuilder's EJB Deployment menu, isSetup() is called by the update() method of the deploy action, and this function just will not be available if isSetup() fails.
Parameters:
ejbJars - The array of jars to be deployed.

makeFullName

public static java.lang.String makeFullName(java.lang.String name,
                                            java.lang.String version)
This function defines a mechanism for getting the full name of an appServer.
Returns:
String combining Name and version.

getNameFromFullName

public static java.lang.String getNameFromFullName(java.lang.String fullName)
This function retrieves just the name part of the full name.
Parameters:
fullName - The full name of the AppServer -- made up of name and version

getFullName

public java.lang.String getFullName()
Returns:
String containing Name and version of this app server.

getUniqueRunDebugClassPath

public Url[] getUniqueRunDebugClassPath(Url[] checkClassPath)
Parameters:
checkClassPath - The classpath to which we want to prepend ours
Returns:
Unique classpath array with our classpath prepended to checkClassPath

setName

public void setName(java.lang.String name)
Description copied from class: PathSet
Changes this PathSet's name.
Overrides:
setName in class PathSet
Following copied from class: com.borland.jbuilder.paths.PathSet
Parameters:
name - A new name for the PathSet. This value may not be null.

updateLastModified

protected void updateLastModified()
Description copied from class: PathSet

Records a new last modified date for this path set and updates the global last updated time so that other path sets can rebuild their "full path" cache.

Any method that modifies the state of the PathSet should invoke this method as a side-effect.

Overrides:
updateLastModified in class PathSet

getDefaultName

public abstract java.lang.String getDefaultName()
Returns:
name used to refer to the appServer

getDefaultVersion

public abstract java.lang.String getDefaultVersion()
Returns:
version used to refer to the appServer -- this string cannot contain any spaces.

getDefaultClassName

public abstract java.lang.String getDefaultClassName()
Returns:
full appServer class name

getDefaultParameters

public abstract java.lang.String getDefaultParameters()
Returns:
the parameters with which this appServer should be run.

getDefaultNecessaryParameters

public abstract java.lang.String getDefaultNecessaryParameters()
These parameters are ones without which the app server will not run. Unless it is really necessary, you don't want to resort to using this function. These params will not be shown to the user in any UI, and will be added to the front of the parameter list for the app server, when it will be run.
Returns:
the parameters without which this appServer cannot be run.

getDefaultVmParameters

public abstract java.lang.String getDefaultVmParameters()
Returns:
the java VM parameters used to to run this appServer.

getDefaultNecessaryVmParameters

public abstract java.lang.String getDefaultNecessaryVmParameters()
These VM parameters are ones without which the app server will not run. Unless it is really necessary, you don't want to resort to using this function. These params will not be shown to the user in any UI, and will be added to the front of the VM parameter list for the app server, when it will be run.
Returns:
the vm parameters without which this appServer cannot be run.

getDefaultHomeDirectory

public abstract Url getDefaultHomeDirectory()
This function returns the default home directory for this appserver

getTargeting

public AppServerTargeting getTargeting()
Returns the targeting interface class.
Returns:
Returns targeting interface class for this AppServer.

getDefaultClassPath

public abstract Url[] getDefaultClassPath()
This function returns the array of default directories/.jars that are necessary to run this appserver. The user will be able to modify this list.

getDefaultServerName

public abstract java.lang.String getDefaultServerName()
Returns a name that is used to uniquely identify the current instance of the application server. The user can enter their own name on the Project Properties/Run/EJB tab. This function just returns the name that will be used when the user hasn't specified one. Not all appservers might use this string.
Returns:
a name used to uniquely identify the current instance of the server.

customizeVmParameters

public abstract java.lang.String customizeVmParameters(java.lang.String currentVmParameters,
                                                       java.util.ArrayList ejbJarFiles,
                                                       Project project,
                                                       java.util.Map propertyMap)
This routine is called before the vm parameters are used, just in case some special parameters need to be added that include the ejb jar files (i.e. WebLogic). The returned vm parameter string is what will actually be inserted into the java command line.
Returns:
the modified vm parameters.

customizeParameters

public abstract java.lang.String customizeParameters(java.lang.String currentParameters,
                                                     java.util.ArrayList ejbJarFiles,
                                                     Project project,
                                                     java.util.Map propertyMap)
This routine is called before the appServer parameters are used, just in case some special parameters need to be added that include the ejb jar files (i.e. IAS). The returned vm parameter string is what will actually be inserted into the java command line.
Returns:
the modified appServer parameters.

supportsMinimalJars

public abstract boolean supportsMinimalJars()
Returns:
whether this appserver supports only having deployment descriptors in the ejb jars (with ejb classes found somewhere in classpath)

shutdown

public abstract boolean shutdown(Project project,
                                 java.util.Map propertyMap,
                                 RunJavaProcessTracker tracker)
This function is called before the appserver process terminates. It gives a chance to the appserver to do some cleanup if it's necessary.
Parameters:
propertyMap - The map of properties this AppServer was started with
tracker - The tracker used to display the run/debug for this AppServer

supportsPrimitivePrimaryKeys

public abstract boolean supportsPrimitivePrimaryKeys()
This function indicates whether the appserver allows single field primary keys to be primitive types, or whether they must be classes. The Entity Bean Modeler uses this setting to prevent the user from defining illegal primary keys.

supportsPoolNames

public abstract boolean supportsPoolNames()
This function indicates whether the appserver supports the specification of a pool name in the deployment descriptor of CMP entity beans. If the function returns true, the Entity Bean Modeler prompts for a pool name and generates the pool name in the deployment descriptor of every entity bean that it generates. If the function returns false, the Entity Bean Modeler does not prompt for a pool name.

isSetup

public abstract boolean isSetup()
This function is useful if the app server has a setup defined that needs to be run before this app server can actually be used.
Returns:
Whether this app server has been properly set up in JBuilder.

isValidSetupDirectory

public abstract java.lang.String isValidSetupDirectory(java.lang.String setupDirectory)
This function is useful if the app server has a setup defined that needs to be run before this AppServer can actually be used. It lets the AppServer return a string that indicates why the setup directory might be invalid. In most cases the setupDirectory will be the homeDirectory of the appServer. If there are no problems, the return value is null.
Parameters:
setupDirectory - The directory used to setup the app server
Returns:
A string indicating why the directory is invalid.

updateSetup

public abstract void updateSetup(java.awt.Component owner)
This function is useful if the app server has a setup defined that needs to be run before this app server can actually be used. This function allows the appserver to update the corresponding setup with the latest settings in the appserver itself.
Parameters:
owner - The component that will be the owning control of any dialogs that come up during the update.