Added:
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java?view=auto&rev=530117
==============================================================================
---
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java
(added)
+++
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java
Wed Apr 18 11:27:39 2007
@@ -0,0 +1,149 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.transport.jbi;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.jbi.JBIException;
+import javax.jbi.messaging.DeliveryChannel;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.AbstractTransportFactory;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.ConduitInitiator;
+import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.Destination;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+
+public class JBITransportFactory extends AbstractTransportFactory implements
ConduitInitiator,
+ DestinationFactory {
+
+ public static final String TRANSPORT_ID =
"http://cxf.apache.org/transports/jbi";
+
+ private static final Logger LOG =
LogUtils.getL7dLogger(JBITransportFactory.class);
+
+ private DeliveryChannel deliveryChannel;
+ private Bus bus;
+ private final Map<String, JBIDestination> destinationMap = new
HashMap<String, JBIDestination>();
+
+
+ private Collection<String> activationNamespaces;
+
+ @Resource
+ public void setBus(Bus b) {
+ bus = b;
+ }
+
+ public Bus getBus() {
+ return bus;
+ }
+
+ public Set<String> getUriPrefixes() {
+ return Collections.singleton("jbi");
+ }
+
+ @Resource
+ public void setActivationNamespaces(Collection<String> ans) {
+ activationNamespaces = ans;
+ }
+
+
+ @PostConstruct
+ void registerWithBindingManager() {
+ if (null == bus) {
+ return;
+ }
+ ConduitInitiatorManager cim =
bus.getExtension(ConduitInitiatorManager.class);
+ if (null != cim && null != activationNamespaces) {
+ for (String ns : activationNamespaces) {
+ cim.registerConduitInitiator(ns, this);
+ }
+ }
+ DestinationFactoryManager dfm =
bus.getExtension(DestinationFactoryManager.class);
+ if (null != dfm && null != activationNamespaces) {
+ for (String ns : activationNamespaces) {
+ dfm.registerDestinationFactory(ns, this);
+ }
+ }
+ }
+
+
+ public DeliveryChannel getDeliveryChannel() {
+ return deliveryChannel;
+ }
+
+ public void setDeliveryChannel(DeliveryChannel newDeliverychannel) {
+ LOG.info(new org.apache.cxf.common.i18n.Message(
+ "CONFIG.DELIVERY.CHANNEL", LOG).toString() + newDeliverychannel);
+ deliveryChannel = newDeliverychannel;
+ }
+
+ public Conduit getConduit(EndpointInfo targetInfo) throws IOException {
+ return getConduit(targetInfo, null);
+ }
+
+ public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType
target) throws IOException {
+ Conduit conduit = new JBIConduit(target, deliveryChannel);
+ Configurer configurer = bus.getExtension(Configurer.class);
+ if (null != configurer) {
+ configurer.configureBean(conduit);
+ }
+ return conduit;
+ }
+
+ public Destination getDestination(EndpointInfo ei) throws IOException {
+ JBIDestination destination = new JBIDestination(ei, deliveryChannel);
+ Configurer configurer = bus.getExtension(Configurer.class);
+ if (null != configurer) {
+ configurer.configureBean(destination);
+ }
+ try {
+ putDestination(ei.getAddress(), destination);
+ } catch (JBIException e) {
+ throw new IOException(e.getMessage());
+ }
+ return destination;
+ }
+
+ public void putDestination(String epName, JBIDestination destination)
throws JBIException {
+ if (destinationMap.containsKey(epName)) {
+ throw new JBIException("JBIDestination for Endpoint "
+ + epName + " already be created");
+ } else {
+ destinationMap.put(epName, destination);
+ }
+ }
+
+ public JBIDestination getDestination(String epName) {
+ return destinationMap.get(epName);
+ }
+}
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBITransportFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/Messages.properties
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/Messages.properties?view=auto&rev=530117
==============================================================================
---
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/Messages.properties
(added)
+++
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/Messages.properties
Wed Apr 18 11:27:39 2007
@@ -0,0 +1,46 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+NOT.IMPLEMENTED=not yet implemented
+INVOKE.SERVICE=invoking service\t
+CREATE.MESSAGE.EXCHANGE=create message exchange svc:\t
+EXCHANGE.ENDPOINT=exchange endpoint:\t
+NO.MESSAGE=no message yet
+UNABLE.RETRIEVE.MESSAGE=unable to retrieve message
+CONTEXT.MUST.BE=context must be of type JBIOutputStreamMessageContext
+RECEIVED.MESSAGE=received message:\t
+ACTIVE.JBI.SERVER.TRANSPORT=activating JBI server transport
+BUILDING.DOCUMENT=building document from bytes
+CREATE.NORMALIZED.MESSAGE=creating NormalizedMessage
+POST.DISPATCH=postDispatch sending out message to NWR
+ERROR.SEND.MESSAGE=error sending Out message
+DISPATCH.MESSAGE.ON.CALLBACK=dispatching message on callback:\t
+ERROR.PREPARE.MESSAGE=error preparing message
+RECEIVE.THREAD.START=JBIServerTransport message receiving thread started
+DISPATCH.TO.SU=dispatching to CXF service unit
+NO.SU.FOUND=no CXFServiceUnit found
+ERROR.DISPATCH.THREAD=error running dispatch thread
+JBI.SERVER.TRANSPORT.MESSAGE.PROCESS.THREAD.EXIT=JBIServerTransport message
processing thread exitting
+CONFIG.DELIVERY.CHANNEL=configuring DeliveryChannel:\t
+CONFIG.SU.MANAGER=configuring ServiceUnitManager:\t
+JBI.TRANSPORT.FACTORY.NOT.INITIALIZED=JBITransportFactory is not properly
initialised
+SU.MANAGER=CXFServiceUnitManager:\t
+DELIVERY.CHANNEL=DeliveryChannel:\t
+JBI.TRANSPORT.FACTORY.NOT.FULLY.INITIALIZED=JBITransport factory not fully
initalised
+CREATE.SERVER.TRANSPORT=creating JBI server transport
+CREATE.CLIENT.TRANSPORT=creating JBI client transport
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/Messages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/Messages.properties
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/Messages.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/bus-extensions.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/bus-extensions.xml?view=auto&rev=530117
==============================================================================
---
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/bus-extensions.xml
(added)
+++
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/bus-extensions.xml
Wed Apr 18 11:27:39 2007
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<extensions xmlns="http://cxf.apache.org/bus/extension">
+
+ <extension class="org.apache.cxf.transport.jbi.JBITransportFactory"
deferred="true">
+ <namespace>http://cxf.apache.org/transports/jbi</namespace>
+ <namespace>http://cxf.apache.org/transports/jbi/configuration</namespace>
+ </extension>
+
+</extensions>
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/bus-extensions.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added:
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/cxf/cxf-extension-jbi.xml
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/cxf/cxf-extension-jbi.xml?view=auto&rev=530117
==============================================================================
---
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/cxf/cxf-extension-jbi.xml
(added)
+++
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/cxf/cxf-extension-jbi.xml
Wed Apr 18 11:27:39 2007
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:foo="http://cxf.apache.org/configuration/foo"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean class="org.apache.cxf.transport.jbi.JBITransportFactory"
lazy-init="true">
+ <property name="bus" ref="cxf"/>
+ <property name="transportIds">
+ <list>
+ <value>http://cxf.apache.org/transports/jbi</value>
+ <value>http://cxf.apache.org/transports/jbi/configuration</value>
+ </list>
+ </property>
+ </bean>
+</beans>
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/cxf/cxf-extension-jbi.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/cxf/cxf-extension-jbi.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange:
incubator/cxf/trunk/rt/transports/jbi/src/main/resources/META-INF/cxf/cxf-extension-jbi.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml