KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > transport > Transport


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

18 package org.apache.activemq.transport;
19
20 import org.apache.activemq.Service;
21
22 import java.io.IOException JavaDoc;
23
24 /**
25  * Represents the client side of a transport allowing messages
26  * to be sent synchronously, asynchronously and consumed.
27  *
28  * @version $Revision: 1.5 $
29  */

30 public interface Transport extends Service {
31
32     /**
33      * A one way asynchronous send
34      * @param command
35      * @throws IOException
36      */

37     public void oneway(Object JavaDoc command) throws IOException JavaDoc;
38
39     /**
40      * An asynchronous request response where the Receipt will be returned
41      * in the future. If responseCallback is not null, then it will be called
42      * when the response has been completed.
43      *
44      * @param command
45      * @param responseCallback TODO
46      * @return the FutureResponse
47      * @throws IOException
48      */

49     public FutureResponse asyncRequest(Object JavaDoc command, ResponseCallback responseCallback) throws IOException JavaDoc;
50     
51     /**
52      * A synchronous request response
53      * @param command
54      * @return the response
55      * @throws IOException
56      */

57     public Object JavaDoc request(Object JavaDoc command) throws IOException JavaDoc;
58
59     /**
60      * A synchronous request response
61      * @param command
62      * @param timeout
63      * @return the repsonse or null if timeout
64      * @throws IOException
65      */

66     public Object JavaDoc request(Object JavaDoc command, int timeout) throws IOException JavaDoc;
67
68     
69 // /**
70
// * A one way asynchronous send
71
// * @param command
72
// * @throws IOException
73
// */
74
// public void oneway(Command command) throws IOException;
75
//
76
// /**
77
// * An asynchronous request response where the Receipt will be returned
78
// * in the future. If responseCallback is not null, then it will be called
79
// * when the response has been completed.
80
// *
81
// * @param command
82
// * @param responseCallback TODO
83
// * @return the FutureResponse
84
// * @throws IOException
85
// */
86
// public FutureResponse asyncRequest(Command command, ResponseCallback responseCallback) throws IOException;
87
//
88
// /**
89
// * A synchronous request response
90
// * @param command
91
// * @return the response
92
// * @throws IOException
93
// */
94
// public Response request(Command command) throws IOException;
95
//
96
// /**
97
// * A synchronous request response
98
// * @param command
99
// * @param timeout
100
// * @return the repsonse or null if timeout
101
// * @throws IOException
102
// */
103
// public Response request(Command command, int timeout) throws IOException;
104

105     /**
106      * Returns the current transport listener
107      * @return
108      */

109     public TransportListener getTransportListener();
110
111     /**
112      * Registers an inbound command listener
113      * @param commandListener
114      */

115     public void setTransportListener(TransportListener commandListener);
116     
117     /**
118      * @param target
119      * @return the target
120      */

121     public Object JavaDoc narrow(Class JavaDoc target);
122
123     /**
124      * @return the remote address for this connection
125      *
126      */

127     public String JavaDoc getRemoteAddress();
128
129 }
130
Popular Tags