KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > ir > IRObject


1 package org.jacorb.ir;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2004 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23
24 import org.omg.CORBA.INTF_REPOS JavaDoc;
25
26 /**
27  * Base class for Interface Repository Objects
28  */

29
30 public abstract class IRObject
31     implements org.omg.CORBA.IRObjectOperations JavaDoc
32 {
33     protected org.omg.CORBA.Object JavaDoc myRef;
34     protected org.omg.CORBA.ORB JavaDoc orb;
35     protected org.omg.CORBA.DefinitionKind JavaDoc def_kind;
36     protected String JavaDoc name;
37
38     public org.omg.CORBA.DefinitionKind JavaDoc def_kind()
39     {
40         return def_kind;
41     }
42
43     public String JavaDoc getName()
44     {
45         return name;
46     }
47
48     public abstract void destroy();
49
50     /**
51      * second phase of loading IRObjects, define any unresolved links
52      */

53     abstract void define();
54
55     public org.omg.CORBA.Object JavaDoc getReference()
56     {
57         if( myRef == null )
58         {
59             throw new INTF_REPOS JavaDoc ("Reference undefined!");
60         }
61         return myRef;
62     }
63
64     public void setReference(org.omg.CORBA.Object JavaDoc ref)
65     {
66         myRef = ref;
67         orb = ((org.omg.CORBA.portable.ObjectImpl JavaDoc)myRef)._orb();
68     }
69
70 }
71
Popular Tags