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