|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.tool.envcheck.AbstractPlugin
com.sun.jini.tool.envcheck.plugins.CheckCodebase
public class CheckCodebase
Plugin which performs a variety of checks on codebase components. If not
configured to perform service starter checks, the codebase is expected to be
defined by the 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:
Nested Class Summary | |
---|---|
static class |
CheckCodebase.GetURLTask
|
private class |
CheckCodebase.URLAccessor
A Runnable which attempts to open a URL
connection. |
Field Summary | |
---|---|
(package private) EnvCheck |
envCheck
reference to the plugin container |
Constructor Summary | |
---|---|
CheckCodebase()
|
Method Summary | |
---|---|
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 . |
Methods inherited from class com.sun.jini.tool.envcheck.AbstractPlugin |
---|
getBundle, getString, getString, getString, getString, handleUnexpectedSubtaskReturn, isPluginOption, taskName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
EnvCheck envCheck
Constructor Detail |
---|
public CheckCodebase()
Method Detail |
---|
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 check
private 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 check
null
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |