01: package org.jacorb.ir;
02:
03: /*
04: * JacORB - a free Java ORB
05: *
06: * Copyright (C) 1997-2004 Gerald Brose.
07: *
08: * This library is free software; you can redistribute it and/or
09: * 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: import org.omg.CORBA.INTF_REPOS;
24:
25: /**
26: * Base class for Interface Repository Objects
27: *
28: * @author Gerald Brose
29: * @version $Id: IRObject.java,v 1.9 2006/06/15 16:43:14 alphonse.bendt Exp $
30: */
31: public abstract class IRObject implements
32: org.omg.CORBA.IRObjectOperations {
33: protected final static char fileSeparator = (System
34: .getProperty("file.separator").charAt(0));
35:
36: protected org.omg.CORBA.Object myRef;
37: protected org.omg.CORBA.ORB orb;
38: protected org.omg.CORBA.DefinitionKind def_kind;
39: protected String name;
40:
41: public org.omg.CORBA.DefinitionKind def_kind() {
42: return def_kind;
43: }
44:
45: public String getName() {
46: return name;
47: }
48:
49: public abstract void destroy();
50:
51: /**
52: * second phase of loading IRObjects, define any unresolved links
53: */
54: abstract void define();
55:
56: public org.omg.CORBA.Object getReference() {
57: if (myRef == null) {
58: throw new INTF_REPOS("Reference undefined!");
59: }
60: return myRef;
61: }
62:
63: public void setReference(org.omg.CORBA.Object ref) {
64: myRef = ref;
65: orb = ((org.omg.CORBA.portable.ObjectImpl) myRef)._orb();
66: }
67: }
|