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 | 0 | super(global); |
29 | 0 | } |
30 | |
|
31 | |
public OutboundEndpointFactoryBean() |
32 | |
{ |
33 | 0 | super(); |
34 | 0 | } |
35 | |
|
36 | |
public Class getObjectType() |
37 | |
{ |
38 | 0 | return OutboundEndpoint.class; |
39 | |
} |
40 | |
|
41 | |
public Object doGetObject() throws Exception |
42 | |
{ |
43 | |
|
44 | 0 | String scheme = getEndpointBuilder().getEndpoint().getFullScheme(); |
45 | 0 | TransportServiceDescriptor tsd = (TransportServiceDescriptor) muleContext.getRegistry().lookupServiceDescriptor(ServiceType.TRANSPORT, scheme, null); |
46 | 0 | EndpointBuilder endpointBuilder = tsd.createEndpointBuilder(this); |
47 | |
|
48 | 0 | return muleContext.getRegistry().lookupEndpointFactory().getOutboundEndpoint(endpointBuilder); |
49 | |
} |
50 | |
|
51 | |
} |