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