01: /*
02: * $Id: InboundEndpointFactoryBean.java 11343 2008-03-13 10:58:26Z tcarlson $
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.factories;
12:
13: import org.mule.api.config.ConfigurationException;
14: import org.mule.api.endpoint.EndpointException;
15: import org.mule.api.endpoint.EndpointFactory;
16: import org.mule.api.endpoint.InboundEndpoint;
17: import org.mule.config.i18n.MessageFactory;
18: import org.mule.endpoint.EndpointURIEndpointBuilder;
19:
20: /**
21: * Spring FactoryBean used to create concrete instances of inbound endpoints
22: */
23: public class InboundEndpointFactoryBean extends
24: AbstractEndpointFactoryBean {
25:
26: public InboundEndpointFactoryBean(EndpointURIEndpointBuilder global)
27: throws EndpointException {
28: super (global);
29: }
30:
31: public InboundEndpointFactoryBean() {
32: super ();
33: }
34:
35: public Class getObjectType() {
36: return InboundEndpoint.class;
37: }
38:
39: public Object doGetObject() throws Exception {
40: EndpointFactory ef = muleContext.getRegistry()
41: .lookupEndpointFactory();
42: if (ef != null) {
43: return ef.getInboundEndpoint(this );
44: } else {
45: throw new ConfigurationException(
46: MessageFactory
47: .createStaticMessage("EndpointFactory not found in Registry"));
48: }
49: }
50:
51: }
|