|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ouncelabs.core.appserverimporter.BaseAppServerImporter
public abstract class BaseAppServerImporter
The base class to extend when defining a custom application server importer.
Field Summary | |
---|---|
protected static java.lang.String |
DOT_EAR
|
protected static java.lang.String |
DOT_JAR
|
protected static java.lang.String |
DOT_JSP
|
protected static java.lang.String |
DOT_WAR
|
protected static java.lang.String |
EAR_DIR
|
protected static java.lang.String |
ICF_DIR
|
protected java.lang.String |
id
The ID used to register this application server importer. |
protected static java.lang.String |
JSP_MAP_FILE
|
protected static java.lang.String |
MANIFEST_CLASSPATH
|
protected boolean |
multiProfile
True if the application server supports multiple profiles, false if it does not. |
protected java.lang.String |
name
The name for the application server importer, which is also the name of the application server it handles. |
Constructor Summary | |
---|---|
BaseAppServerImporter()
|
Method Summary | |
---|---|
void |
calculateInterdependencies(AppServer appServer)
Calculates the interdependencies between the projects on an application server based on their manifests. |
protected void |
calculateInterdependencies(AppServerProfile profile)
Calculates the project interdepencies for the specified application server profile. |
void |
cleanUp()
Performs any clean up, if needed. |
protected java.util.Map<java.lang.String,java.lang.String> |
computeJSPMap(AppServer appServer,
WebProject project,
java.io.File stagingDir)
Computes the JSP map for the specified Web project. |
BaseAppServerClasspathProvider |
createClasspathProvider()
Creates an instance of the AppServerClasspathProvider implementation for the application server, defining
the runtime classpath for it. |
JSPCompilerSupport |
createJSPCompilerSupprt()
This implementation returns null. |
java.util.List<java.lang.String> |
generateICF(AppServer appServer)
Generates ICF files describing the selected applications in an application server, so that they can be imported into the AppScan applications manager . |
void |
generateJSPMaps(AppServer appServer)
Generates the JSP map files for the application server if the precompiled
JSP Compiler type is used. |
protected void |
generateJSPMaps(AppServer appServer,
WebProject project,
java.io.File stagingDir)
|
java.lang.String |
getId()
Returns the ID used to register this application server importer. |
JSPCompilerType |
getJSPCompilerType()
This implementation returns null, indicating that the product default JSP compiler should be used. |
java.lang.String |
getName()
Returns the name for the application server importer, which is also the name of the application server it handles. |
boolean |
handleImportResult(org.eclipse.core.runtime.IStatus result,
java.lang.Object shell)
This implementation does nothing, and returns false to let the caller handle it. |
void |
initializeAppServer(AppServer appServer)
Initializes an application server instance with the following basic data provided by the importer: name
JSP compiler type
JSP compiler support
classpath provider |
boolean |
isMultiProfile()
Indicates whether or not the application server type supports multiple profiles. |
protected boolean |
isValidDropInFile(java.io.File dropInFile)
Indicates whether the specified file represents EAR file or Java EE module in the drop-ins folder. |
void |
precompileJSPs(AppServer appServer)
This implementation does nothing. |
protected void |
processDropInsFolder(AppServerProfile profile,
java.io.File dropinsFolder)
Non-recursively imports EAR files and Java EE modules from the drop-ins folder of an application server profile. |
protected void |
processEARFile(AppServerProfile profile,
java.io.File earFile)
Imports an EAR file in an application server profile. |
org.eclipse.core.runtime.IStatus |
validatePrecompiledJSPs(AppServer appServer)
Validates precompiled JSPs for the application server if the precompiled
JSP Compiler type is used. |
protected void |
validatePrecompiledJSPs(AppServer appServer,
Project project,
java.io.File stagingDir,
java.io.File dir,
JSPCompileStatus status)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ouncelabs.core.appserverimporter.AppServerImporter |
---|
importAppServer, isValidLocation |
Field Detail |
---|
protected static final java.lang.String MANIFEST_CLASSPATH
protected static final java.lang.String DOT_JSP
protected static final java.lang.String JSP_MAP_FILE
protected static final java.lang.String DOT_EAR
protected static final java.lang.String DOT_JAR
protected static final java.lang.String DOT_WAR
protected static final java.lang.String EAR_DIR
protected static final java.lang.String ICF_DIR
protected java.lang.String id
protected java.lang.String name
protected boolean multiProfile
Constructor Detail |
---|
public BaseAppServerImporter()
Method Detail |
---|
public java.lang.String getId()
getId
in interface AppServerImporter
public java.lang.String getName()
getName
in interface AppServerImporter
public boolean isMultiProfile()
isMultiProfile
in interface AppServerImporter
public void initializeAppServer(AppServer appServer)
This method is invoked from the AppServer constructor
,
to automatically propagate this data.
appServer
- the application server to initializeAppServer.setName(String)
,
AppServer.setJSPCompilerType(JSPCompilerType)
,
AppServer.setJSPCompilerSupport(JSPCompilerSupport)
,
AppServer.setClasspathProvider(BaseAppServerClasspathProvider)
,
AppServer.AppServer(String, BaseAppServerImporter)
protected void processDropInsFolder(AppServerProfile profile, java.io.File dropinsFolder) throws java.io.IOException
isValidDropInFile(File)
returns true.
profile
- the application server profiledropinsFolder
- the drop-ins folder that can contain EAR files and Java EE modules
java.io.IOException
- if an I/O operation failsisValidDropInFile(File)
protected boolean isValidDropInFile(java.io.File dropInFile)
This implementation only checks that the file is not a hidden file. Subclasses can override this to define further requirements.
dropInFile
- a file in the drop-ins folder
protected void processEARFile(AppServerProfile profile, java.io.File earFile) throws java.io.IOException
profile
- the application server profileearFile
- the EAR file to be imported
java.io.IOException
- if an I/O operation failspublic void calculateInterdependencies(AppServer appServer) throws java.io.IOException
This implementation simply invokes calculateInterdependencies(AppServerProfile)
for each of the
application server's profiles.
appServer
- the application server
java.io.IOException
- if an I/O operation failscalculateInterdependencies(AppServerProfile)
protected void calculateInterdependencies(AppServerProfile profile) throws java.io.IOException
profile
- an application server profile
java.io.IOException
- if an I/O operation failspublic java.util.List<java.lang.String> generateICF(AppServer appServer) throws java.io.IOException
applications manager
.
appServer
- the application server
java.io.IOException
- if an I/O operation failspublic JSPCompilerType getJSPCompilerType()
getJSPCompilerType
in interface AppServerImporter
AppServerImporter.precompileJSPs(AppServer)
,
AppServerImporter.createJSPCompilerSupprt()
,
AppServerImporter.createClasspathProvider()
public JSPCompilerSupport createJSPCompilerSupprt()
This implementation returns null. Subclasses must override it if getJSPCompilerType()
returns
JSPCompilerType.PRECOMPILED
.
createJSPCompilerSupprt
in interface AppServerImporter
JSPCompilerSupport
or nullgetJSPCompilerType()
,
JSPCompilerType.PRECOMPILED
public BaseAppServerClasspathProvider createClasspathProvider()
AppServerClasspathProvider
implementation for the application server, defining
the runtime classpath for it.
This implementation returns null. Subclasses must override it if getJSPCompilerType()
returns
JSPCompilerType.PRECOMPILED
. They may also override it for an application server that provides an unusual
classpath to its applications.
createClasspathProvider
in interface AppServerImporter
BaseAppServerClasspathProvider
or nullAppServerClasspathProvider
,
getJSPCompilerType()
,
JSPCompilerType.PRECOMPILED
public void precompileJSPs(AppServer appServer) throws java.lang.Exception
getJSPCompilerType()
returns
JSPCompilerType.PRECOMPILED
.
precompileJSPs
in interface AppServerImporter
appServer
- the application server
java.lang.Exception
- exceptions thrown by the implementations of this method are handled by the callergetJSPCompilerType()
,
JSPCompilerType.PRECOMPILED
public void generateJSPMaps(AppServer appServer) throws java.io.IOException
precompiled
JSP Compiler type
is used.
JSP map files are used at scan time to locate the precompiled class files corresponding to JSP files.
appServer
- the application server
java.io.IOException
- if an I/O operation failsgetJSPCompilerType()
,
JSPCompilerType.PRECOMPILED
protected void generateJSPMaps(AppServer appServer, WebProject project, java.io.File stagingDir) throws java.io.IOException
java.io.IOException
protected java.util.Map<java.lang.String,java.lang.String> computeJSPMap(AppServer appServer, WebProject project, java.io.File stagingDir) throws java.io.IOException
The JSP map is a mapping of JSP files to compiled class files, where entries are defined as follows:
This method is only invoked for application servers that use the precompiled
JSP Compiler type
.
appServer
- the application serverproject
- a Web project for which to compute a JSP mapstagingDir
- the staging directory for the project
java.io.IOException
- if an I/O operation failsgetJSPCompilerType()
,
JSPCompilerType.PRECOMPILED
public org.eclipse.core.runtime.IStatus validatePrecompiledJSPs(AppServer appServer) throws java.io.IOException
precompiled
JSP Compiler type
is used.
appServer
- the application server
java.io.IOException
- if an I/O operation failsgetJSPCompilerType()
,
JSPCompilerType.PRECOMPILED
protected void validatePrecompiledJSPs(AppServer appServer, Project project, java.io.File stagingDir, java.io.File dir, JSPCompileStatus status) throws java.io.IOException
java.io.IOException
public boolean handleImportResult(org.eclipse.core.runtime.IStatus result, java.lang.Object shell)
handleImportResult
in interface AppServerImporter
result
- result of the import processshell
- the shell of the active window, or null in a non-UI environment
Shell
public void cleanUp()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |