You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ge...@apache.org on 2008/08/29 13:21:58 UTC

svn commit: r690188 - in /servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api: ClientFactory.java Container.java Destination.java EndpointFilter.java EndpointResolver.java ServiceMixClient.java

Author: gertv
Date: Fri Aug 29 04:21:58 2008
New Revision: 690188

URL: http://svn.apache.org/viewvc?rev=690188&view=rev
Log:
SM-1455: Moving more interfaces to servicemix-utils to create a ServiceMix API

Added:
    servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ClientFactory.java
    servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Container.java
    servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Destination.java
    servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointFilter.java
    servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointResolver.java
    servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ServiceMixClient.java

Added: servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ClientFactory.java
URL: http://svn.apache.org/viewvc/servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ClientFactory.java?rev=690188&view=auto
==============================================================================
--- servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ClientFactory.java (added)
+++ servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ClientFactory.java Fri Aug 29 04:21:58 2008
@@ -0,0 +1,43 @@
+/*
+ * 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.servicemix.jbi.api;
+
+import javax.jbi.JBIException;
+
+
+/**
+ * An interface that defines a factory to create ServiceMixClient.
+ * An implementation should be bound in the JNDI context
+ * 
+ * @author <a href="mailto:gnodet [at] apache.org">Guillaume Nodet</a>
+ */
+public interface ClientFactory {
+
+    /**
+     * Default location to where the object should be looked for in JNDI
+     */
+    String DEFAULT_JNDI_NAME = "java:comp/env/jbi/ClientFactory";
+    
+    /**
+     * Create a new client to interact with the JBI bus
+     * 
+     * @return a client
+     * @throws JBIException if an error occurs
+     */
+    ServiceMixClient createClient() throws JBIException;
+    
+}

Added: servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Container.java
URL: http://svn.apache.org/viewvc/servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Container.java?rev=690188&view=auto
==============================================================================
--- servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Container.java (added)
+++ servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Container.java Fri Aug 29 04:21:58 2008
@@ -0,0 +1,31 @@
+/*
+ * 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.servicemix.jbi.api;
+
+/**
+ * Represents the ServiceMix JBI container
+ */
+public interface Container {
+    
+    /**
+     * Get a {@link ClientFactory} for building a client to access this container
+     * 
+     * @return the factory
+     */
+    ClientFactory getClientFactory();
+
+}

Added: servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Destination.java
URL: http://svn.apache.org/viewvc/servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Destination.java?rev=690188&view=auto
==============================================================================
--- servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Destination.java (added)
+++ servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/Destination.java Fri Aug 29 04:21:58 2008
@@ -0,0 +1,71 @@
+/*
+ * 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.servicemix.jbi.api;
+
+import javax.jbi.messaging.InOnly;
+import javax.jbi.messaging.InOptionalOut;
+import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.RobustInOnly;
+
+/**
+ * Represents a JBI endpoint you can communicate with
+ * 
+ * @version $Revision: $
+ */
+public interface Destination {
+
+    /**
+     * Creates an {@link InOnly} (one way) message exchange.
+     * 
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOnly createInOnlyExchange() throws MessagingException;
+
+    /**
+     * Creates an {@link InOut} (request-reply) message exchange.
+     * 
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOut createInOutExchange() throws MessagingException;
+
+    /**
+     * Creates an {@link InOptionalOut} (optional request-reply) message
+     * exchange.
+     * 
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOptionalOut createInOptionalOutExchange() throws MessagingException;
+
+    /**
+     * Creates an {@link RobustInOnly} (one way) message exchange.
+     * 
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    RobustInOnly createRobustInOnlyExchange() throws MessagingException;
+
+    /**
+     * Allows a Message to be created for an {@link InOnly} exchange for simpler one-way messaging.
+     * @throws MessagingException 
+     */
+    Message createInOnlyMessage() throws MessagingException;
+
+}

Added: servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointFilter.java
URL: http://svn.apache.org/viewvc/servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointFilter.java?rev=690188&view=auto
==============================================================================
--- servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointFilter.java (added)
+++ servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointFilter.java Fri Aug 29 04:21:58 2008
@@ -0,0 +1,35 @@
+/*
+ * 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.servicemix.jbi.api;
+
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.servicedesc.ServiceEndpoint;
+
+/**
+ * Represents a filter used to exclude endpoints before choosing which endpoint to use
+ *
+ * @version $Revision: 564607 $
+ */
+public interface EndpointFilter {
+
+    /**
+     * Performs the filter on the endpoint returning true if the endpoint is suitable, based on some
+     * capabilities evaluation or false if the endpoint should be ignored.
+     */
+    boolean evaluate(ServiceEndpoint endpoint, MessageExchange exchange);
+
+}

Added: servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointResolver.java
URL: http://svn.apache.org/viewvc/servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointResolver.java?rev=690188&view=auto
==============================================================================
--- servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointResolver.java (added)
+++ servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/EndpointResolver.java Fri Aug 29 04:21:58 2008
@@ -0,0 +1,49 @@
+/*
+ * 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.servicemix.jbi.api;
+
+import javax.jbi.JBIException;
+import javax.jbi.component.ComponentContext;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.servicedesc.ServiceEndpoint;
+
+/**
+ * A Strategy pattern which can be used to plug in different {@link ServiceEndpoint} resolving policies from static
+ * relationships to dynamic resolution of the endpoint used based on some policy.
+ *
+ * @version $Revision: 426415 $
+ */
+public interface EndpointResolver {
+
+    /**
+     * Resolves the endpoint which should be used for the given message exchange
+     * using either a hard coded endpoint or some policy which chooses the endpoint
+     * dynamically using some algorithm.
+     *
+     * @param context  is the component context
+     * @param exchange the message exchange which the endpoint will be used for which may
+     *                 contain some state to help choose the algorithm.
+     * @param filter the filter to be applied to the available endpoints
+     * @return the chosen endpoint or null if no endpoint could be found.
+     */
+    ServiceEndpoint resolveEndpoint(ComponentContext context, MessageExchange exchange, EndpointFilter filter) throws JBIException;
+
+    /**
+     * Resolves all the available endpoints which may not be applicable to a component.
+     */ 
+    ServiceEndpoint[] resolveAvailableEndpoints(ComponentContext context, MessageExchange exchange) throws JBIException;
+}

Added: servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ServiceMixClient.java
URL: http://svn.apache.org/viewvc/servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ServiceMixClient.java?rev=690188&view=auto
==============================================================================
--- servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ServiceMixClient.java (added)
+++ servicemix/utils/trunk/src/main/java/org/apache/servicemix/jbi/api/ServiceMixClient.java Fri Aug 29 04:21:58 2008
@@ -0,0 +1,369 @@
+/*
+ * 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.servicemix.jbi.api;
+
+import java.util.Map;
+
+import javax.jbi.JBIException;
+import javax.jbi.component.ComponentContext;
+import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.Fault;
+import javax.jbi.messaging.InOnly;
+import javax.jbi.messaging.InOptionalOut;
+import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessageExchangeFactory;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.RobustInOnly;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.xml.namespace.QName;
+
+
+/**
+ * Represents a client  API which allows users to programatically send messages into the JBI
+ * container or to receive them using the regular JBI API together with a collection of helper methods making it
+ * easier to interact with the JBI API.
+ *
+ * @version $Revision: 564374 $
+ */
+public interface ServiceMixClient {
+
+
+    // Core JBI methods
+    //-------------------------------------------------------------------------
+
+    /**
+     * Sends the message exchange to the endpoint.
+     *
+     * @param exchange
+     * @throws MessagingException
+     */
+    void send(MessageExchange exchange) throws MessagingException;
+
+    /**
+     * Sends an In-Only message
+     * 
+     * @param message
+     */
+    void send(Message message) throws MessagingException;
+    
+    /**
+     * Sends the message exchange to the endpoint, blocking until the send has completed.
+     *
+     * @param exchange
+     * @throws MessagingException
+     * @return true if the exchange has been processed and returned by the
+     *  servicing component, false otherwise.
+     */
+    boolean sendSync(MessageExchange exchange) throws MessagingException;
+
+    /**
+     * Sends the message exchange to the endpoint, blocking until the send has completed
+     * or the specified timeout has elapsed.
+     *
+     * @param exchange
+     * @param timeout
+     * @throws MessagingException
+     * @return true if the exchange has been processed and returned by the
+     *  servicing component, false otherwise.
+     */
+    boolean sendSync(MessageExchange exchange, long timeout) throws MessagingException;
+
+    /**
+     * Receives an inbound message exchange, blocking forever until one is available.
+     *
+     * @return the received message exchange
+     * @throws MessagingException
+     */
+    MessageExchange receive() throws MessagingException;
+
+    /**
+     * Receives an inbound message exchange, blocking until the given timeout period.
+     *
+     * @param timeout the maximum amount of time to wait for a message
+     * @return the received message exchange or null if the timeout occurred.
+     * @throws MessagingException
+     */
+    MessageExchange receive(long timeout) throws MessagingException;
+
+
+    /**
+     * Performs a request-response (using an {@link InOut} to the endpoint denoted by the given resolver,
+     * blocking until the response is received and then returning the result.
+     *
+     * @param resolver            the resolver used to resolve and choose the endpoint, which if null is used
+     *                            then the container configured routing rules are used to dispatch the message to the destination
+     * @param exchangeProperties  the properties used for the exchange or null if no properties are required
+     * @param inMessageProperties the properties used for the in message or null if no properties are required
+     * @param content             the body of the message
+     * @throws JBIException if the message could not be dispatched for some reason.
+     */
+    Object request(EndpointResolver resolver, Map exchangeProperties, Map inMessageProperties, Object content) throws JBIException;
+
+    /**
+     * Sends a one way message exchange to the endpoint denoted by the given resolver
+     *
+     * @param resolver            the resolver used to resolve and choose the endpoint, which if null is used
+     *                            then the container configured routing rules are used to dispatch the message to the destination
+     * @param exchangeProperties  the properties used for the exchange or null if no properties are required
+     * @param inMessageProperties the properties used for the in message or null if no properties are required
+     * @param content             the body of the message
+     * @throws JBIException if the message could not be dispatched for some reason.
+     */
+    void send(EndpointResolver resolver, Map exchangeProperties, Map inMessageProperties, Object content) throws JBIException;
+
+    /**
+     * Sends a one way message exchange to the endpoint denoted by the given resolver and blocks until the send is completed.
+     *
+     * @param resolver            the resolver used to resolve and choose the endpoint, which if null is used
+     *                            then the container configured routing rules are used to dispatch the message to the destination
+     * @param exchangeProperties  the properties used for the exchange or null if no properties are required
+     * @param inMessageProperties the properties used for the in message or null if no properties are required
+     * @param content             the body of the message
+     * @return true if the exchange has been processed and returned by the
+     *  servicing component, false otherwise.
+     * @throws JBIException if the message could not be dispatched for some reason.
+     */
+    boolean sendSync(EndpointResolver resolver, Map exchangeProperties, Map inMessageProperties, Object content) throws JBIException;
+
+
+    /**
+     * Performs a request-response (using an {@link InOut} to the endpoint denoted by the given resolver,
+     * blocking until the response is received and then returning the result.
+     *
+     * @param inMessageProperties the properties used for the in message or null if no properties are required
+     * @param content             the body of the message
+     * @throws JBIException if the message could not be dispatched for some reason.
+     */
+    Object request(Map inMessageProperties, Object content) throws JBIException;
+
+    /**
+     * Sends a one way message exchange to the endpoint denoted by the given resolver
+     *
+     * @param inMessageProperties the properties used for the in message or null if no properties are required
+     * @param content             the body of the message
+     * @throws JBIException if the message could not be dispatched for some reason.
+     */
+    void send(Map inMessageProperties, Object content) throws JBIException;
+
+    /**
+     * Sends a one way message exchange to the endpoint denoted by the given resolver and blocks until the send is completed.
+     *
+     * @param inMessageProperties the properties used for the in message or null if no properties are required
+     * @param content             the body of the message
+     * @return true if the exchange has been processed and returned by the
+     *  servicing component, false otherwise.
+     * @throws JBIException if the message could not be dispatched for some reason.
+     */
+    boolean sendSync(Map inMessageProperties, Object content) throws JBIException;
+
+
+
+    // Factory methods to make MessageExchange instances
+    //-------------------------------------------------------------------------
+
+    /**
+     * Creates an {@link InOnly} (one way) message exchange.
+     *
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOnly createInOnlyExchange() throws MessagingException;
+
+    /**
+     * Creates an {@link InOnly} (one way) message exchange with the given resolver.
+     *
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOnly createInOnlyExchange(EndpointResolver resolver) throws JBIException;
+
+    /**
+     * Creates an {@link InOut} (request-reply) message exchange.
+     *
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOut createInOutExchange() throws MessagingException;
+
+    /**
+     * Creates an {@link InOut} (request-reply) message exchange with the given resolver.
+     *
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOut createInOutExchange(EndpointResolver resolver) throws JBIException;
+
+    /**
+     * Creates an {@link InOptionalOut} (optional request-reply) message exchange.
+     *
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOptionalOut createInOptionalOutExchange() throws MessagingException;
+
+    /**
+     * Creates an {@link InOptionalOut} (optional request-reply) message exchange with the given resolver.
+     *
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    InOptionalOut createInOptionalOutExchange(EndpointResolver resolver) throws JBIException;
+
+    /**
+     * Creates an {@link RobustInOnly} (one way) message exchange.
+     *
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    RobustInOnly createRobustInOnlyExchange() throws MessagingException;
+
+    /**
+     * Creates an {@link RobustInOnly} (one way) message exchange with the given resolver.
+     *
+     * @return the newly created message exchange
+     * @throws MessagingException
+     */
+    RobustInOnly createRobustInOnlyExchange(EndpointResolver resolver) throws JBIException;
+
+
+
+
+    /**
+     * Resolves a WS-Addressing endpoint reference String into a JBI {@link javax.jbi.servicedesc.ServiceEndpoint}
+     * reference so that message exchanges can be directed to an endpoint
+     *
+     * @param uri the WS-Addressing endpoint reference string
+     */
+    ServiceEndpoint resolveEndpointReference(String uri);
+
+
+    // Helper methods to get an endpoint resolver
+    //-------------------------------------------------------------------------
+
+    /**
+     * Creates an endpoint resolver for the given service name
+     *
+     * @param service
+     * @return the newly created entity resolver
+     */
+    EndpointResolver createResolverForService(QName service);
+
+    /**
+     * Creates an endpoint resolver for the given interface name
+     *
+     * @param interfaceName
+     * @return the newly created entity resolver
+     */
+    EndpointResolver createResolverInterface(QName interfaceName);
+
+    /**
+     * Creates an endpoint for the given external service name
+     *
+     * @param service
+     * @return the newly created entity resolver
+     */
+    EndpointResolver createResolverForExternalService(QName service);
+
+    /**
+     * Creates an endpoint for the given external interface
+     *
+     * @param interfaceName
+     * @return the newly created entity resolver
+     */
+    EndpointResolver createResolverForExternalInterface(QName interfaceName);
+
+    /**
+     * Creates an endpoint resolver for the given service and endpoint name
+     *
+     * @param service
+     * @param endpoint
+     * @return the newly created entity resolver
+     */
+    EndpointResolver createResolverForExternalInterface(QName service, String endpoint);
+
+
+    // Create a destination
+    //-------------------------------------------------------------------------
+    
+    /**
+     * Creates a destination which represents some JBI endpoint that message exchanges can be created with.
+     * @throws MessagingException 
+     */
+    Destination createDestination(String uri) throws MessagingException;
+    
+
+    // Helper methods and access to the JBI context information
+    //-------------------------------------------------------------------------
+
+
+    /**
+     * A helper method to indicate that the message exchange is complete
+     * which will set the status to {@link ExchangeStatus#DONE} and send the message
+     * on the delivery channel.
+     *
+     * @param exchange
+     * @throws MessagingException
+     */
+    void done(MessageExchange exchange) throws MessagingException;
+
+    /**
+     * A helper method which fails and completes the given exchange with the specified fault
+     */
+    void fail(MessageExchange exchange, Fault fault) throws MessagingException;
+
+    /**
+     * A helper method which fails and completes the given exchange with the specified exception
+     */
+    void fail(MessageExchange exchange, Exception error) throws MessagingException;
+
+        
+        /**
+     * Returns the current component context which can be used to activate endpoints, components and
+     * query the available service endpoints.
+     *
+     * @return the component context
+     */
+    ComponentContext getContext();
+
+    /**
+     * Returns the delivery channel for this client's message exchanges
+     *
+     * @return the delivery channel on which all this clients exchanges will occur.
+     * @throws MessagingException
+     */
+    DeliveryChannel getDeliveryChannel() throws MessagingException;
+
+    /**
+     * Returns the default message exchange factory.
+     *
+     * @return the default message exchange factory.
+     * @throws MessagingException
+     */
+    MessageExchangeFactory getExchangeFactory() throws MessagingException;
+
+
+    /**
+     * Close this client.
+     * 
+     * @throws JBIException
+     */
+    void close() throws JBIException;
+
+
+}