01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */package org.apache.cxf.transport.jbi;
19:
20: import java.io.IOException;
21: import java.io.OutputStream;
22: import java.util.logging.Level;
23: import java.util.logging.Logger;
24:
25: import javax.jbi.messaging.DeliveryChannel;
26:
27: import org.apache.cxf.Bus;
28: import org.apache.cxf.common.logging.LogUtils;
29: import org.apache.cxf.message.Message;
30: import org.apache.cxf.transport.AbstractConduit;
31: import org.apache.cxf.ws.addressing.EndpointReferenceType;
32:
33: public class JBIConduit extends AbstractConduit {
34:
35: private static final Logger LOG = LogUtils
36: .getL7dLogger(JBIConduit.class);
37:
38: private DeliveryChannel channel;
39: private Bus bus;
40:
41: public JBIConduit(EndpointReferenceType target, DeliveryChannel dc) {
42: this (null, target, dc);
43: }
44:
45: public JBIConduit(Bus b, EndpointReferenceType target,
46: DeliveryChannel dc) {
47: super (target);
48: channel = dc;
49: bus = b;
50: }
51:
52: public Bus getBus() {
53: return bus;
54: }
55:
56: protected Logger getLogger() {
57: return LOG;
58: }
59:
60: public void prepare(Message message) throws IOException {
61: getLogger().log(Level.FINE, "JBIConduit send message");
62:
63: message.setContent(OutputStream.class,
64: new JBIConduitOutputStream(message, channel, target,
65: this));
66: }
67: }
|