public class DOLUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Logger |
deplLogger |
static String |
INVALID_DESC_MAPPING |
static String |
SCHEMA_LOCATION_TAG |
static String |
W3C_XML_SCHEMA |
Modifier and Type | Method and Description |
---|---|
static ArchiveType |
carType() |
static ArchiveType |
earType() |
static ArchiveType |
ejbType() |
static boolean |
equals(Object a,
Object b)
Returns true if both objects are equal to
null or a.equals(b) |
static Application |
getApplicationFromEnv(JndiNameEnvironment env) |
static String |
getApplicationName(JndiNameEnvironment env) |
static String |
getComponentEnvId(JndiNameEnvironment env)
Generate a unique id name for each J2EE component.
|
static List<ConfigurationDeploymentDescriptorFile> |
getConfigurationDeploymentDescriptorFiles(org.glassfish.hk2.api.ServiceLocator habitat,
String containerType)
Gets all classes for handling the XML configuration
|
static BundleDescriptor |
getCurrentBundleForContext(DeploymentContext context)
Gets the associated descriptor with the context
|
static Logger |
getDefaultLogger() |
static List<URI> |
getLibraryJarURIs(Application app,
ReadableArchive archive) |
static List<URI> |
getLibraryJarURIs(BundleDescriptor bundleDesc,
ReadableArchive archive) |
static String |
getModuleName(JndiNameEnvironment env) |
static ArchiveType |
getModuleType(String moduleType)
Utility method to retrieve a
ArchiveType from a stringified module type. |
static List<String> |
getProprietaryDTDStart()
Returns a list of the proprietary dtd system IDs
|
static List<String> |
getProprietarySchemaNamespaces()
Returns a list of the proprietary schema namespaces
|
static boolean |
getTreatComponentAsModule(JndiNameEnvironment env)
Returns true if the environment or its parent is a
WebBundleDescriptor , false otherwise |
static boolean |
isGFDDOverWLSDD()
returns true if GF DD should have higher precedence over
WLS DD when both present in the same archive
|
static boolean |
isIgnoreWLSDD()
returns true if we should ignore WLS DD in the archive
|
static boolean |
isRAConnectionFactory(org.glassfish.hk2.api.ServiceLocator habitat,
String type,
Application thisApp)
Returns true if there is a resource connection definition of the type with the application
|
static boolean |
isScanningAllowed(Application app,
String entryName)
Returns true if entry not excluded from scanning or specifically included in app
|
static boolean |
isWhiteListed(Application application,
String className)
Supports extreme classloading isolation
|
static List<ConfigurationDeploymentDescriptorFile> |
processConfigurationDDFiles(List<ConfigurationDeploymentDescriptorFile> ddFiles,
ReadableArchive archive,
ArchiveType archiveType)
process the list of the configuration files, and return the sorted
configuration file with precedence from high to low
this list takes consideration of what runtime files are
present in the current archive
|
static ArchiveType |
rarType() |
static void |
readAlternativeRuntimeDescriptor(ReadableArchive appArchive,
ReadableArchive embeddedArchive,
Archivist archivist,
BundleDescriptor descriptor,
String altDDPath)
read alternative runtime descriptor if there is an alternative runtime
DD packaged inside the archive
|
static void |
readRuntimeDeploymentDescriptor(List<ConfigurationDeploymentDescriptorFile> confDDFiles,
ReadableArchive archive,
RootDeploymentDescriptor descriptor,
Archivist main,
boolean warnIfMultipleDDs)
Read the runtime deployment descriptors (can contained in one or
many file) set the corresponding information in the passed descriptor.
|
static boolean |
setElementValue(XMLElement element,
String value,
Object o)
receives notification of the value for a particular tag
|
static void |
setExtensionArchivistForSubArchivist(org.glassfish.hk2.api.ServiceLocator habitat,
ReadableArchive archive,
ModuleDescriptor md,
Application app,
Archivist subArchivist)
Sets the class for processing an archive on a subarchive
|
static void |
validateRuntimeAltDDPath(String runtimeAltDDPath)
If the path does not contain "glassfish-" this method throws an IllegalArgumentException
|
static ArchiveType |
warType() |
public static final String W3C_XML_SCHEMA
public static final String SCHEMA_LOCATION_TAG
public static final Logger deplLogger
public static final String INVALID_DESC_MAPPING
public static Logger getDefaultLogger()
public static boolean equals(Object a, Object b)
null
or a.equals(b)
a
- b
- Object.equals(Object)
public static List<URI> getLibraryJarURIs(BundleDescriptor bundleDesc, ReadableArchive archive) throws Exception
bundleDesc
- archive
- Exception
public static boolean isScanningAllowed(Application app, String entryName)
app
- entryName
- public static List<URI> getLibraryJarURIs(Application app, ReadableArchive archive) throws Exception
app
- archive
- Exception
public static BundleDescriptor getCurrentBundleForContext(DeploymentContext context)
context
- public static boolean isRAConnectionFactory(org.glassfish.hk2.api.ServiceLocator habitat, String type, Application thisApp)
habitat
- type
- thisApp
- public static ArchiveType earType()
public static ArchiveType ejbType()
public static ArchiveType carType()
public static ArchiveType warType()
public static ArchiveType rarType()
public static ArchiveType getModuleType(String moduleType)
ArchiveType
from a stringified module type.
Since ArchiveType
is an extensible abstraction and implementations are plugged in via HK2 service
registry, this method returns null if HK2 service registry is not setup.
If null is passed to this method, it returns null instead of returning an arbitrary ArchiveType or throwing
an exception.moduleType
- String equivalent of the module type being looked up. null is allowed.public static boolean isGFDDOverWLSDD()
public static boolean isIgnoreWLSDD()
public static void validateRuntimeAltDDPath(String runtimeAltDDPath)
runtimeAltDDPath
- public static List<ConfigurationDeploymentDescriptorFile> processConfigurationDDFiles(List<ConfigurationDeploymentDescriptorFile> ddFiles, ReadableArchive archive, ArchiveType archiveType) throws IOException
ddFiles
- archive
- archiveType
- IOException
public static void readAlternativeRuntimeDescriptor(ReadableArchive appArchive, ReadableArchive embeddedArchive, Archivist archivist, BundleDescriptor descriptor, String altDDPath) throws IOException, SAXParseException
appArchive
- embeddedArchive
- archivist
- descriptor
- altDDPath
- IOException
SAXParseException
public static void readRuntimeDeploymentDescriptor(List<ConfigurationDeploymentDescriptorFile> confDDFiles, ReadableArchive archive, RootDeploymentDescriptor descriptor, Archivist main, boolean warnIfMultipleDDs) throws IOException, SAXParseException
confDDFiles
- the sorted configuration files for this archivearchive
- the archivedescriptor
- the initialized deployment descriptormain
- the main archivistwarnIfMultipleDDs
- whether to log warnings if both the GlassFish and the legacy Sun descriptors are presentIOException
SAXParseException
public static void setExtensionArchivistForSubArchivist(org.glassfish.hk2.api.ServiceLocator habitat, ReadableArchive archive, ModuleDescriptor md, Application app, Archivist subArchivist)
If there an exception occurs in this method it will be caught and logged as a warning
habitat
- archive
- md
- app
- subArchivist
- public static List<ConfigurationDeploymentDescriptorFile> getConfigurationDeploymentDescriptorFiles(org.glassfish.hk2.api.ServiceLocator habitat, String containerType)
habitat
- habitat to search for classescontainerType
- they type of container they must work onpublic static boolean setElementValue(XMLElement element, String value, Object o)
element
- the xml elementvalue
- it's associated valueo
- public static List<String> getProprietarySchemaNamespaces()
public static List<String> getProprietaryDTDStart()
public static Application getApplicationFromEnv(JndiNameEnvironment env)
env
- public static String getApplicationName(JndiNameEnvironment env)
env
- public static String getModuleName(JndiNameEnvironment env)
public static boolean getTreatComponentAsModule(JndiNameEnvironment env)
WebBundleDescriptor
, false otherwiseenv
- public static String getComponentEnvId(JndiNameEnvironment env)
env
- public static boolean isWhiteListed(Application application, String className)
application
- className
- Copyright © 2021. All rights reserved.