xref: /aoo41x/main/ridljar/com/sun/star/uno/IBridge.java (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package com.sun.star.uno;
29 
30 import java.io.IOException;
31 
32 /**
33  * This is abstract interface for bridges.
34  *
35  * <p>Bridges are able to map one object from one UNO environment to another and
36  * vice versa.<p>
37  *
38  * @see com.sun.star.uno.IBridge
39  * @see com.sun.star.uno.IQueryInterface
40  * @see com.sun.star.uno.UnoRuntime
41  *
42  * @deprecated As of UDK 3.2, this interface is deprecated, without offering a
43  * replacement.
44  */
45 public interface IBridge {
46     /**
47      * Maps an object from the source environment to the destination
48      * environment.
49      *
50      * @param object the object to map
51      * @param type the type of the interface that shall be mapped
52      * @return the object in the destination environment
53      */
54     Object mapInterfaceTo(Object object, Type type);
55 
56     /**
57      * Maps an object from the destination environment to the source
58      * environment.
59      *
60      * @param object the object to map
61      * @param type the type of the interface that shall be mapped
62      * @return the object in the source environment
63      */
64     Object mapInterfaceFrom(Object object, Type type);
65 
66     /**
67      * Returns the source environment.
68      *
69      * @return the source environment of this bridge
70      */
71     IEnvironment getSourceEnvironment();
72 
73     /**
74      * Returns the destination environment.
75      *
76      * @return the destination environment of this bridge
77      */
78     IEnvironment getTargetEnvironment();
79 
80     /**
81      * Increases the life count.
82      */
83     void acquire();
84 
85     /**
86      * Decreases the life count.
87      *
88      * <p>If the life count drops to zero, the bridge disposes itself.</p>
89      */
90     void release();
91 
92     /**
93      * Disposes the bridge.
94      *
95      * <p>Sends involved threads an <code>InterruptedException</code>.  Releases
96      * mapped objects.</p>
97      */
98     void dispose() throws InterruptedException, IOException;
99 }
100