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: */
19:
20: package org.apache.synapse.config.xml.endpoints;
21:
22: import org.apache.synapse.endpoints.Endpoint;
23: import org.apache.synapse.config.XMLToObjectMapper;
24: import org.apache.axiom.om.OMElement;
25:
26: /**
27: * All endpoint factories should implement this interface. Use EndpointAbstractFactory to obtain the
28: * correct endpoint factory for particular endpoint configuration. As endpoints can be nested inside
29: * each other, EndpointFactory implementations may call other EndpointFactory implementations recursively
30: * to obtain the required endpoint hierarchy.
31: *
32: * This also serves as the XMLToObjactMapper implementation for specific endpoint implementations.
33: * If the endpoint type is not known use XMLToEndpointMapper as the generic XMLToObjectMapper for
34: * all endpoints.
35: */
36: public interface EndpointFactory extends XMLToObjectMapper {
37:
38: /**
39: * Creates the Endpoint implementation for the given XML endpoint configuration. If the endpoint
40: * configuration is an inline one, it should be anonymous endpoint. If it is defined as an immediate
41: * child element of the <definitions> it should have a name, which is used as the key in local registry.
42: *
43: * @param epConfig OMElement conatining the endpoint configuration.
44: * @param anonymousEndpoint false if the endpoint has a name. true otherwise.
45: * @return Endpoint implementation for the given configuration.
46: */
47: public Endpoint createEndpoint(OMElement epConfig,
48: boolean anonymousEndpoint);
49: }
|