KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > StreamConnection


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;
19
20 import java.io.InputStream JavaDoc;
21 import java.io.OutputStream JavaDoc;
22 import java.util.Map JavaDoc;
23
24 import javax.jms.Connection JavaDoc;
25 import javax.jms.Destination JavaDoc;
26 import javax.jms.InvalidDestinationException JavaDoc;
27 import javax.jms.JMSException JavaDoc;
28 import javax.jms.Topic JavaDoc;
29
30 /**
31  * The StreamConnection interface allows you to send and receive
32  * data from a Destination in using standard java InputStream and OutputStream
33  * objects. It's best use case is to send and receive large amounts of data
34  * that would be to large to hold in a single JMS message.
35  *
36  * @version $Revision$
37  */

38 public interface StreamConnection extends Connection JavaDoc {
39
40     public InputStream JavaDoc createInputStream(Destination JavaDoc dest) throws JMSException JavaDoc;
41     public InputStream JavaDoc createInputStream(Destination JavaDoc dest, String JavaDoc messageSelector) throws JMSException JavaDoc;
42     public InputStream JavaDoc createInputStream(Destination JavaDoc dest, String JavaDoc messageSelector, boolean noLocal) throws JMSException JavaDoc;
43     
44     public InputStream JavaDoc createDurableInputStream(Topic JavaDoc dest, String JavaDoc name) throws JMSException JavaDoc;
45     public InputStream JavaDoc createDurableInputStream(Topic JavaDoc dest, String JavaDoc name, String JavaDoc messageSelector) throws JMSException JavaDoc;
46     public InputStream JavaDoc createDurableInputStream(Topic JavaDoc dest, String JavaDoc name, String JavaDoc messageSelector, boolean noLocal) throws JMSException JavaDoc;
47
48     public OutputStream JavaDoc createOutputStream(Destination JavaDoc dest) throws JMSException JavaDoc;
49     public OutputStream JavaDoc createOutputStream(Destination JavaDoc dest, Map JavaDoc streamProperties, int deliveryMode,
50             int priority, long timeToLive) throws JMSException JavaDoc;
51  
52     /**
53      * Unsubscribes a durable subscription that has been created by a client.
54      * <P>
55      * This method deletes the state being maintained on behalf of the
56      * subscriber by its provider.
57      * <P>
58      * It is erroneous for a client to delete a durable subscription while there
59      * is an active <CODE>MessageConsumer </CODE> or <CODE>TopicSubscriber</CODE>
60      * for the subscription, or while a consumed message is part of a pending
61      * transaction or has not been acknowledged in the session.
62      *
63      * @param name
64      * the name used to identify this subscription
65      * @throws JMSException
66      * if the session fails to unsubscribe to the durable
67      * subscription due to some internal error.
68      * @throws InvalidDestinationException
69      * if an invalid subscription name is specified.
70      * @since 1.1
71      */

72     public void unsubscribe(String JavaDoc name) throws JMSException JavaDoc;
73 }
74
Popular Tags