Fields Summary |
---|
private String | extensionNameThe name of the optional package being made available, or required. |
private String | implementationURLThe URL from which the most recent version of this optional package
can be obtained if it is not already installed. |
private String | implementationVendorThe name of the company or organization that produced this
implementation of this optional package. |
private String | implementationVendorIdThe unique identifier of the company that produced the optional
package contained in this JAR file. |
private String | implementationVersionThe version number (dotted decimal notation) for this implementation
of the optional package. |
private String | specificationVendorThe name of the company or organization that originated the
specification to which this optional package conforms. |
private String | specificationVersionThe version number (dotted decimal notation) of the specification
to which this optional package conforms. |
private boolean | fulfilledfulfilled is true if all the required extension dependencies have been
satisfied |
Methods Summary |
---|
public java.lang.String | getExtensionName()
return (this.extensionName);
|
public java.lang.String | getImplementationURL()
return (this.implementationURL);
|
public java.lang.String | getImplementationVendor()
return (this.implementationVendor);
|
public java.lang.String | getImplementationVendorId()
return (this.implementationVendorId);
|
public java.lang.String | getImplementationVersion()
return (this.implementationVersion);
|
public java.lang.String | getSpecificationVendor()
return (this.specificationVendor);
|
public java.lang.String | getSpecificationVersion()
return (this.specificationVersion);
|
public java.lang.String | getUniqueId()UniqueId created by combining the extension name and implementation
version.
return this.extensionName + this.implementationVersion;
|
public boolean | isCompatibleWith(org.apache.catalina.util.Extension required)Return true if the specified Extension
(which represents an optional package required by this application)
is satisfied by this Extension (which represents an
optional package that is already installed. Otherwise, return
false .
// Extension Name must match
if (extensionName == null)
return (false);
if (!extensionName.equals(required.getExtensionName()))
return (false);
// Available specification version must be >= required
if (!isNewer(specificationVersion, required.getSpecificationVersion()))
return (false);
// Implementation Vendor ID must match
if (implementationVendorId == null)
return (false);
if (!implementationVendorId.equals(required.getImplementationVendorId()))
return (false);
// Implementation version must be >= required
if (!isNewer(implementationVersion, required.getImplementationVersion()))
return (false);
// This available optional package satisfies the requirements
return (true);
|
public boolean | isFulfilled()
return fulfilled;
|
private boolean | isNewer(java.lang.String first, java.lang.String second)Return true if the first version number is greater than
or equal to the second; otherwise return false .
if ((first == null) || (second == null))
return (false);
if (first.equals(second))
return (true);
StringTokenizer fTok = new StringTokenizer(first, ".", true);
StringTokenizer sTok = new StringTokenizer(second, ".", true);
int fVersion = 0;
int sVersion = 0;
while (fTok.hasMoreTokens() || sTok.hasMoreTokens()) {
if (fTok.hasMoreTokens())
fVersion = Integer.parseInt(fTok.nextToken());
else
fVersion = 0;
if (sTok.hasMoreTokens())
sVersion = Integer.parseInt(sTok.nextToken());
else
sVersion = 0;
if (fVersion < sVersion)
return (false);
else if (fVersion > sVersion)
return (true);
if (fTok.hasMoreTokens()) // Swallow the periods
fTok.nextToken();
if (sTok.hasMoreTokens())
sTok.nextToken();
}
return (true); // Exact match
|
public void | setExtensionName(java.lang.String extensionName)
if (extensionName != null) {
this.extensionName = extensionName.trim();
}
|
public void | setFulfilled(boolean fulfilled)
this.fulfilled = fulfilled;
|
public void | setImplementationURL(java.lang.String implementationURL)
this.implementationURL = implementationURL;
|
public void | setImplementationVendor(java.lang.String implementationVendor)
this.implementationVendor = implementationVendor;
|
public void | setImplementationVendorId(java.lang.String implementationVendorId)
this.implementationVendorId = implementationVendorId;
|
public void | setImplementationVersion(java.lang.String implementationVersion)
if (implementationVersion != null) {
this.implementationVersion = implementationVersion.trim();
}
|
public void | setSpecificationVendor(java.lang.String specificationVendor)
this.specificationVendor = specificationVendor;
|
public void | setSpecificationVersion(java.lang.String specificationVersion)
this.specificationVersion = specificationVersion;
|
public java.lang.String | toString()Return a String representation of this object.
StringBuffer sb = new StringBuffer("Extension[");
sb.append(extensionName);
if (implementationURL != null) {
sb.append(", implementationURL=");
sb.append(implementationURL);
}
if (implementationVendor != null) {
sb.append(", implementationVendor=");
sb.append(implementationVendor);
}
if (implementationVendorId != null) {
sb.append(", implementationVendorId=");
sb.append(implementationVendorId);
}
if (implementationVersion != null) {
sb.append(", implementationVersion=");
sb.append(implementationVersion);
}
if (specificationVendor != null) {
sb.append(", specificationVendor=");
sb.append(specificationVendor);
}
if (specificationVersion != null) {
sb.append(", specificationVersion=");
sb.append(specificationVersion);
}
sb.append("]");
return (sb.toString());
|