| 1 |
/* |
| 2 |
* Copyright 2001-2004 The Apache Software Foundation. |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
* you may not use this file except in compliance with the License. |
| 6 |
* You may obtain a copy of the License at |
| 7 |
* |
| 8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
* |
| 10 |
* Unless required by applicable law or agreed to in writing, software |
| 11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
* See the License for the specific language governing permissions and |
| 14 |
* limitations under the License. |
| 15 |
*/ |
| 16 |
package javax.xml.messaging; |
| 17 |
|
| 18 |
/** |
| 19 |
* An opaque representation of an application endpoint. Typically, an |
| 20 |
* <code>Endpoint</code> object represents a business entity, but it |
| 21 |
* may represent a party of any sort. Conceptually, an |
| 22 |
* <code>Endpoint</code> object is the mapping of a logical name |
| 23 |
* (example, a URI) to a physical location, such as a URL. |
| 24 |
* <P> |
| 25 |
* For messaging using a provider that supports profiles, an application |
| 26 |
* does not need to specify an endpoint when it sends a message because |
| 27 |
* destination information will be contained in the profile-specific header. |
| 28 |
* However, for point-to-point plain SOAP messaging, an application must supply |
| 29 |
* an <code>Endpoint</code> object to |
| 30 |
* the <code>SOAPConnection</code> method <code>call</code> |
| 31 |
* to indicate the intended destination for the message. |
| 32 |
* The subclass {@link URLEndpoint URLEndpoint} can be used when an application |
| 33 |
* wants to send a message directly to a remote party without using a |
| 34 |
* messaging provider. |
| 35 |
* <P> |
| 36 |
* The default identification for an <code>Endpoint</code> object |
| 37 |
* is a URI. This defines what JAXM messaging |
| 38 |
* providers need to support at minimum for identification of |
| 39 |
* destinations. A messaging provider |
| 40 |
* needs to be configured using a deployment-specific mechanism with |
| 41 |
* mappings from an endpoint to the physical details of that endpoint. |
| 42 |
* <P> |
| 43 |
* <code>Endpoint</code> objects can be created using the constructor, or |
| 44 |
* they can be looked up in a naming |
| 45 |
* service. The latter is more flexible because logical identifiers |
| 46 |
* or even other naming schemes (such as DUNS numbers) |
| 47 |
* can be bound and rebound to specific URIs. |
| 48 |
*/ |
| 49 |
public class Endpoint { |
| 50 |
|
| 51 |
/** |
| 52 |
* Constructs an <code>Endpoint</code> object using the given string identifier. |
| 53 |
* @param uri a string that identifies the party that this <code>Endpoint</code> object represents; the default is a URI |
| 54 |
*/ |
| 55 |
public Endpoint(String uri) { |
| 56 |
id = uri; |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Retrieves a string representation of this <code>Endpoint</code> object. This string is likely to be provider-specific, and |
| 61 |
* programmers are discouraged from parsing and programmatically interpreting the contents of this string. |
| 62 |
* @return a <code>String</code> with a provider-specific representation of this <code>Endpoint</code> object |
| 63 |
*/ |
| 64 |
public String toString() { |
| 65 |
return id; |
| 66 |
} |
| 67 |
|
| 68 |
/** A string that identifies the party that this <code>Endpoint</code> object represents; a URI is the default. */ |
| 69 |
protected String id; |
| 70 |
} |