001 /***** Copyright (c) 2000 Object Management Group. Unlimited rights to
002 duplicate and use this code are hereby granted provided that this
003 copyright notice is included.
004
005 Change history: modified toString, hashCode, equals per Java 2k RTF
006 - 15 Jan 2000
007 - Jeff Mischkinsky (jeff@persistence.com, jeff_mischkinsky@omg.org)
008 *****/
009
010 package org.omg.CORBA.portable;
011
012 abstract public class ObjectImpl implements org.omg.CORBA.Object {
013
014 private transient Delegate __delegate;
015
016 public Delegate _get_delegate() {
017 if (__delegate == null)
018 throw new org.omg.CORBA.BAD_OPERATION();
019 return __delegate;
020 }
021
022
023 public void _set_delegate(Delegate delegate) {
024 __delegate = delegate;
025 }
026
027 public abstract String[] _ids();
028
029 /**
030 *@deprecated Deprecated by CORBA 2.3
031 */
032 public org.omg.CORBA.InterfaceDef _get_interface() {
033 return _get_delegate().get_interface(this);
034 }
035
036 public org.omg.CORBA.Object _get_interface_def() {
037 return _get_delegate().get_interface_def(this);
038 }
039
040 public org.omg.CORBA.Object _duplicate() {
041 return _get_delegate().duplicate(this);
042 }
043
044 public void _release() {
045 _get_delegate().release(this);
046 }
047
048 public boolean _is_a(String repository_id) {
049 return _get_delegate().is_a(this, repository_id);
050 }
051
052 public boolean _is_equivalent(org.omg.CORBA.Object that) {
053 return _get_delegate().is_equivalent(this, that);
054 }
055
056 public boolean _non_existent() {
057 return _get_delegate().non_existent(this);
058 }
059
060 public int _hash(int maximum) {
061 return _get_delegate().hash(this, maximum);
062 }
063
064 public org.omg.CORBA.Request _request(String operation) {
065 return _get_delegate().request(this, operation);
066 }
067
068 public org.omg.CORBA.portable.OutputStream _request(String operation,
069 boolean responseExpected) {
070 return _get_delegate().request(this, operation, responseExpected);
071 }
072
073 public org.omg.CORBA.portable.InputStream _invoke(
074 org.omg.CORBA.portable.OutputStream output)
075 throws ApplicationException, RemarshalException {
076 return _get_delegate().invoke(this, output);
077 }
078
079 public void _releaseReply(org.omg.CORBA.portable.InputStream input) {
080 _get_delegate().releaseReply(this, input);
081 }
082
083 public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx,
084 String operation,
085 org.omg.CORBA.NVList arg_list,
086 org.omg.CORBA.NamedValue result) {
087 return _get_delegate().create_request(this, ctx,operation,
088 arg_list,result);
089 }
090
091 public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx,
092 String operation,
093 org.omg.CORBA.NVList arg_list,
094 org.omg.CORBA.NamedValue result,
095 org.omg.CORBA.ExceptionList exceptions,
096 org.omg.CORBA.ContextList contexts) {
097 return _get_delegate().create_request(this, ctx, operation, arg_list,
098 result, exceptions, contexts);
099 }
100
101 public org.omg.CORBA.Policy _get_policy(int policy_type) {
102 return _get_delegate().get_policy(this, policy_type);
103 }
104
105 public org.omg.CORBA.DomainManager[] _get_domain_managers() {
106 return _get_delegate().get_domain_managers(this);
107 }
108
109 public org.omg.CORBA.Object _set_policy_override(
110 org.omg.CORBA.Policy[] policies,
111 org.omg.CORBA.SetOverrideType set_add) {
112 return _get_delegate().set_policy_override(this, policies, set_add);
113 }
114
115 public org.omg.CORBA.ORB _orb() {
116 return _get_delegate().orb(this);
117 }
118
119 public boolean _is_local() {
120 return _get_delegate().is_local(this);
121 }
122
123 public ServantObject _servant_preinvoke(String operation,
124 Class expectedType) {
125 return _get_delegate().servant_preinvoke(this, operation,expectedType);
126 }
127
128 public void _servant_postinvoke(ServantObject servant) {
129 _get_delegate().servant_postinvoke(this, servant);
130 }
131
132 public String toString() {
133 if ( __delegate != null )
134 return __delegate.toString(this);
135 else
136 return getClass().getName()+":no delegate set";
137 }
138
139 public int hashCode() {
140 if ( __delegate != null )
141 return __delegate.hashCode(this);
142 else
143 return System.identityHashCode(this);
144 }
145
146 public boolean equals(java.lang.Object obj) {
147 if ( __delegate != null )
148 return __delegate.equals(this, obj);
149 else
150 return (this==obj);
151 }
152 }