1 /* |
|
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. Oracle designates this |
|
8 * particular file as subject to the "Classpath" exception as provided |
|
9 * by Oracle in the LICENSE file that accompanied this code. |
|
10 * |
|
11 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 * version 2 for more details (a copy is included in the LICENSE file that |
|
15 * accompanied this code). |
|
16 * |
|
17 * You should have received a copy of the GNU General Public License version |
|
18 * 2 along with this work; if not, write to the Free Software Foundation, |
|
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 * |
|
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 * or visit www.oracle.com if you need additional information or have any |
|
23 * questions. |
|
24 */ |
|
25 |
|
26 package com.sun.jmx.remote.internal; |
|
27 |
|
28 import java.util.Properties; |
|
29 import java.rmi.Remote; |
|
30 import java.rmi.RemoteException; |
|
31 import java.rmi.NoSuchObjectException; |
|
32 |
|
33 /** |
|
34 * An interface to a subset of the RMI-IIOP and CORBA APIs to avoid a |
|
35 * static dependencies on the types defined by these APIs. |
|
36 */ |
|
37 |
|
38 public interface IIOPProxy { |
|
39 |
|
40 /** |
|
41 * Returns true if the given object is a Stub. |
|
42 */ |
|
43 boolean isStub(Object obj); |
|
44 |
|
45 /** |
|
46 * Returns the Delegate to which the given Stub delegates. |
|
47 */ |
|
48 Object getDelegate(Object stub); |
|
49 |
|
50 /** |
|
51 * Sets the Delegate for a given Stub. |
|
52 */ |
|
53 void setDelegate(Object stub, Object delegate); |
|
54 |
|
55 /** |
|
56 * Returns the ORB associated with the given stub |
|
57 * |
|
58 * @throws UnsupportedOperationException |
|
59 * if the object does not support the operation that |
|
60 * was invoked |
|
61 */ |
|
62 Object getOrb(Object stub); |
|
63 |
|
64 /** |
|
65 * Connects the Stub to the given ORB. |
|
66 */ |
|
67 void connect(Object stub, Object orb) throws RemoteException; |
|
68 |
|
69 /** |
|
70 * Returns true if the given object is an ORB. |
|
71 */ |
|
72 boolean isOrb(Object obj); |
|
73 |
|
74 /** |
|
75 * Creates, and returns, a new ORB instance. |
|
76 */ |
|
77 Object createOrb(String[] args, Properties props); |
|
78 |
|
79 /** |
|
80 * Converts a string, produced by the object_to_string method, back |
|
81 * to a CORBA object reference. |
|
82 */ |
|
83 Object stringToObject(Object orb, String str); |
|
84 |
|
85 /** |
|
86 * Converts the given CORBA object reference to a string. |
|
87 */ |
|
88 String objectToString(Object orb, Object obj); |
|
89 |
|
90 /** |
|
91 * Checks to ensure that an object of a remote or abstract interface |
|
92 * type can be cast to a desired type. |
|
93 */ |
|
94 <T> T narrow(Object narrowFrom, Class<T> narrowTo); |
|
95 |
|
96 /** |
|
97 * Makes a server object ready to receive remote calls |
|
98 */ |
|
99 void exportObject(Remote obj) throws RemoteException; |
|
100 |
|
101 /** |
|
102 * Deregisters a server object from the runtime. |
|
103 */ |
|
104 void unexportObject(Remote obj) throws NoSuchObjectException; |
|
105 |
|
106 /** |
|
107 * Returns a stub for the given server object. |
|
108 */ |
|
109 Remote toStub(Remote obj) throws NoSuchObjectException; |
|
110 } |
|