KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > demo > mortgage > gui > mock > DeliveryChannelMock


1 /**
2  * PETALS - PETALS Services Platform.
3  * Copyright (c) 2005 EBM Websourcing, http://www.ebmwebsourcing.com/
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * -------------------------------------------------------------------------
19  * $Id: DeliveryChannelMock.java 09:50:02 ddesjardins $
20  * -------------------------------------------------------------------------
21  */

22 package org.objectweb.petals.demo.mortgage.gui.mock;
23
24 import javax.jbi.messaging.DeliveryChannel;
25 import javax.jbi.messaging.MessageExchange;
26 import javax.jbi.messaging.MessageExchangeFactory;
27 import javax.jbi.messaging.MessagingException;
28 import javax.jbi.servicedesc.ServiceEndpoint;
29 import javax.xml.namespace.QName JavaDoc;
30
31 /**
32  * Mock of DeliveryChannel
33  *
34  * @author ddesjardins - eBMWebsourcing
35  */

36 public class DeliveryChannelMock implements DeliveryChannel {
37
38     public MessageExchange accept() throws MessagingException {
39         return null;
40     }
41
42     public MessageExchange accept(long timeoutMS) throws MessagingException,
43         IllegalArgumentException JavaDoc {
44         return null;
45     }
46
47     public void close() throws MessagingException {
48     }
49
50     public MessageExchangeFactory createExchangeFactory() {
51         return null;
52     }
53
54     public MessageExchangeFactory createExchangeFactory(QName JavaDoc interfaceName) {
55         return new MessageExchangeFactoryMock();
56     }
57
58     public MessageExchangeFactory createExchangeFactory(ServiceEndpoint endpoint) {
59         return null;
60     }
61
62     public MessageExchangeFactory createExchangeFactoryForService(
63         QName JavaDoc serviceName) {
64         return null;
65     }
66
67     public void send(MessageExchange exchange) throws MessagingException {
68         this.exchange = exchange;
69     }
70
71     private MessageExchange exchange;
72
73     public MessageExchange getExchange() {
74         return exchange;
75     }
76
77     public boolean sendSync(MessageExchange exchange) throws MessagingException {
78         return false;
79     }
80
81     public boolean sendSync(MessageExchange exchange, long timeoutMS)
82         throws MessagingException {
83         return false;
84     }
85
86 }
87
Popular Tags