xref: /aoo41x/main/ridljar/com/sun/star/uno/IBridge.java (revision a046d00f)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package com.sun.star.uno;
25 
26 import java.io.IOException;
27 
28 /**
29  * This is abstract interface for bridges.
30  *
31  * <p>Bridges are able to map one object from one UNO environment to another and
32  * vice versa.<p>
33  *
34  * @see com.sun.star.uno.IBridge
35  * @see com.sun.star.uno.IQueryInterface
36  * @see com.sun.star.uno.UnoRuntime
37  *
38  * @deprecated As of UDK 3.2, this interface is deprecated, without offering a
39  * replacement.
40  */
41 public interface IBridge {
42     /**
43      * Maps an object from the source environment to the destination
44      * environment.
45      *
46      * @param object the object to map
47      * @param type the type of the interface that shall be mapped
48      * @return the object in the destination environment
49      */
mapInterfaceTo(Object object, Type type)50     Object mapInterfaceTo(Object object, Type type);
51 
52     /**
53      * Maps an object from the destination environment to the source
54      * environment.
55      *
56      * @param object the object to map
57      * @param type the type of the interface that shall be mapped
58      * @return the object in the source environment
59      */
mapInterfaceFrom(Object object, Type type)60     Object mapInterfaceFrom(Object object, Type type);
61 
62     /**
63      * Returns the source environment.
64      *
65      * @return the source environment of this bridge
66      */
getSourceEnvironment()67     IEnvironment getSourceEnvironment();
68 
69     /**
70      * Returns the destination environment.
71      *
72      * @return the destination environment of this bridge
73      */
getTargetEnvironment()74     IEnvironment getTargetEnvironment();
75 
76     /**
77      * Increases the life count.
78      */
acquire()79     void acquire();
80 
81     /**
82      * Decreases the life count.
83      *
84      * <p>If the life count drops to zero, the bridge disposes itself.</p>
85      */
release()86     void release();
87 
88     /**
89      * Disposes the bridge.
90      *
91      * <p>Sends involved threads an <code>InterruptedException</code>.  Releases
92      * mapped objects.</p>
93      */
dispose()94     void dispose() throws InterruptedException, IOException;
95 }
96