

Public Methods | |
| void | export (org.omg.CORBA.Object impl) |
| void | exportWithPort (org.omg.CORBA.Object impl, int port) |
| void | export (ObjectImpl impl, Context hints, NamingContext nc) throws JonathanException, BAD_OPERATION |
| void | unexport (org.omg.CORBA.Object impl) |
Protected Attributes | |
| NamingContext | nc |
Private Methods | |
| SOAImpl (Context _c, Object[] components) | |
Private Attributes | |
| SingleOAdapter | adapter |
| DelegateFactory | dfactory |
| ContextFactory | context_factory |
SimpleAdapter is a very simple adapter type, providing operations to export and unexport CORBA objects. The methods of SOAImpl implementing the effective functionalities of SimpleAdapter delegate to an underlying adapter of type SingleOAdapter, possibly used by different personnalities.
An object adapter is only responsible for the identification and activation of servant objects: The code of an object adapter has thus no reason to deal with other problems such as distribution. However, it is convenient, when exporting an object, to have it also exported to a naming context that will deal with distribution aspects. SOAImpl lets a context be used, or alternatively, a specific naming context be specified at export time.
Definition at line 68 of file SOAImpl.java.
|
|
Returns an SOAImpl instance. When initialized this way, the default binder associated with this naming context is obtained as a kernel service of name "david.soa.orb". If the "david.soa.orb" property is not set, the setORB method should be used to set the default ORB.
Definition at line 92 of file SOAImpl.java. 00092 {
00093 nc = (NamingContext) components[0];
00094 dfactory = (DelegateFactory) components[1];
00095 adapter = (SingleOAdapter) components[2];
00096 context_factory = (ContextFactory) components[3];
00097 }
|
|
|
Exports a CORBA object implementation to the target adapter, and recursively to the provided naming context.
Definition at line 150 of file SOAImpl.java. 00151 {
00152 Reference delegate = null;
00153 if( dfactory != null) {
00154 delegate = dfactory.newDelegate(impl);
00155 } else {
00156 try {
00157 delegate = (Reference) impl._get_delegate();
00158 } catch (ClassCastException e) {
00159 throw new ExportException(e);
00160 }
00161 }
00162 Identifier id;
00163 // The current convention states that if the returned id is null,
00164 // the object has already been exported to the minimal adapter.
00165 // this convention is not necessarily the most intuitive one...
00166 id = adapter.export(delegate,hints,nc);
00167 if (id != null) {
00168 // the object has not been exported by the minimal adapter.
00169 Identifier[] refs = delegate.getIdentifiers();
00170 if (refs != null && refs.length > 0) {
00171 int nb = refs.length;
00172 Identifier[] new_refs = new Identifier[nb+1];
00173 System.arraycopy(refs,0,new_refs,0,nb);
00174 new_refs[nb] = id;
00175 delegate.setIdentifiers(new_refs);
00176 } else {
00177 delegate.setIdentifiers(new Identifier[] {id});
00178 }
00179 }
00180 }
|
|
|
Exports a CORBA object to the target adapter. This method calls the export method of 3 arguments. The second argument is a Integer instance of value 0.
Reimplemented from _SimpleAdapterImplBase. Definition at line 109 of file SOAImpl.java. 00109 {
00110 try {
00111 export((ObjectImpl) impl,null,nc);
00112 } catch (JonathanException e) {
00113 throw CORBAHelpers.systemException(e,CompletionStatus.COMPLETED_NO);
00114 }
00115 }
|
|
|
Exports a CORBA object to the target adapter, using the specified TCP port.
This method calls the export method of 3 arguments. The second argument is a Integer instance of value
Reimplemented from _SimpleAdapterImplBase. Definition at line 127 of file SOAImpl.java. 00127 {
00128 try {
00129 Context context = context_factory.newContext();
00130 context.addElement("port",int.class,port,(char) 0);
00131 export((ObjectImpl) impl,context,nc);
00132 context.release();
00133 } catch (JonathanException e) {
00134 throw CORBAHelpers.systemException(e,CompletionStatus.COMPLETED_NO);
00135 }
00136 }
|
|
|
Unexports the provided CORBA object. If the provided object has not been exported to the target adapter, this method silently returns.
Reimplemented from _SimpleAdapterImplBase. Definition at line 190 of file SOAImpl.java. 00190 {
00191 Reference delegate = null;
00192 try {
00193 delegate = (Reference) ((ObjectImpl) impl)._get_delegate();
00194 } catch (ClassCastException e) {
00195 return;
00196 }
00197 Identifier[] refs = delegate.getIdentifiers();
00198 int nb;
00199 if (refs != null && (nb = refs.length) > 0) {
00200 Identifier id, rid;
00201 for (int i = 0; i < nb; i++) {
00202 id = refs[i];
00203 rid = refs[i];
00204 while (rid != null) {
00205 if (rid.getContext().equals(adapter)) {
00206 rid.unexport();
00207 rid = null;
00208 } else {
00209 rid = (Identifier) rid.resolve();
00210 }
00211 }
00212 }
00213 }
00214 }
|
|
|
Definition at line 70 of file SOAImpl.java. |
|
|
Definition at line 72 of file SOAImpl.java. |
|
|
Definition at line 71 of file SOAImpl.java. |
|
|
The naming context responsible for distribution handling. Definition at line 77 of file SOAImpl.java. |
1.2.6 written by Dimitri van Heesch,
© 1997-2001