01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.endpoint;
19:
20: import javax.xml.namespace.QName;
21:
22: import org.apache.cxf.ws.addressing.EndpointReferenceType;
23:
24: /**
25: * Implementations of this interface are responsible for mediating
26: * access to registered EndpointResolvers, which themselves map
27: * between abstract and concrete endpoint references, and/or
28: * facilitate renewal of stale references.
29: * <p>
30: * An underlying mechanism in the style of the OGSA WS-Naming
31: * specification is assumed, where an EPR maybe be fully abstract,
32: * or concrete but with sufficient information embedded to enable
33: * its renewal if necessary.
34: */
35: public interface EndpointResolverRegistry {
36: /**
37: * Register an endpoint resolver.
38: *
39: * @param resolver the EndpointResolver to add to the chain.
40: */
41: void register(EndpointResolver resolver);
42:
43: /**
44: * Unregister an endpoint resolver.
45: *
46: * @param resolver the EndpointResolver to remove from the chain.
47: */
48: void unregister(EndpointResolver resolver);
49:
50: /**
51: * Walk the list of registered EndpointResolvers, so as to
52: * retrieve a concrete EPR corresponding to the given abstract EPR,
53: * returning a cached reference if already resolved.
54: * <p>
55: * This API is used by any actor that requires a concrete EPR (e.g.
56: * a transport-level Conduit), and must be called each and every
57: * time the EPR content is to be accessed (e.g. before each connection
58: * establishment attempt).
59: *
60: * @param logical the abstract EPR to resolve
61: */
62: EndpointReferenceType resolve(EndpointReferenceType logical);
63:
64: /**
65: * Walk the list of registered EndpointResolvers, so as to force a fresh
66: * resolution of the given abstract EPR, discarding any previously cached
67: * reference.
68: * <p>
69: * This API may be used by say the transport-level Conduit when it
70: * detects a non-transient error on the outgoing connection, or
71: * by any other actor in the dispatch with the ability to infer
72: * server-side unavailability.
73: *
74: * @param logical the previously resolved abstract EPR
75: * @param physical the concrete EPR to refresh
76: * @return the renewed concrete EPR if appropriate, null otherwise
77: */
78: EndpointReferenceType renew(EndpointReferenceType logical,
79: EndpointReferenceType physical);
80:
81: /**
82: * Walk the list of registered EndpointResolvers, so as to mint a new
83: * abstract EPR for a given service name.
84: *
85: * @param serviceName
86: * @return the newly minted EPR if appropriate, null otherwise
87: */
88: EndpointReferenceType mint(QName serviceName);
89:
90: /**
91: * Walk the list of registered EndpointResolvers, so as to mint a new
92: * abstract EPR for a gievn physical EPR.
93: *
94: * @param physical
95: * @return the newly minted EPR if appropriate, null otherwise
96: */
97: EndpointReferenceType mint(EndpointReferenceType physical);
98:
99: }
|