01: /*
02: * $Id:TransportEndpointDefinitionParser.java 8321 2007-09-10 19:22:52Z acooke $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.config.spring.parsers.specific.endpoint;
12:
13: import org.mule.config.spring.parsers.specific.endpoint.support.AddressedEndpointDefinitionParser;
14: import org.mule.config.spring.parsers.specific.endpoint.support.ChildEndpointDefinitionParser;
15: import org.mule.endpoint.URIBuilder;
16:
17: /**
18: * This is intended for use by endpoint-specific parsers for non-global endpoint
19: * elements.
20: *
21: * <p>It generates both an endpoint (which should subclass
22: * {@link org.mule.api.endpoint.ImmutableEndpoint}) and a
23: * {@link org.mule.endpoint.URIBuilder}. The URI is
24: * then injected into the endpoint. So the associated schema can enable any of the
25: * suitable {@link org.mule.endpoint.URIBuilder# ALL_ATTRIBUTES}
26: * or add appropriate mappings.
27: */
28: public class TransportEndpointDefinitionParser extends
29: AddressedEndpointDefinitionParser {
30:
31: public TransportEndpointDefinitionParser(String protocol,
32: Class endpoint, String[] requiredAddressAttributes) {
33: this (protocol, PROTOCOL, endpoint, requiredAddressAttributes);
34: }
35:
36: public TransportEndpointDefinitionParser(String metaOrProtocol,
37: boolean isMeta, Class endpoint,
38: String[] requiredAddressAttributes) {
39: this (metaOrProtocol, isMeta, endpoint,
40: requiredAddressAttributes, new String[] {});
41: }
42:
43: /**
44: * @param metaOrProtocol The transport metaOrProtocol ("tcp" etc)
45: * @param isMeta Whether transport is "meta" or not (eg cxf)
46: * @param endpoint The endpoint class to construct
47: * @param requiredAddressAttributes A list of attribute names that are required if "address"
48: * isn't present
49: * @param requiredProperties A list of property names that are required if "address" isn't present
50: */
51: public TransportEndpointDefinitionParser(String metaOrProtocol,
52: boolean isMeta, Class endpoint,
53: String[] requiredAddressAttributes,
54: String[] requiredProperties) {
55: super (metaOrProtocol, isMeta,
56: new ChildEndpointDefinitionParser(endpoint),
57: requiredAddressAttributes, requiredProperties);
58: }
59:
60: public TransportEndpointDefinitionParser(String metaOrProtocol,
61: boolean isMeta, Class endpoint,
62: String[] endpointAttributes,
63: String[][] requiredAddressAttributes,
64: String[][] requiredProperties) {
65: this (metaOrProtocol, isMeta, endpoint, endpointAttributes,
66: URIBuilder.ALL_ATTRIBUTES, requiredAddressAttributes,
67: requiredProperties);
68: }
69:
70: public TransportEndpointDefinitionParser(String metaOrProtocol,
71: boolean isMeta, Class endpoint,
72: String[] endpointAttributes, String[] addressAttributes,
73: String[][] requiredAddressAttributes,
74: String[][] requiredProperties) {
75: super (metaOrProtocol, isMeta,
76: new ChildEndpointDefinitionParser(endpoint),
77: endpointAttributes, addressAttributes,
78: requiredAddressAttributes, requiredProperties);
79: }
80:
81: }
|