01: package com.bostech.corporation.component.x12splitter;
02:
03: import javax.jbi.component.ComponentContext;
04: import javax.jbi.messaging.MessageExchange;
05: import javax.xml.namespace.QName;
06:
07: import com.bostech.corporation.component.x12splitter.processors.X12SplitterProviderProcessor;
08: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.IComponentProcessor;
09: import com.bostechcorp.cbesb.runtime.ccsl.jbi.messaging.LifeCycleEndpoint;
10:
11: public class X12SplitterEndpoint extends LifeCycleEndpoint {
12:
13: protected QName destinationServiceName = null;
14:
15: protected String destinationEndpointName = null;
16:
17: protected ComponentContext context;
18:
19: /* Setter for the destinationServiceName */
20: public void setDestinationServiceName(QName value) {
21: this .destinationServiceName = value;
22: }
23:
24: /* Getter for the destinationServiceName */
25: public QName getDestinationServiceName() {
26: return this .destinationServiceName;
27: }
28:
29: /* Setter for the destinationEndpointName */
30: public void setDestinationEndpointName(String value) {
31: this .destinationEndpointName = value;
32: }
33:
34: /* Getter for the destinationEndpointName */
35: public String getDestinationEndpointName() {
36: return this .destinationEndpointName;
37: }
38:
39: public void setContext(ComponentContext context) {
40: this .context = context;
41: }
42:
43: protected IComponentProcessor createProviderProcessor() {
44: X12SplitterProviderProcessor provider = new X12SplitterProviderProcessor(
45: this );
46: provider.setMessageExchangeFactory(exchangeFactory);
47: provider.setChannel(channel);
48: provider.setContext(context);
49: return provider;
50: }
51:
52: protected IComponentProcessor createConsumerProcessor() {
53: return null;
54: }
55:
56: public void processAsConsumer(MessageExchange exchange)
57: throws Exception {
58: Exception e = new Exception(
59: "X12Splitter component doesn't support Consumer role ");
60: exchange.setError(e);
61: channel.send(exchange);
62: throw e;
63: }
64: }
|