Delegate.java revision 608:7e06bf1dcb09
1/*
2 * Copyright (c) 1999, 2003, 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 */
25package org.omg.PortableServer.portable;
26
27import org.omg.PortableServer.Servant;
28import org.omg.PortableServer.POA;
29
30/**
31 * The portability package contains interfaces and classes
32 * that are designed for and intended to be used by ORB
33 * implementor. It exposes the publicly defined APIs that
34 * are used to connect stubs and skeletons to the ORB.
35 * The Delegate interface provides the ORB vendor specific
36 * implementation of PortableServer::Servant.
37 * Conformant to spec CORBA V2.3.1, ptc/00-01-08.pdf
38 */
39public interface Delegate {
40/**
41 * Convenience method that returns the instance of the ORB
42 * currently associated with the Servant.
43 * @param Self the servant.
44 * @return ORB associated with the Servant.
45 */
46    org.omg.CORBA.ORB orb(Servant Self);
47
48/**
49 * This allows the servant to obtain the object reference for
50 * the target CORBA Object it is incarnating for that request.
51 * @param Self the servant.
52 * @return Object reference associated with the request.
53 */
54    org.omg.CORBA.Object this_object(Servant Self);
55
56/**
57 * The method _poa() is equivalent to
58 * calling PortableServer::Current:get_POA.
59 * @param Self the servant.
60 * @return POA associated with the servant.
61 */
62    POA poa(Servant Self);
63
64/**
65 * The method _object_id() is equivalent
66 * to calling PortableServer::Current::get_object_id.
67 * @param Self the servant.
68 * @return ObjectId associated with this servant.
69 */
70    byte[] object_id(Servant Self);
71
72/**
73 * The default behavior of this function is to return the
74 * root POA from the ORB instance associated with the servant.
75 * @param Self the servant.
76 * @return POA associated with the servant class.
77 */
78    POA default_POA(Servant Self);
79
80/**
81 * This method checks to see if the specified repid is present
82 * on the list returned by _all_interfaces() or is the
83 * repository id for the generic CORBA Object.
84 * @param Self the servant.
85 * @param Repository_Id the repository_id to be checked in the
86 *            repository list or against the id of generic CORBA
87 *            object.
88 * @return boolean indicating whether the specified repid is
89 *         in the list or is same as that got generic CORBA
90 *         object.
91 */
92    boolean is_a(Servant Self, String Repository_Id);
93
94/**
95 * This operation is used to check for the existence of the
96 * Object.
97 * @param Self the servant.
98 * @return boolean true to indicate that object does not exist,
99 *                 and false otherwise.
100 */
101    boolean non_existent(Servant Self);
102    //Simon And Ken Will Ask About Editorial Changes
103    //In Idl To Java For The Following Signature.
104
105/**
106 * This operation returns an object in the Interface Repository
107 * which provides type information that may be useful to a program.
108 * @param self the servant.
109 * @return type information corresponding to the object.
110 */
111    // The get_interface() method has been replaced by get_interface_def()
112    //org.omg.CORBA.Object get_interface(Servant Self);
113
114    org.omg.CORBA.Object get_interface_def(Servant self);
115}
116