public class CheckCodebase extends AbstractPlugin
java.rmi.server.codebase
system
property. Otherwise, all of the codebases contained in the service
descriptors of the service starter Configuration
are examined
(excepting SharedActivationGroupDescriptors
, which do not have a
codebase). First, an existence check is performed; the codebase string must
be non-null and have length > 0 after white space is trimmed. Non-existence
is reported as an error. Then the codebase is decomposed into tokens (URL
strings). Each component in a codebase is checked for the following:
Modifier and Type | Class and Description |
---|---|
static class |
CheckCodebase.GetURLTask |
private class |
CheckCodebase.URLAccessor
A
Runnable which attempts to open a URL
connection. |
Modifier and Type | Field and Description |
---|---|
(package private) EnvCheck |
envCheck
reference to the plugin container
|
Constructor and Description |
---|
CheckCodebase() |
Modifier and Type | Method and Description |
---|---|
private void |
checkAccessibility(URL url,
String source)
Check the accessibility of the codebase
URL by opening a
connection to it. |
private boolean |
checkExistance(String source,
String codebase)
Check for existence.
|
private void |
checkForFQDomain(URL url,
String source)
Check for a fully qualified host name.
|
private void |
checkForKnownHost(URL url,
String source)
Check the ability to resolve the host component of
url
to an InetAddress . |
private void |
checkForLocalHost(URL url,
String source)
Check whether the host component of
url resolves
to a loopback address. |
private void |
checkForMD5(URL url,
String source)
Check for use of an MD5 httpmd URL.
|
private URL |
checkURL(NonActivatableServiceDescriptor d,
SharedActivationGroupDescriptor g,
String source,
String urlToken)
Check whether
urlToken can be used to construct
a URL object. |
private void |
doChecks(NonActivatableServiceDescriptor d,
SharedActivationGroupDescriptor g,
String source,
String codebase)
Perform all of the checks on
codebase . |
void |
run(EnvCheck envCheck)
Depending on whether service start checks are configured,
either check the codebase system property or all of the
ServiceDescriptors that are instanceof
NonActivatableServiceDescriptor . |
getBundle, getString, getString, getString, getString, handleUnexpectedSubtaskReturn, isPluginOption, taskName
EnvCheck envCheck
public void run(EnvCheck envCheck)
ServiceDescriptors
that are instanceof
NonActivatableServiceDescriptor
.envCheck
- a reference to the driver instance.private void doChecks(NonActivatableServiceDescriptor d, SharedActivationGroupDescriptor g, String source, String codebase)
codebase
.source
- a string describing the source of the codebase for
use in report messagescodebase
- the codebase to checkprivate boolean checkExistance(String source, String codebase)
codebase
must be non-null
and have length > 0 after trimming whitespace.source
- identifies the source of the codebasecodebase
- the codebase to checkprivate URL checkURL(NonActivatableServiceDescriptor d, SharedActivationGroupDescriptor g, String source, String urlToken)
urlToken
can be used to construct
a URL
object. If a MalformedURLException
is thrown, check whether the protocol portion of the URL is
httpmd:
. If so, check whether the protocol handler is
installed. If not, output an appropriate message. Otherwise, just
complain generally that the URL is malformed.source
- the source of the codebaseurlToken
- the codebase component to checknull
otherwiseprivate void checkForKnownHost(URL url, String source)
url
to an InetAddress
. If successful, this method is silent.url
- the URL
to checksource
- the source of the URL
private void checkForLocalHost(URL url, String source)
url
resolves
to a loopback address.url
- the URL
to checksource
- the source of the URL
private void checkAccessibility(URL url, String source)
URL
by opening a
connection to it. This check fails if the openConnection
call or subsequent getInputStream
call throws an
IOException
, or if these calls do not complete within 5
seconds. These two failure modes result in different error messages
being output.url
- the URL
to checksource
- the source of the URL
private void checkForFQDomain(URL url, String source)
url
- the URL
to checksource
- the source of the URL
private void checkForMD5(URL url, String source)
url
is httpmd, then the hash function identifier is parsed from the
file component of url
and a string comparison is done.url
- the URL
to checksource
- the source of the URL
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.