KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > servicemix > components > wsif > WSIFOutBinding


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.servicemix.components.wsif;
18
19 import javax.jbi.messaging.MessageExchange;
20 import javax.jbi.messaging.NormalizedMessage;
21
22 import org.apache.servicemix.components.util.OutBinding;
23 import org.apache.wsif.WSIFMessage;
24 import org.apache.wsif.WSIFOperation;
25
26 /**
27  * Consumers JBI messages and sends them as a oneway into WSIF
28  *
29  * @version $Revision: 429277 $
30  */

31 public class WSIFOutBinding extends OutBinding {
32
33     private WSIFMarshaler marshaler = new WSIFMarshaler();
34     private WSIFOperationMap operationMap;
35
36     /**
37      * @deprecated use getMarshaler instead
38      */

39     public WSIFMarshaler getMarshaller() {
40         return marshaler;
41     }
42
43     /**
44      * @deprecated use setMarshaler instead
45      */

46     public void setMarshaller(WSIFMarshaler marshaler) {
47         this.marshaler = marshaler;
48     }
49
50     /**
51      * @return the marshaler
52      */

53     public WSIFMarshaler getMarshaler() {
54         return marshaler;
55     }
56
57     /**
58      * @param marshaler the marshaler to set
59      */

60     public void setMarshaler(WSIFMarshaler marshaler) {
61         this.marshaler = marshaler;
62     }
63
64     public WSIFOperationMap getOperationMap() {
65         return operationMap;
66     }
67
68     public void setOperationMap(WSIFOperationMap operationMap) {
69         this.operationMap = operationMap;
70     }
71
72     // Implementation methods
73
//-------------------------------------------------------------------------
74
protected void process(MessageExchange exchange, NormalizedMessage normalizedMessage) throws Exception JavaDoc {
75         WSIFOperationInfo operationInfo = operationMap.getOperationForExchange(exchange);
76         WSIFOperation operation = operationInfo.createWsifOperation();
77         WSIFMessage message = operation.createInputMessage();
78         marshaler.fromNMS(operationInfo, message, normalizedMessage, getBody(normalizedMessage));
79         operation.executeInputOnlyOperation(message);
80         done(exchange);
81     }
82 }
83
Popular Tags