1
2
3
4
5
6
7
8
9
10
11 package org.mule.config.spring.factories;
12
13 import org.mule.api.endpoint.EndpointBuilder;
14 import org.mule.api.endpoint.EndpointException;
15 import org.mule.api.endpoint.OutboundEndpoint;
16 import org.mule.api.registry.ServiceType;
17 import org.mule.endpoint.EndpointURIEndpointBuilder;
18 import org.mule.transport.service.TransportServiceDescriptor;
19
20
21
22
23 public class OutboundEndpointFactoryBean extends AbstractEndpointFactoryBean
24 {
25
26 public OutboundEndpointFactoryBean(EndpointURIEndpointBuilder global) throws EndpointException
27 {
28 super(global);
29 }
30
31 public OutboundEndpointFactoryBean()
32 {
33 super();
34 }
35
36 public Class getObjectType()
37 {
38 return OutboundEndpoint.class;
39 }
40
41 public Object doGetObject() throws Exception
42 {
43
44 String scheme = getEndpointBuilder().getEndpoint().getFullScheme();
45 TransportServiceDescriptor tsd = (TransportServiceDescriptor) muleContext.getRegistry().lookupServiceDescriptor(ServiceType.TRANSPORT, scheme, null);
46 EndpointBuilder endpointBuilder = tsd.createEndpointBuilder(this);
47
48 return muleContext.getEndpointFactory().getOutboundEndpoint(endpointBuilder);
49 }
50
51 }