|
Préférences
Moteurs de recherche
|
||||||||||||||||||||||||
JavaTM 2 Platform Std. Ed. v1.5.0
javax.management.remote
|
Constructor Summary | |
---|---|
JMXServiceURL(String serviceURL)
Constructs a JMXServiceURL by parsing a Service URL
string. |
|
JMXServiceURL(String protocol,
String host,
int port)
Constructs a JMXServiceURL with the given protocol,
host, and port. |
|
JMXServiceURL(String protocol,
String host,
int port,
String urlPath)
Constructs a JMXServiceURL with the given parts. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Indicates whether some other object is equal to this one. |
String |
getHost()
The host part of the Service URL. |
int |
getPort()
The port of the Service URL. |
String |
getProtocol()
The protocol part of the Service URL. |
String |
getURLPath()
The URL Path part of the Service URL. |
int |
hashCode()
Returns a hash code value for the object. |
String |
toString()
The string representation of this Service URL. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JMXServiceURL(String serviceURL) throws MalformedURLException
Constructs a JMXServiceURL
by parsing a Service URL
string.
serviceURL
- the URL string to be parsed.
NullPointerException
- if serviceURL
is
null.
MalformedURLException
- if serviceURL
does not conform to the syntax for an Abstract Service URL or
if it is not a valid name for a JMX Remote API service. A
JMXServiceURL
must begin with the string
"service:jmx:"
(case-insensitive). It must not
contain any characters that are not printable ASCII characters.public JMXServiceURL(String protocol, String host, int port) throws MalformedURLException
Constructs a JMXServiceURL
with the given protocol,
host, and port. This constructor is equivalent to
JMXServiceURL(protocol, host, port, null)
.
protocol
- the protocol part of the URL. If null, defaults
to jmxmp
.host
- the host part of the URL. If null, defaults to the
local host name, as determined by
InetAddress.getLocalHost().getHostName()
. If it
is a numeric IPv6 address, it can optionally be enclosed in
square brackets []
.port
- the port part of the URL.
MalformedURLException
- if one of the parts is
syntactically incorrect, or if host
is null and it
is not possible to find the local host name, or if
port
is negative.public JMXServiceURL(String protocol, String host, int port, String urlPath) throws MalformedURLException
Constructs a JMXServiceURL
with the given parts.
protocol
- the protocol part of the URL. If null, defaults
to jmxmp
.host
- the host part of the URL. If null, defaults to the
local host name, as determined by
InetAddress.getLocalHost().getHostName()
. If it
is a numeric IPv6 address, it can optionally be enclosed in
square brackets []
.port
- the port part of the URL.urlPath
- the URL path part of the URL. If null, defaults to
the empty string.
MalformedURLException
- if one of the parts is
syntactically incorrect, or if host
is null and it
is not possible to find the local host name, or if
port
is negative.Method Detail |
---|
public String getProtocol()
The protocol part of the Service URL.
public String getHost()
The host part of the Service URL. If the Service URL was
constructed with the constructor that takes a URL string
parameter, the result is the substring specifying the host in
that URL. If the Service URL was constructed with a
constructor that takes a separate host parameter, the result is
the string that was specified. If that string was null, the
result is
InetAddress.getLocalHost().getHostName()
.
In either case, if the host was specified using the
[...]
syntax for numeric IPv6 addresses, the
square brackets are not included in the return value here.
public int getPort()
The port of the Service URL. If no port was specified, the returned value is 0.
public String getURLPath()
The URL Path part of the Service URL. This is an empty
string, or a string beginning with a slash (/
), or
a string beginning with a semicolon (;
).
public String toString()
The string representation of this Service URL. If the value
returned by this method is supplied to the
JMXServiceURL
constructor, the resultant object is
equal to this one.
The host
part of the returned string
is the value returned by getHost()
. If that value
specifies a numeric IPv6 address, it is surrounded by square
brackets []
.
The port
part of the returned string
is the value returned by getPort()
in its shortest
decimal form. If the value is zero, it is omitted.
public boolean equals(Object obj)
Indicates whether some other object is equal to this one.
This method returns true if and only if obj
is an
instance of JMXServiceURL
whose getProtocol()
, getHost()
, getPort()
, and
getURLPath()
methods return the same values as for
this object. The values for getProtocol()
and getHost()
can differ in case without affecting equality.
obj
- the reference object with which to compare.
true
if this object is the same as the
obj
argument; false
otherwise.Object.hashCode()
,
Hashtable
public int hashCode()
Object
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)
Object.equals(java.lang.Object)
,
Hashtable