index
int64
0
0
repo_id
stringlengths
9
205
file_path
stringlengths
31
246
content
stringlengths
1
12.2M
__index_level_0__
int64
0
10k
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/_ServerFactoryStub.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/ServerFactory:1.0 // public class _ServerFactoryStub extends org.omg.CORBA.portable.ObjectImpl implements ServerFactory { private static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/ServerFactory:1.0", }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = ServerFactoryOperations.class; // // IDL:orb.yoko.apache.org/IMR/ServerFactory/get_server:1.0 // public Server get_server(String _ob_a0) throws NoSuchServer { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("get_server", true); out.write_string(_ob_a0); in = _invoke(out); Server _ob_r = ServerHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(NoSuchServerHelper.id())) throw NoSuchServerHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("get_server", _ob_opsClass); if(_ob_so == null) continue; ServerFactoryOperations _ob_self = (ServerFactoryOperations)_ob_so.servant; try { return _ob_self.get_server(_ob_a0); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ServerFactory/create_server_record:1.0 // public Server create_server_record(String _ob_a0) throws ServerAlreadyRegistered { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("create_server_record", true); out.write_string(_ob_a0); in = _invoke(out); Server _ob_r = ServerHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(ServerAlreadyRegisteredHelper.id())) throw ServerAlreadyRegisteredHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("create_server_record", _ob_opsClass); if(_ob_so == null) continue; ServerFactoryOperations _ob_self = (ServerFactoryOperations)_ob_so.servant; try { return _ob_self.create_server_record(_ob_a0); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ServerFactory/list_servers:1.0 // public Server[] list_servers() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("list_servers", true); in = _invoke(out); Server[] _ob_r = ServerSeqHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("list_servers", _ob_opsClass); if(_ob_so == null) continue; ServerFactoryOperations _ob_self = (ServerFactoryOperations)_ob_so.servant; try { return _ob_self.list_servers(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ServerFactory/list_servers_by_host:1.0 // public Server[] list_servers_by_host(String _ob_a0) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("list_servers_by_host", true); out.write_string(_ob_a0); in = _invoke(out); Server[] _ob_r = ServerSeqHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("list_servers_by_host", _ob_opsClass); if(_ob_so == null) continue; ServerFactoryOperations _ob_self = (ServerFactoryOperations)_ob_so.servant; try { return _ob_self.list_servers_by_host(_ob_a0); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ServerFactory/list_orphaned_servers:1.0 // public Server[] list_orphaned_servers() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("list_orphaned_servers", true); in = _invoke(out); Server[] _ob_r = ServerSeqHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("list_orphaned_servers", _ob_opsClass); if(_ob_so == null) continue; ServerFactoryOperations _ob_self = (ServerFactoryOperations)_ob_so.servant; try { return _ob_self.list_orphaned_servers(); } finally { _servant_postinvoke(_ob_so); } } } } }
6,700
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/ActiveState.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/ActiveState:1.0 // /***/ public interface ActiveState extends ActiveStateOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity { }
6,701
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/NoSuchOADHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/NoSuchOAD:1.0 // final public class NoSuchOADHelper { public static void insert(org.omg.CORBA.Any any, NoSuchOAD val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static NoSuchOAD extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[1]; members[0] = new org.omg.CORBA.StructMember(); members[0].name = "name"; members[0].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string); typeCode_ = orb.create_exception_tc(id(), "NoSuchOAD", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/NoSuchOAD:1.0"; } public static NoSuchOAD read(org.omg.CORBA.portable.InputStream in) { if(!id().equals(in.read_string())) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadIDMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorReadIDMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } NoSuchOAD _ob_v = new NoSuchOAD(); _ob_v.name = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, NoSuchOAD val) { out.write_string(id()); out.write_string(val.name); } }
6,702
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/Server.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/Server:1.0 // /** * * The Server interface. * **/ public interface Server extends ServerOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity { }
6,703
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/ServerDomainOperations.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/ServerDomain:1.0 // /***/ public interface ServerDomainOperations extends DomainOperations { // // IDL:orb.yoko.apache.org/IMR/ServerDomain/get_server_factory:1.0 // /** * * Retrieve the Server Factory. * * @return The reference to the server factory. * **/ ServerFactory get_server_factory(); // // IDL:orb.yoko.apache.org/IMR/ServerDomain/create_oad_record:1.0 // /** * * Create OAD record. * * @param host The host name * **/ void create_oad_record(String host) throws OADAlreadyExists; // // IDL:orb.yoko.apache.org/IMR/ServerDomain/remove_oad_record:1.0 // /** * * Remove an OAD record. * * @param host The OAD's host * **/ void remove_oad_record(String host) throws NoSuchOAD, OADRunning; // // IDL:orb.yoko.apache.org/IMR/ServerDomain/get_oad_record:1.0 // /** * * Retrieve an OAD record. * * @param host The OAD's host * * @return The OAD record. * **/ OADInfo get_oad_record(String host) throws NoSuchOAD; // // IDL:orb.yoko.apache.org/IMR/ServerDomain/list_oads:1.0 // /** * * List the Object Activation Daemons. * * @return A sequence of OADInfo's. * **/ OADInfo[] list_oads(); }
6,704
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/_ActiveStateStub.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/ActiveState:1.0 // public class _ActiveStateStub extends org.omg.CORBA.portable.ObjectImpl implements ActiveState { private static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/ActiveState:1.0", }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = ActiveStateOperations.class; // // IDL:orb.yoko.apache.org/IMR/ActiveState/set_status:1.0 // public void set_status(String _ob_a0, ServerStatus _ob_a1) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("set_status", true); out.write_string(_ob_a0); ServerStatusHelper.write(out, _ob_a1); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("set_status", _ob_opsClass); if(_ob_so == null) continue; ActiveStateOperations _ob_self = (ActiveStateOperations)_ob_so.servant; try { _ob_self.set_status(_ob_a0, _ob_a1); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ActiveState/poa_create:1.0 // public org.omg.PortableInterceptor.ObjectReferenceTemplate poa_create(POAStatus _ob_a0, org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_a1) throws _NoSuchPOA { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("poa_create", true); POAStatusHelper.write(out, _ob_a0); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write(out, _ob_a1); in = _invoke(out); org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_r = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(_NoSuchPOAHelper.id())) throw _NoSuchPOAHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("poa_create", _ob_opsClass); if(_ob_so == null) continue; ActiveStateOperations _ob_self = (ActiveStateOperations)_ob_so.servant; try { org.omg.CORBA.portable.OutputStream _ob_out = _orb().create_output_stream(); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write(_ob_out, _ob_a1); org.omg.CORBA.portable.InputStream _ob_in = _ob_out.create_input_stream(); _ob_a1 = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read(_ob_in); org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_r = _ob_self.poa_create(_ob_a0, _ob_a1); _ob_out = _orb().create_output_stream(); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write(_ob_out, _ob_r); _ob_in = _ob_out.create_input_stream(); _ob_r = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read(_ob_in); return _ob_r; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ActiveState/poa_status_update:1.0 // public void poa_status_update(String[][] _ob_a0, POAStatus _ob_a1) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("poa_status_update", true); POANameSeqHelper.write(out, _ob_a0); POAStatusHelper.write(out, _ob_a1); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("poa_status_update", _ob_opsClass); if(_ob_so == null) continue; ActiveStateOperations _ob_self = (ActiveStateOperations)_ob_so.servant; try { _ob_self.poa_status_update(_ob_a0, _ob_a1); return; } finally { _servant_postinvoke(_ob_so); } } } } }
6,705
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/POAInfo.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/POAInfo:1.0 // /** Information on a POA. */ final public class POAInfo implements org.omg.CORBA.portable.IDLEntity { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/POAInfo:1.0"; public POAInfo() { } public POAInfo(String[] poa, POAStatus state) { this.poa = poa; this.state = state; } public String[] poa; public POAStatus state; }
6,706
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/NoSuchOADHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/NoSuchOAD:1.0 // final public class NoSuchOADHolder implements org.omg.CORBA.portable.Streamable { public NoSuchOAD value; public NoSuchOADHolder() { } public NoSuchOADHolder(NoSuchOAD initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = NoSuchOADHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { NoSuchOADHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return NoSuchOADHelper.type(); } }
6,707
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/ServerPOA.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/Server:1.0 // public abstract class ServerPOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, ServerOperations { static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/Server:1.0", }; public Server _this() { return ServerHelper.narrow(super._this_object()); } public Server _this(org.omg.CORBA.ORB orb) { return ServerHelper.narrow(super._this_object(orb)); } public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[] objectId) { return _ob_ids_; } public org.omg.CORBA.portable.OutputStream _invoke(String opName, org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { final String[] _ob_names = { "_get_activatePOAs", "_get_args", "_get_directory", "_get_exec", "_get_failureTimeout", "_get_host", "_get_id", "_get_manual", "_get_maxForks", "_get_mode", "_get_name", "_get_status", "_get_timesForked", "_get_updateTime", "_get_updateTimeout", "_set_activatePOAs", "_set_args", "_set_directory", "_set_exec", "_set_failureTimeout", "_set_host", "_set_maxForks", "_set_mode", "_set_name", "_set_updateTimeout", "clear_error_state", "create_poa_record", "destroy", "get_poa_info", "list_poas", "remove_poa_record", "start", "stop" }; int _ob_left = 0; int _ob_right = _ob_names.length; int _ob_index = -1; while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(opName); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } if(_ob_index == -1 && opName.charAt(0) == '_') { _ob_left = 0; _ob_right = _ob_names.length; String _ob_ami_op = opName.substring(1); while(_ob_left < _ob_right) { int _ob_m = (_ob_left + _ob_right) / 2; int _ob_res = _ob_names[_ob_m].compareTo(_ob_ami_op); if(_ob_res == 0) { _ob_index = _ob_m; break; } else if(_ob_res > 0) _ob_right = _ob_m; else _ob_left = _ob_m + 1; } } switch(_ob_index) { case 0: // _get_activatePOAs return _OB_att_get_activatePOAs(in, handler); case 1: // _get_args return _OB_att_get_args(in, handler); case 2: // _get_directory return _OB_att_get_directory(in, handler); case 3: // _get_exec return _OB_att_get_exec(in, handler); case 4: // _get_failureTimeout return _OB_att_get_failureTimeout(in, handler); case 5: // _get_host return _OB_att_get_host(in, handler); case 6: // _get_id return _OB_att_get_id(in, handler); case 7: // _get_manual return _OB_att_get_manual(in, handler); case 8: // _get_maxForks return _OB_att_get_maxForks(in, handler); case 9: // _get_mode return _OB_att_get_mode(in, handler); case 10: // _get_name return _OB_att_get_name(in, handler); case 11: // _get_status return _OB_att_get_status(in, handler); case 12: // _get_timesForked return _OB_att_get_timesForked(in, handler); case 13: // _get_updateTime return _OB_att_get_updateTime(in, handler); case 14: // _get_updateTimeout return _OB_att_get_updateTimeout(in, handler); case 15: // _set_activatePOAs return _OB_att_set_activatePOAs(in, handler); case 16: // _set_args return _OB_att_set_args(in, handler); case 17: // _set_directory return _OB_att_set_directory(in, handler); case 18: // _set_exec return _OB_att_set_exec(in, handler); case 19: // _set_failureTimeout return _OB_att_set_failureTimeout(in, handler); case 20: // _set_host return _OB_att_set_host(in, handler); case 21: // _set_maxForks return _OB_att_set_maxForks(in, handler); case 22: // _set_mode return _OB_att_set_mode(in, handler); case 23: // _set_name return _OB_att_set_name(in, handler); case 24: // _set_updateTimeout return _OB_att_set_updateTimeout(in, handler); case 25: // clear_error_state return _OB_op_clear_error_state(in, handler); case 26: // create_poa_record return _OB_op_create_poa_record(in, handler); case 27: // destroy return _OB_op_destroy(in, handler); case 28: // get_poa_info return _OB_op_get_poa_info(in, handler); case 29: // list_poas return _OB_op_list_poas(in, handler); case 30: // remove_poa_record return _OB_op_remove_poa_record(in, handler); case 31: // start return _OB_op_start(in, handler); case 32: // stop return _OB_op_stop(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_att_get_activatePOAs(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { boolean _ob_r = activatePOAs(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_boolean(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_args(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String[] _ob_r = args(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); ArgListHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_directory(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_r = directory(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_string(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_exec(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_r = exec(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_string(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_failureTimeout(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { int _ob_r = failureTimeout(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_long(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_host(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_r = host(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_string(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_id(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { int _ob_r = id(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); ServerIDHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_manual(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { boolean _ob_r = manual(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_boolean(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_maxForks(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { short _ob_r = maxForks(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_short(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_mode(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { ServerActivationMode _ob_r = mode(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); ServerActivationModeHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_name(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_r = name(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_string(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_status(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { ServerStatus _ob_r = status(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); ServerStatusHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_timesForked(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { short _ob_r = timesForked(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_short(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_updateTime(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { int _ob_r = updateTime(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_long(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_get_updateTimeout(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { int _ob_r = updateTimeout(); org.omg.CORBA.portable.OutputStream out = handler.createReply(); out.write_long(_ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_att_set_activatePOAs(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { boolean _ob_a = in.read_boolean(); activatePOAs(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_args(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String[] _ob_a = ArgListHelper.read(in); args(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_directory(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_a = in.read_string(); directory(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_exec(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_a = in.read_string(); exec(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_failureTimeout(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { int _ob_a = in.read_long(); failureTimeout(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_host(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_a = in.read_string(); host(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_maxForks(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { short _ob_a = in.read_short(); maxForks(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_mode(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { ServerActivationMode _ob_a = ServerActivationModeHelper.read(in); mode(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_name(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { String _ob_a = in.read_string(); name(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_att_set_updateTimeout(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { int _ob_a = in.read_long(); updateTimeout(_ob_a); return handler.createReply(); } private org.omg.CORBA.portable.OutputStream _OB_op_clear_error_state(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; clear_error_state(); out = handler.createReply(); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_create_poa_record(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String[] _ob_a0 = POANameHelper.read(in); create_poa_record(_ob_a0); out = handler.createReply(); } catch(POAAlreadyRegistered _ob_ex) { out = handler.createExceptionReply(); POAAlreadyRegisteredHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_destroy(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { destroy(); out = handler.createReply(); } catch(ServerRunning _ob_ex) { out = handler.createExceptionReply(); ServerRunningHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_get_poa_info(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String[] _ob_a0 = POANameHelper.read(in); POAInfo _ob_r = get_poa_info(_ob_a0); out = handler.createReply(); POAInfoHelper.write(out, _ob_r); } catch(_NoSuchPOA _ob_ex) { out = handler.createExceptionReply(); _NoSuchPOAHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_list_poas(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; POAInfo[] _ob_r = list_poas(); out = handler.createReply(); POAInfoSeqHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_remove_poa_record(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String[] _ob_a0 = POANameHelper.read(in); remove_poa_record(_ob_a0); out = handler.createReply(); } catch(_NoSuchPOA _ob_ex) { out = handler.createExceptionReply(); _NoSuchPOAHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_start(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { start(); out = handler.createReply(); } catch(ServerRunning _ob_ex) { out = handler.createExceptionReply(); ServerRunningHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_stop(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { stop(); out = handler.createReply(); } catch(OADNotRunning _ob_ex) { out = handler.createExceptionReply(); OADNotRunningHelper.write(out, _ob_ex); } catch(ServerNotRunning _ob_ex) { out = handler.createExceptionReply(); ServerNotRunningHelper.write(out, _ob_ex); } return out; } }
6,708
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/_NoSuchPOA.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/NoSuchPOA:1.0 // /** * * A NoSuchPOA exception indicates that the poa detailed in the member * <code>poa</code> doesn't exist. * **/ final public class _NoSuchPOA extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/NoSuchPOA:1.0"; public _NoSuchPOA() { super(_ob_id); } public _NoSuchPOA(String[] poa) { super(_ob_id); this.poa = poa; } public _NoSuchPOA(String _reason, String[] poa) { super(_ob_id + " " + _reason); this.poa = poa; } public String[] poa; }
6,709
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/POAStatusHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/POAStatus:1.0 // final public class POAStatusHelper { public static void insert(org.omg.CORBA.Any any, POAStatus val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static POAStatus extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); String[] members = new String[5]; members[0] = "INACTIVE"; members[1] = "ACTIVE"; members[2] = "HOLDING"; members[3] = "DISCARDING"; members[4] = "NON_EXISTENT"; typeCode_ = orb.create_enum_tc(id(), "POAStatus", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/POAStatus:1.0"; } public static POAStatus read(org.omg.CORBA.portable.InputStream in) { POAStatus _ob_v; _ob_v = POAStatus.from_int(in.read_ulong()); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, POAStatus val) { out.write_ulong(val.value()); } }
6,710
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/POAAlreadyRegisteredHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/POAAlreadyRegistered:1.0 // final public class POAAlreadyRegisteredHelper { public static void insert(org.omg.CORBA.Any any, POAAlreadyRegistered val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static POAAlreadyRegistered extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[2]; members[0] = new org.omg.CORBA.StructMember(); members[0].name = "name"; members[0].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string); members[1] = new org.omg.CORBA.StructMember(); members[1].name = "poa"; members[1].type = POANameHelper.type(); typeCode_ = orb.create_exception_tc(id(), "POAAlreadyRegistered", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/POAAlreadyRegistered:1.0"; } public static POAAlreadyRegistered read(org.omg.CORBA.portable.InputStream in) { if(!id().equals(in.read_string())) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadIDMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorReadIDMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } POAAlreadyRegistered _ob_v = new POAAlreadyRegistered(); _ob_v.name = in.read_string(); _ob_v.poa = POANameHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, POAAlreadyRegistered val) { out.write_string(id()); out.write_string(val.name); POANameHelper.write(out, val.poa); } }
6,711
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/OADNotRunningHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/OADNotRunning:1.0 // final public class OADNotRunningHolder implements org.omg.CORBA.portable.Streamable { public OADNotRunning value; public OADNotRunningHolder() { } public OADNotRunningHolder(OADNotRunning initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = OADNotRunningHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { OADNotRunningHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return OADNotRunningHelper.type(); } }
6,712
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/OADInfoSeqHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/OADInfoSeq:1.0 // final public class OADInfoSeqHelper { public static void insert(org.omg.CORBA.Any any, OADInfo[] val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static OADInfo[] extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); typeCode_ = orb.create_alias_tc(id(), "OADInfoSeq", orb.create_sequence_tc(0, OADInfoHelper.type())); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/OADInfoSeq:1.0"; } public static OADInfo[] read(org.omg.CORBA.portable.InputStream in) { OADInfo[] _ob_v; int len0 = in.read_ulong(); _ob_v = new OADInfo[len0]; for(int i0 = 0; i0 < len0; i0++) _ob_v[i0] = OADInfoHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, OADInfo[] val) { int len0 = val.length; out.write_ulong(len0); for(int i0 = 0; i0 < len0; i0++) OADInfoHelper.write(out, val[i0]); } }
6,713
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/OADNotRunningHelper.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/OADNotRunning:1.0 // final public class OADNotRunningHelper { public static void insert(org.omg.CORBA.Any any, OADNotRunning val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static OADNotRunning extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return read(any.create_input_stream()); else throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private static org.omg.CORBA.TypeCode typeCode_; public static org.omg.CORBA.TypeCode type() { if(typeCode_ == null) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(); org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[1]; members[0] = new org.omg.CORBA.StructMember(); members[0].name = "host"; members[0].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string); typeCode_ = orb.create_exception_tc(id(), "OADNotRunning", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/OADNotRunning:1.0"; } public static OADNotRunning read(org.omg.CORBA.portable.InputStream in) { if(!id().equals(in.read_string())) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadIDMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorReadIDMismatch, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } OADNotRunning _ob_v = new OADNotRunning(); _ob_v.host = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, OADNotRunning val) { out.write_string(id()); out.write_string(val.host); } }
6,714
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/OADInfoSeqHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/OADInfoSeq:1.0 // final public class OADInfoSeqHolder implements org.omg.CORBA.portable.Streamable { public OADInfo[] value; public OADInfoSeqHolder() { } public OADInfoSeqHolder(OADInfo[] initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = OADInfoSeqHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { OADInfoSeqHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return OADInfoSeqHelper.type(); } }
6,715
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/POAAlreadyRegisteredHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/POAAlreadyRegistered:1.0 // final public class POAAlreadyRegisteredHolder implements org.omg.CORBA.portable.Streamable { public POAAlreadyRegistered value; public POAAlreadyRegisteredHolder() { } public POAAlreadyRegisteredHolder(POAAlreadyRegistered initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = POAAlreadyRegisteredHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { POAAlreadyRegisteredHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return POAAlreadyRegisteredHelper.type(); } }
6,716
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/POAStatusHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/POAStatus:1.0 // final public class POAStatusHolder implements org.omg.CORBA.portable.Streamable { public POAStatus value; public POAStatusHolder() { } public POAStatusHolder(POAStatus initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = POAStatusHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { POAStatusHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return POAStatusHelper.type(); } }
6,717
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/Domain.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/Domain:1.0 // /***/ public interface Domain extends DomainOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity { }
6,718
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/IMR/_ServerStub.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.IMR; // // IDL:orb.yoko.apache.org/IMR/Server:1.0 // public class _ServerStub extends org.omg.CORBA.portable.ObjectImpl implements Server { private static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/Server:1.0", }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = ServerOperations.class; // // IDL:orb.yoko.apache.org/IMR/Server/id:1.0 // public int id() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_id", true); in = _invoke(out); int _ob_r = ServerIDHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("id", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.id(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/status:1.0 // public ServerStatus status() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_status", true); in = _invoke(out); ServerStatus _ob_r = ServerStatusHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("status", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.status(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/manual:1.0 // public boolean manual() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_manual", true); in = _invoke(out); boolean _ob_r = in.read_boolean(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("manual", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.manual(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/updateTime:1.0 // public int updateTime() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_updateTime", true); in = _invoke(out); int _ob_r = in.read_long(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("updateTime", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.updateTime(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/timesForked:1.0 // public short timesForked() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_timesForked", true); in = _invoke(out); short _ob_r = in.read_short(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("timesForked", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.timesForked(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/name:1.0 // public String name() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_name", true); in = _invoke(out); String _ob_r = in.read_string(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("name", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.name(); } finally { _servant_postinvoke(_ob_so); } } } } public void name(String _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_name", true); out.write_string(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("name", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.name(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/host:1.0 // public String host() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_host", true); in = _invoke(out); String _ob_r = in.read_string(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("host", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.host(); } finally { _servant_postinvoke(_ob_so); } } } } public void host(String _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_host", true); out.write_string(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("host", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.host(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/exec:1.0 // public String exec() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_exec", true); in = _invoke(out); String _ob_r = in.read_string(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("exec", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.exec(); } finally { _servant_postinvoke(_ob_so); } } } } public void exec(String _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_exec", true); out.write_string(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("exec", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.exec(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/args:1.0 // public String[] args() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_args", true); in = _invoke(out); String[] _ob_r = ArgListHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("args", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.args(); } finally { _servant_postinvoke(_ob_so); } } } } public void args(String[] _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_args", true); ArgListHelper.write(out, _ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("args", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.args(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/directory:1.0 // public String directory() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_directory", true); in = _invoke(out); String _ob_r = in.read_string(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("directory", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.directory(); } finally { _servant_postinvoke(_ob_so); } } } } public void directory(String _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_directory", true); out.write_string(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("directory", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.directory(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/mode:1.0 // public ServerActivationMode mode() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_mode", true); in = _invoke(out); ServerActivationMode _ob_r = ServerActivationModeHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("mode", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.mode(); } finally { _servant_postinvoke(_ob_so); } } } } public void mode(ServerActivationMode _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_mode", true); ServerActivationModeHelper.write(out, _ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("mode", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.mode(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/updateTimeout:1.0 // public int updateTimeout() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_updateTimeout", true); in = _invoke(out); int _ob_r = in.read_long(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("updateTimeout", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.updateTimeout(); } finally { _servant_postinvoke(_ob_so); } } } } public void updateTimeout(int _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_updateTimeout", true); out.write_long(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("updateTimeout", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.updateTimeout(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/failureTimeout:1.0 // public int failureTimeout() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_failureTimeout", true); in = _invoke(out); int _ob_r = in.read_long(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("failureTimeout", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.failureTimeout(); } finally { _servant_postinvoke(_ob_so); } } } } public void failureTimeout(int _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_failureTimeout", true); out.write_long(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("failureTimeout", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.failureTimeout(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/maxForks:1.0 // public short maxForks() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_maxForks", true); in = _invoke(out); short _ob_r = in.read_short(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("maxForks", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.maxForks(); } finally { _servant_postinvoke(_ob_so); } } } } public void maxForks(short _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_maxForks", true); out.write_short(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("maxForks", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.maxForks(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/activatePOAs:1.0 // public boolean activatePOAs() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_get_activatePOAs", true); in = _invoke(out); boolean _ob_r = in.read_boolean(); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("activatePOAs", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.activatePOAs(); } finally { _servant_postinvoke(_ob_so); } } } } public void activatePOAs(boolean _ob_a) { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("_set_activatePOAs", true); out.write_boolean(_ob_a); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("activatePOAs", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.activatePOAs(_ob_a); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/create_poa_record:1.0 // public void create_poa_record(String[] _ob_a0) throws POAAlreadyRegistered { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("create_poa_record", true); POANameHelper.write(out, _ob_a0); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(POAAlreadyRegisteredHelper.id())) throw POAAlreadyRegisteredHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("create_poa_record", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.create_poa_record(_ob_a0); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/remove_poa_record:1.0 // public void remove_poa_record(String[] _ob_a0) throws _NoSuchPOA { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("remove_poa_record", true); POANameHelper.write(out, _ob_a0); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(_NoSuchPOAHelper.id())) throw _NoSuchPOAHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("remove_poa_record", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.remove_poa_record(_ob_a0); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/get_poa_info:1.0 // public POAInfo get_poa_info(String[] _ob_a0) throws _NoSuchPOA { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("get_poa_info", true); POANameHelper.write(out, _ob_a0); in = _invoke(out); POAInfo _ob_r = POAInfoHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(_NoSuchPOAHelper.id())) throw _NoSuchPOAHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("get_poa_info", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.get_poa_info(_ob_a0); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/list_poas:1.0 // public POAInfo[] list_poas() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("list_poas", true); in = _invoke(out); POAInfo[] _ob_r = POAInfoSeqHelper.read(in); return _ob_r; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("list_poas", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { return _ob_self.list_poas(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/clear_error_state:1.0 // public void clear_error_state() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("clear_error_state", true); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("clear_error_state", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.clear_error_state(); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/start:1.0 // public void start() throws ServerRunning { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("start", true); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(ServerRunningHelper.id())) throw ServerRunningHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("start", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.start(); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/stop:1.0 // public void stop() throws OADNotRunning, ServerNotRunning { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("stop", true); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(OADNotRunningHelper.id())) throw OADNotRunningHelper.read(in); if(_ob_id.equals(ServerNotRunningHelper.id())) throw ServerNotRunningHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("stop", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.stop(); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Server/destroy:1.0 // public void destroy() throws ServerRunning { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("destroy", true); in = _invoke(out); return; } catch(org.omg.CORBA.portable.RemarshalException _ob_ex) { continue; } catch(org.omg.CORBA.portable.ApplicationException _ob_aex) { final String _ob_id = _ob_aex.getId(); in = _ob_aex.getInputStream(); if(_ob_id.equals(ServerRunningHelper.id())) throw ServerRunningHelper.read(in); throw (org.omg.CORBA.UNKNOWN)new org.omg.CORBA.UNKNOWN("Unexpected User Exception: " + _ob_id).initCause(_ob_aex); } finally { _releaseReply(in); } } else { org.omg.CORBA.portable.ServantObject _ob_so = _servant_preinvoke("destroy", _ob_opsClass); if(_ob_so == null) continue; ServerOperations _ob_self = (ServerOperations)_ob_so.servant; try { _ob_self.destroy(); return; } finally { _servant_postinvoke(_ob_so); } } } } }
6,719
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/spi
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/spi/naming/Resolver.java
package org.apache.yoko.orb.spi.naming; import org.omg.CORBA.LocalObject; public abstract class Resolver extends LocalObject implements Resolvable {}
6,720
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/spi
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/spi/naming/NameServiceInitializer.java
package org.apache.yoko.orb.spi.naming; import static org.apache.yoko.orb.spi.naming.RemoteAccess.*; import java.util.Arrays; import org.apache.yoko.orb.CosNaming.tnaming2.NamingContextImpl; import org.apache.yoko.orb.OB.BootLocator; import org.apache.yoko.orb.OB.BootManagerPackage.NotFound; import org.omg.CORBA.BooleanHolder; import org.omg.CORBA.INITIALIZE; import org.omg.CORBA.LocalObject; import org.omg.CORBA.ORB; import org.omg.CORBA.ObjectHolder; import org.omg.CORBA.Policy; import org.omg.PortableInterceptor.ORBInitInfo; import org.omg.PortableInterceptor.ORBInitializer; import org.omg.PortableServer.IdAssignmentPolicyValue; import org.omg.PortableServer.LifespanPolicyValue; import org.omg.PortableServer.POA; import org.omg.PortableServer.Servant; import org.omg.PortableServer.ServantRetentionPolicyValue; import org.omg.PortableServer.POAPackage.AdapterAlreadyExists; import org.omg.PortableServer.POAPackage.AdapterNonExistent; import org.omg.PortableServer.POAPackage.InvalidPolicy; public class NameServiceInitializer extends LocalObject implements ORBInitializer { /** The property name to use to initialize an ORB with this initializer. */ public static final String NS_ORB_INIT_PROP = ORBInitializer.class.getName() + "Class." + NameServiceInitializer.class.getName(); /** * The name of this name service, as used with <code>corbaloc:</code> URLs * and with calls to {@link ORB#resolve_initial_references(String)}. */ public static final String SERVICE_NAME = "NameService"; /** * The POA name this name service will use to activate contexts. * The name service will first try <code>rootPoa.find_POA()</code> * to find the POA with this name. If that returns null, it will * call <code>rootPoa.create_POA()</code> to create the POA with * this name. */ public static final String POA_NAME = "NameServicePOA"; /** * The policies required for the NameService POA. Users providing * the NameService POA must include these policies when creating * the POA. If creation is to be left to this initializer, these * policies will be used automatically. * @param rootPOA the root POA for the ORB in use * @return a new Policy array object, owned by the caller */ public static final Policy[] createPOAPolicies(POA rootPOA) { return new Policy[] { rootPOA.create_lifespan_policy(LifespanPolicyValue.TRANSIENT), rootPOA.create_id_assignment_policy(IdAssignmentPolicyValue.USER_ID), rootPOA.create_servant_retention_policy(ServantRetentionPolicyValue.RETAIN) }; } /** * The ORB argument that specifies remote accessibility of this name service. * The next argument must be one of these literal string values: * <ul> * <li><code>"</code>{@link #readOnly}<code>"</code></li> * <li><code>"</code>{@link #readWrite}<code>"</code></li> * </ul> */ public static final String NS_REMOTE_ACCESS_ARG = "-YokoNameServiceRemoteAccess"; abstract static class BootLocatorImpl extends LocalObject implements BootLocator {} private static final long serialVersionUID = 1L; private RemoteAccess remoteAccess = readWrite; @Override public void pre_init(ORBInitInfo info) { try { final NamingContextImpl local = new NamingContextImpl(); info.register_initial_reference(SERVICE_NAME, local); String[] args = info.arguments(); // iterate over all BUT THE LAST ARG for (int i = 0; i < args.length - 1; i++) { switch (args[i]) { case NS_REMOTE_ACCESS_ARG: i++; this.remoteAccess = RemoteAccess.valueOf(args[i]); } } } catch (Exception e) { throw (INITIALIZE) (new INITIALIZE().initCause(e)); } } @Override public void post_init(ORBInitInfo info) { try { final POA rootPOA = (POA) info.resolve_initial_references("RootPOA"); final NamingContextImpl local = (NamingContextImpl) info.resolve_initial_references("NameService"); final String serviceName = getServiceName(info); final org.apache.yoko.orb.OB.BootManager bootManager = org.apache.yoko.orb.OB.BootManagerHelper.narrow(info .resolve_initial_references("BootManager")); final byte[] objectId = serviceName.getBytes(); bootManager.set_locator(new BootLocatorImpl() { @Override public void locate(byte[] oid, ObjectHolder obj, BooleanHolder add) throws NotFound { if (!!!Arrays.equals(oid, objectId)) throw new NotFound(new String(oid)); try { rootPOA.the_POAManager().activate(); final POA nameServicePOA = findOrCreatePOA(rootPOA); nameServicePOA.the_POAManager().activate(); final Servant nameServant = local.getServant(nameServicePOA, remoteAccess); // return the context stub via the object holder obj.value = nameServant._this_object(); // return true via the boolean holder // to tell the boot manager to re-use // this result so we only get called once add.value = true; } catch (Exception e) { throw (NotFound) (new NotFound("Unexpected").initCause(e)); } } private POA findOrCreatePOA(final POA rootPOA) throws AdapterAlreadyExists, InvalidPolicy { try { return rootPOA.find_POA(POA_NAME, true); } catch (AdapterNonExistent e) { final Policy[] policies = createPOAPolicies(rootPOA); return rootPOA.create_POA(POA_NAME, null, policies); } } }); } catch (Exception e) { throw (INITIALIZE) (new INITIALIZE().initCause(e)); } } private String getServiceName(ORBInitInfo info) { for (String arg : info.arguments()) { if (arg.startsWith("ORBNameService=")) { return arg.substring("ORBNameService=".length()); } } return "NameService"; } }
6,721
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/spi
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/spi/naming/RemoteAccess.java
package org.apache.yoko.orb.spi.naming; import org.omg.CosNaming.NamingContext; /** The remote access settings for a name service. */ public enum RemoteAccess{ /** Remote clients can perform operations on {@link NamingContext} that do not alter the state of the name service.*/ readOnly, /** Remote clients can perform all operations on {@link NamingContext} objects from this name service.*/ readWrite }
6,722
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/spi
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/spi/naming/Resolvable.java
package org.apache.yoko.orb.spi.naming; import org.omg.CORBA.Object; public interface Resolvable extends Object { org.omg.CORBA.Object resolve(); // This is the factory method }
6,723
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/DecayPolicyFactory_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class DecayPolicyFactory_impl implements org.omg.CORBA.portable.ValueFactory { public DecayPolicyFactory_impl() { } public java.io.Serializable read_value( org.omg.CORBA_2_3.portable.InputStream in) { return in.read_value(new DecayPolicy_impl()); } }
6,724
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/ImmediateSuspendPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class ImmediateSuspendPolicy_impl extends org.omg.MessageRouting.ImmediateSuspend { public ImmediateSuspendPolicy_impl() { } public int policy_type() { return org.omg.MessageRouting.IMMEDIATE_SUSPEND_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return null; } public void destroy() { } }
6,725
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/UnlimitedPingPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class UnlimitedPingPolicy_impl extends org.omg.MessageRouting.UnlimitedPing { public UnlimitedPingPolicy_impl() { } public UnlimitedPingPolicy_impl(short maxBackoffs, float backoffFactor, int bis) { max_backoffs = maxBackoffs; backoff_factor = backoffFactor; base_interval_seconds = bis; } public int policy_type() { return org.omg.MessageRouting.UNLIMITED_PING_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return null; } public void destroy() { } }
6,726
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/UnlimitedPingPolicyFactory_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class UnlimitedPingPolicyFactory_impl implements org.omg.CORBA.portable.ValueFactory { public UnlimitedPingPolicyFactory_impl() { } public java.io.Serializable read_value( org.omg.CORBA_2_3.portable.InputStream in) { return in.read_value(new UnlimitedPingPolicy_impl()); } }
6,727
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/LimitedPingPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class LimitedPingPolicy_impl extends org.omg.MessageRouting.LimitedPing { public LimitedPingPolicy_impl() { } public LimitedPingPolicy_impl(short maxBackoffs, float backoffFactor, int bis, int intervalLimit) { max_backoffs = maxBackoffs; backoff_factor = backoffFactor; base_interval_seconds = bis; interval_limit = intervalLimit; } public int policy_type() { return org.omg.MessageRouting.LIMITED_PING_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return null; } public void destroy() { } }
6,728
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/ImmediateSuspendPolicyFactory_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class ImmediateSuspendPolicyFactory_impl implements org.omg.CORBA.portable.ValueFactory { public ImmediateSuspendPolicyFactory_impl() { } public java.io.Serializable read_value( org.omg.CORBA_2_3.portable.InputStream in) { return in.read_value(new ImmediateSuspendPolicy_impl()); } }
6,729
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/DecayPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class DecayPolicy_impl extends org.omg.MessageRouting.DecayPolicy { public DecayPolicy_impl() { } public DecayPolicy_impl(int decaySeconds) { decay_seconds = decaySeconds; } public int policy_type() { return org.omg.MessageRouting.DECAY_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return null; } public void destroy() { } }
6,730
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/LimitedPingPolicyFactory_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class LimitedPingPolicyFactory_impl implements org.omg.CORBA.portable.ValueFactory { public LimitedPingPolicyFactory_impl() { } public java.io.Serializable read_value( org.omg.CORBA_2_3.portable.InputStream in) { return in.read_value(new LimitedPingPolicy_impl()); } }
6,731
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/ResumePolicyFactory_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class ResumePolicyFactory_impl implements org.omg.CORBA.portable.ValueFactory { public ResumePolicyFactory_impl() { } public java.io.Serializable read_value( org.omg.CORBA_2_3.portable.InputStream in) { return in.read_value(new ResumePolicy_impl()); } }
6,732
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBMessageRouting/ResumePolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBMessageRouting; public class ResumePolicy_impl extends org.omg.MessageRouting.ResumePolicy { public ResumePolicy_impl() { } public ResumePolicy_impl(int resumeSeconds) { resume_seconds = resumeSeconds; } public int policy_type() { return org.omg.MessageRouting.RESUME_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return null; } public void destroy() { } }
6,733
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/yasf/YasfHelper.java
package org.apache.yoko.orb.yasf; import org.apache.yoko.util.yasf.Yasf; import org.omg.CORBA.Any; import org.omg.CORBA.BAD_PARAM; import org.omg.CORBA.INTERNAL; import org.omg.CORBA.ORB; import org.omg.IOP.ServiceContext; import org.omg.IOP.TaggedComponent; import org.omg.PortableInterceptor.ClientRequestInfo; import org.omg.PortableInterceptor.IORInfo; import org.omg.PortableInterceptor.InvalidSlot; import org.omg.PortableInterceptor.ServerRequestInfo; import java.util.Set; import static org.apache.yoko.orb.OB.MinorCodes.MinorInvalidComponentId; import static org.apache.yoko.orb.OB.MinorCodes.MinorInvalidServiceContextId; /** * Created by nrichard on 23/03/16. */ public enum YasfHelper { ; public static void addTc(IORInfo info, Set<Yasf> set) { TaggedComponent tc = new TaggedComponent(Yasf.TAG_YOKO_AUXILLIARY_STREAM_FORMAT, Yasf.toData(set)); info.add_ior_component(tc); } private static ServiceContext sc(Set<Yasf> set) { return new ServiceContext(Yasf.YOKO_AUXIllIARY_STREAM_FORMAT_SC, Yasf.toData(set)); } public static void addSc(ClientRequestInfo ri, Set<Yasf> set) { ServiceContext sc = sc(set); ri.add_request_service_context(sc, false); } public static void addSc(ServerRequestInfo ri, Set<Yasf> set) { ServiceContext sc = sc(set); ri.add_reply_service_context(sc, false); } public static byte[] readData(ClientRequestInfo ri) { try { TaggedComponent tc = ri.get_effective_component(Yasf.TAG_YOKO_AUXILLIARY_STREAM_FORMAT); return tc.component_data; } catch (BAD_PARAM e) { if (e.minor != MinorInvalidComponentId) { throw e; } } return null; } public static byte[] readData(ServerRequestInfo ri) { try { ServiceContext sc = ri.get_request_service_context(Yasf.YOKO_AUXIllIARY_STREAM_FORMAT_SC); return sc.context_data; } catch (BAD_PARAM e) { if (e.minor != MinorInvalidServiceContextId) { throw e; } } return null; } public static void setSlot(int slotId, ServerRequestInfo ri, byte[] data) { Any any = ORB.init().create_any(); any.insert_Value(data); try { ri.set_slot(slotId, any); } catch (InvalidSlot e) { throw (INTERNAL)(new INTERNAL(e.getMessage())).initCause(e); } } public static byte[] getSlot(int slotId, ServerRequestInfo ri) { try { Any any = ri.get_slot(slotId); return (byte[])any.extract_Value(); } catch (InvalidSlot e) { throw (INTERNAL)(new INTERNAL(e.getMessage())).initCause(e); } } }
6,734
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/yasf/YasfClientInterceptor.java
package org.apache.yoko.orb.yasf; import java.io.IOException; import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.apache.yoko.util.yasf.Yasf; import org.apache.yoko.util.yasf.YasfThreadLocal; import org.omg.CORBA.LocalObject; import org.omg.PortableInterceptor.ClientRequestInfo; import org.omg.PortableInterceptor.ClientRequestInterceptor; import org.omg.PortableInterceptor.ForwardRequest; public class YasfClientInterceptor extends LocalObject implements ClientRequestInterceptor { private static final String NAME = YasfClientInterceptor.class.getName(); @Override public void send_request(ClientRequestInfo ri) throws ForwardRequest { byte[] yasfData = YasfHelper.readData(ri); YasfThreadLocal.push(Yasf.toSet(yasfData)); YasfHelper.addSc(ri, Yasf.supported()); } @Override public void send_poll(ClientRequestInfo ri) { } @Override public void receive_reply(ClientRequestInfo ri) { YasfThreadLocal.pop(); } @Override public void receive_exception(ClientRequestInfo ri) throws ForwardRequest { YasfThreadLocal.pop(); } @Override public void receive_other(ClientRequestInfo ri) throws ForwardRequest { YasfThreadLocal.pop(); } @Override public String name() { return NAME; } @Override public void destroy() { } private void readObject(ObjectInputStream ios) throws IOException { throw new NotSerializableException(NAME); } private void writeObject(ObjectOutputStream oos) throws IOException { throw new NotSerializableException(NAME); } }
6,735
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/yasf/YasfIORInterceptor.java
package org.apache.yoko.orb.yasf; import java.io.IOException; import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.apache.yoko.util.yasf.Yasf; import org.omg.CORBA.LocalObject; import org.omg.PortableInterceptor.IORInfo; import org.omg.PortableInterceptor.IORInterceptor; public class YasfIORInterceptor extends LocalObject implements IORInterceptor { private static final String NAME = YasfIORInterceptor.class.getName(); @Override public void establish_components(IORInfo info) { YasfHelper.addTc(info, Yasf.supported()); } @Override public String name() { return NAME; } @Override public void destroy() { } private void readObject(ObjectInputStream ios) throws IOException { throw new NotSerializableException(NAME); } private void writeObject(ObjectOutputStream oos) throws IOException { throw new NotSerializableException(NAME); } }
6,736
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/yasf/YasfServerInterceptor.java
package org.apache.yoko.orb.yasf; import java.io.IOException; import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.apache.yoko.util.yasf.Yasf; import org.apache.yoko.util.yasf.YasfThreadLocal; import org.omg.CORBA.LocalObject; import org.omg.PortableInterceptor.ForwardRequest; import org.omg.PortableInterceptor.ServerRequestInfo; import org.omg.PortableInterceptor.ServerRequestInterceptor; public class YasfServerInterceptor extends LocalObject implements ServerRequestInterceptor { private static final String NAME = YasfServerInterceptor.class.getName(); private final int slotId; public YasfServerInterceptor(int slotId) { this.slotId = slotId; } @Override public void receive_request_service_contexts(ServerRequestInfo ri) throws ForwardRequest { YasfThreadLocal.reset(); byte[] yasfData = YasfHelper.readData(ri); YasfHelper.setSlot(slotId, ri, yasfData); } @Override public void receive_request(ServerRequestInfo ri) throws ForwardRequest { } @Override public void send_reply(ServerRequestInfo ri) { YasfThreadLocal.push(Yasf.toSet(YasfHelper.getSlot(slotId, ri))); // Adding for diagnostic purposes YasfHelper.addSc(ri, Yasf.supported()); } @Override public void send_exception(ServerRequestInfo ri) throws ForwardRequest { YasfThreadLocal.push(Yasf.toSet(YasfHelper.getSlot(slotId, ri))); // Adding for diagnostic purposes YasfHelper.addSc(ri, Yasf.supported()); } @Override public void send_other(ServerRequestInfo ri) throws ForwardRequest { YasfThreadLocal.push(Yasf.toSet(YasfHelper.getSlot(slotId, ri))); // Adding for diagnostic purposes YasfHelper.addSc(ri, Yasf.supported()); } @Override public String name() { return NAME; } @Override public void destroy() { } private void readObject(ObjectInputStream ios) throws IOException { throw new NotSerializableException(NAME); } private void writeObject(ObjectOutputStream oos) throws IOException { throw new NotSerializableException(NAME); } }
6,737
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/StringValueFactory.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; public final class StringValueFactory implements org.omg.CORBA.portable.ValueFactory { public java.io.Serializable read_value( org.omg.CORBA_2_3.portable.InputStream is) { return is.read_string(); } }
6,738
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ServerRequest.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; public class ServerRequest extends org.omg.CORBA.ServerRequest { private org.omg.PortableServer.DynamicImplementation servant_; private org.apache.yoko.orb.PortableServer.Delegate delegate_; private org.apache.yoko.orb.OB.Upcall up_; private org.omg.CORBA.portable.InputStream in_; private org.omg.CORBA.NVList arguments_; private org.omg.CORBA.Context ctx_; private org.omg.CORBA.Any result_; private org.omg.CORBA.Any exception_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String operation() { return up_.operation(); } public void arguments(org.omg.CORBA.NVList parameters) { if (arguments_ != null) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidUseOfDSIArguments), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidUseOfDSIArguments, org.omg.CORBA.CompletionStatus.COMPLETED_NO); try { arguments_ = parameters; in_ = delegate_._OB_preUnmarshal(servant_, up_); try { for (int i = 0; i < parameters.count(); i++) { org.omg.CORBA.NamedValue nv = parameters.item(i); if (nv.flags() != org.omg.CORBA.ARG_OUT.value) nv.value().read_value(in_, nv.value().type()); } } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.SystemException ex) { delegate_._OB_unmarshalEx(servant_, up_, ex); } } catch (org.apache.yoko.orb.OB.LocationForward ex) { // // Translate into a RuntimeException to bypass standardized // interfaces // throw new org.apache.yoko.orb.OB.RuntimeLocationForward(ex.ior, ex.perm); } if (up_ instanceof org.apache.yoko.orb.OB.PIUpcall) { org.apache.yoko.orb.OB.PIUpcall piup = (org.apache.yoko.orb.OB.PIUpcall) up_; piup.setArguments(parameters); } } public org.omg.CORBA.Context ctx() { if (arguments_ == null || ctx_ != null || result_ != null || exception_ != null) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidUseOfDSIContext), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidUseOfDSIContext, org.omg.CORBA.CompletionStatus.COMPLETED_NO); try { try { int len = in_.read_ulong(); String[] strings = new String[len]; for (int i = 0; i < len; i++) strings[i] = in_.read_string(); ctx_ = new Context(up_.orbInstance().getORB(), "", strings); } catch (org.omg.CORBA.SystemException ex) { delegate_._OB_unmarshalEx(servant_, up_, ex); } } catch (org.apache.yoko.orb.OB.LocationForward ex) { // // Translate into a RuntimeException to bypass standardized // interfaces // throw new org.apache.yoko.orb.OB.RuntimeLocationForward(ex.ior, ex.perm); } return ctx_; } public void set_result(org.omg.CORBA.Any value) { if (arguments_ == null || result_ != null || exception_ != null) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidUseOfDSIResult), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidUseOfDSIResult, org.omg.CORBA.CompletionStatus.COMPLETED_NO); result_ = value; if (up_ instanceof org.apache.yoko.orb.OB.PIUpcall) { org.apache.yoko.orb.OB.PIUpcall piup = (org.apache.yoko.orb.OB.PIUpcall) up_; piup.setResult(value); } } public void set_exception(org.omg.CORBA.Any value) { if (arguments_ == null) throw new org.omg.CORBA.BAD_INV_ORDER("arguments() has not " + "been called"); if (result_ != null) throw new org.omg.CORBA.BAD_INV_ORDER("set_result() has already " + "been called"); if (exception_ != null) throw new org.omg.CORBA.BAD_INV_ORDER("set_exception() has " + "already been called"); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(value.type()); if (origTC.kind() != org.omg.CORBA.TCKind.tk_except) throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorNoExceptionInAny), org.apache.yoko.orb.OB.MinorCodes.MinorNoExceptionInAny, org.omg.CORBA.CompletionStatus.COMPLETED_NO); exception_ = value; } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ServerRequest(org.omg.PortableServer.DynamicImplementation servant, org.apache.yoko.orb.OB.Upcall upcall) { servant_ = servant; delegate_ = (org.apache.yoko.orb.PortableServer.Delegate) servant ._get_delegate(); up_ = upcall; } public org.omg.CORBA.Any _OB_exception() { return exception_; } public void _OB_finishUnmarshal() throws org.apache.yoko.orb.OB.LocationForward { if (arguments_ == null) delegate_._OB_preUnmarshal(servant_, up_); delegate_._OB_postUnmarshal(servant_, up_); } public void _OB_postinvoke() throws org.apache.yoko.orb.OB.LocationForward { if (exception_ == null) delegate_._OB_postinvoke(servant_, up_); } public void _OB_doMarshal() throws org.apache.yoko.orb.OB.LocationForward { if (exception_ != null) { org.omg.CORBA.TypeCode tc = exception_.type(); String id = null; try { id = tc.id(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } if (org.apache.yoko.orb.OB.Util.isSystemException(id)) { org.omg.CORBA.portable.InputStream in = exception_ .create_input_stream(); org.omg.CORBA.SystemException ex = org.apache.yoko.orb.OB.Util .unmarshalSystemException(in); throw ex; } else { up_.setUserException(exception_); } } else { org.omg.CORBA.portable.OutputStream out = delegate_._OB_preMarshal( servant_, up_); try { if (result_ != null) result_.write_value(out); if (arguments_ != null) { try { for (int i = 0; i < arguments_.count(); i++) { org.omg.CORBA.NamedValue nv = arguments_.item(i); if (nv.flags() != org.omg.CORBA.ARG_IN.value) { nv.value().write_value(out); } } } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } } catch (org.omg.CORBA.SystemException ex) { delegate_._OB_marshalEx(servant_, up_, ex); } delegate_._OB_postMarshal(servant_, up_); } } }
6,739
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/WStringValueFactory.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; public final class WStringValueFactory implements org.omg.CORBA.portable.ValueFactory { public java.io.Serializable read_value( org.omg.CORBA_2_3.portable.InputStream is) { return is.read_wstring(); } }
6,740
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/Any.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; import java.util.logging.Logger; import java.util.logging.Level; import org.apache.yoko.orb.OB.MinorCodes; import org.omg.CORBA.CompletionStatus; import org.omg.CORBA.Object; final public class Any extends org.omg.CORBA.Any { static final Logger logger = Logger.getLogger(Any.class.getName()); private org.apache.yoko.orb.OB.ORBInstance orbInstance_; private org.omg.CORBA.TypeCode type_; private org.omg.CORBA.TypeCode obType_; private org.omg.CORBA.TypeCode origType_; private java.lang.Object value_; // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ private void checkValue(org.omg.CORBA.TCKind kind, boolean allowNull) throws org.omg.CORBA.BAD_OPERATION { if (origType_.kind().value() != kind.value()) throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, CompletionStatus.COMPLETED_NO); if (!allowNull && value_ == null) throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorNullValueNotAllowed), org.apache.yoko.orb.OB.MinorCodes.MinorNullValueNotAllowed, CompletionStatus.COMPLETED_NO); } private boolean compare(org.apache.yoko.orb.OCI.Buffer buf1, org.apache.yoko.orb.OCI.Buffer buf2) { int len1 = buf1.length(); int len2 = buf2.length(); if (len1 != len2) return false; byte[] data1 = buf1.data(); byte[] data2 = buf2.data(); for (int i = 0; i < len1; i++) if (data1[i] != data2[i]) return false; return true; } public void setType(org.omg.CORBA.TypeCode tc) { // // Save the original TypeCode. Note that this TypeCode // could have been created by another ORB. Also note that // DII-based portable stubs (such as those built into the // JDK in 1.2/1.3) use the equals() method to compare // TypeCodes, so we *must* preserve the original. // type_ = tc; // // Get an equivalent Yoko TypeCode // if (tc instanceof TypeCode) obType_ = tc; else obType_ = TypeCode._OB_convertForeignTypeCode(tc); // // Cache the unaliased TypeCode // origType_ = TypeCode._OB_getOrigType(obType_); } private void readValue(org.omg.CORBA.portable.InputStream in) { int kind = origType_.kind().value(); logger.fine("Reading ANY value of kind " + kind); // // Spec says that calling read_value when a Streamable has // previously been inserted will update the Streamable // if (value_ instanceof org.omg.CORBA.portable.Streamable && kind != org.omg.CORBA.TCKind._tk_value && kind != org.omg.CORBA.TCKind._tk_value_box && kind != org.omg.CORBA.TCKind._tk_abstract_interface) { ((org.omg.CORBA.portable.Streamable) value_)._read(in); return; } switch (kind) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: value_ = null; break; case org.omg.CORBA.TCKind._tk_short: value_ = new Integer(in.read_short()); break; case org.omg.CORBA.TCKind._tk_long: value_ = new Integer(in.read_long()); break; case org.omg.CORBA.TCKind._tk_longlong: value_ = new Long(in.read_longlong()); break; case org.omg.CORBA.TCKind._tk_ushort: value_ = new Integer(in.read_ushort()); break; case org.omg.CORBA.TCKind._tk_ulong: value_ = new Integer(in.read_ulong()); break; case org.omg.CORBA.TCKind._tk_ulonglong: value_ = new Long(in.read_ulonglong()); break; case org.omg.CORBA.TCKind._tk_float: value_ = new Float(in.read_float()); break; case org.omg.CORBA.TCKind._tk_double: value_ = new Double(in.read_double()); break; case org.omg.CORBA.TCKind._tk_boolean: value_ = Boolean.valueOf(in.read_boolean()); break; case org.omg.CORBA.TCKind._tk_char: value_ = new Character(in.read_char()); break; case org.omg.CORBA.TCKind._tk_wchar: value_ = new Character(in.read_wchar()); break; case org.omg.CORBA.TCKind._tk_octet: value_ = new Byte(in.read_octet()); break; case org.omg.CORBA.TCKind._tk_any: value_ = in.read_any(); break; case org.omg.CORBA.TCKind._tk_TypeCode: value_ = in.read_TypeCode(); break; case org.omg.CORBA.TCKind._tk_Principal: value_ = in.read_Principal(); break; case org.omg.CORBA.TCKind._tk_objref: value_ = in.read_Object(); break; case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: case org.omg.CORBA.TCKind._tk_union: case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: { org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); out.write_InputStream(in, origType_); InputStream is = (InputStream) out.create_input_stream(); // This is not necessary // in._OB_ORBInstance(orbInstance_); value_ = is; break; } case org.omg.CORBA.TCKind._tk_value: case org.omg.CORBA.TCKind._tk_value_box: case org.omg.CORBA.TCKind._tk_abstract_interface: { try { InputStream is = (InputStream) in; // this is a useful tracepoint, but produces a lot of data, so turn on only // if really needed. // if (logger.isLoggable(Level.FINEST)) { // logger.finest("Reading value from \n\n" + is.dumpData()); // } is.read_value(this, type_); } catch (ClassCastException ex) { try { org.omg.CORBA_2_3.portable.InputStream is = (org.omg.CORBA_2_3.portable.InputStream) in; value_ = is.read_value(type_.id()); } catch (org.omg.CORBA.TypeCodePackage.BadKind e) { org.apache.yoko.orb.OB.Assert._OB_assert(e); } } break; } case org.omg.CORBA.TCKind._tk_enum: value_ = new Integer(in.read_ulong()); break; case org.omg.CORBA.TCKind._tk_string: { try { String str = in.read_string(); int len = origType_.length(); if (len != 0 && str.length() > len) throw new org.omg.CORBA.MARSHAL("string length (" + str.length() + ") exceeds " + "bound (" + len + ")", org.apache.yoko.orb.OB.MinorCodes.MinorReadStringOverflow, CompletionStatus.COMPLETED_NO); value_ = str; } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } break; } case org.omg.CORBA.TCKind._tk_wstring: { try { String str = in.read_wstring(); int len = origType_.length(); if (len != 0 && str.length() > len) throw new org.omg.CORBA.MARSHAL("wstring length (" + str.length() + ") exceeds " + "bound (" + len + ")", org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow, CompletionStatus.COMPLETED_NO); value_ = str; } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } break; } case org.omg.CORBA.TCKind._tk_fixed: { try { value_ = in.read_fixed().movePointLeft(origType_.fixed_scale()); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } break; } case org.omg.CORBA.TCKind._tk_native: throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorNativeNotSupported), org.apache.yoko.orb.OB.MinorCodes.MinorNativeNotSupported, CompletionStatus.COMPLETED_NO); case org.omg.CORBA_2_4.TCKind._tk_local_interface: throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorLocalObject), org.apache.yoko.orb.OB.MinorCodes.MinorLocalObject, org.omg.CORBA.CompletionStatus.COMPLETED_NO); case org.omg.CORBA.TCKind._tk_alias: default: throw new org.omg.CORBA.DATA_CONVERSION( org.apache.yoko.orb.OB.MinorCodes .describeDataConversion(org.apache.yoko.orb.OB.MinorCodes.MinorNoAlias), org.apache.yoko.orb.OB.MinorCodes.MinorNoAlias, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } } private void copyFrom(Any any) { orbInstance_ = any.orbInstance_; type_ = any.type_; obType_ = any.obType_; origType_ = any.origType_; if (any.value_ instanceof org.omg.CORBA.portable.Streamable) { readValue(any.create_input_stream()); return; } if (any.value_ == null) { value_ = null; return; } int kind = origType_.kind().value(); switch (kind) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ushort: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_float: case org.omg.CORBA.TCKind._tk_double: case org.omg.CORBA.TCKind._tk_boolean: case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_wchar: case org.omg.CORBA.TCKind._tk_octet: case org.omg.CORBA.TCKind._tk_enum: case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: case org.omg.CORBA.TCKind._tk_fixed: case org.omg.CORBA.TCKind._tk_TypeCode: case org.omg.CORBA.TCKind._tk_Principal: case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA_2_4.TCKind._tk_local_interface: value_ = any.value_; break; case org.omg.CORBA.TCKind._tk_any: case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: case org.omg.CORBA.TCKind._tk_union: case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: readValue(any.create_input_stream()); break; case org.omg.CORBA.TCKind._tk_value: case org.omg.CORBA.TCKind._tk_value_box: case org.omg.CORBA.TCKind._tk_abstract_interface: if (any.value_ instanceof InputStream) readValue(any.create_input_stream()); else value_ = any.value_; break; case org.omg.CORBA.TCKind._tk_native: value_ = any.value_; break; case org.omg.CORBA.TCKind._tk_alias: default: org.apache.yoko.orb.OB.Assert._OB_assert("tk_alias not supported for copying"); } } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized boolean equal(org.omg.CORBA.Any a) { if (a == null) return false; if (this == a) return true; if (!type_.equal(a.type())) return false; Any any = null; try { any = (Any) a; } catch (ClassCastException ex) { // // Argument may have been created by a foreign singleton ORB, // so we'll use a temporary. // any = new Any(a); } if (value_ == any.value_) return true; if (value_ == null || any.value_ == null) return false; if (value_ instanceof org.omg.CORBA.portable.Streamable && any.value_ instanceof org.omg.CORBA.portable.Streamable) { OutputStream os1 = (OutputStream) create_output_stream(); ((org.omg.CORBA.portable.Streamable) value_)._write(os1); OutputStream os2 = (OutputStream) create_output_stream(); ((org.omg.CORBA.portable.Streamable) any.value_)._write(os2); return compare(os1._OB_buffer(), os2._OB_buffer()); } int kind = origType_.kind().value(); switch (kind) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: return true; case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ushort: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_float: case org.omg.CORBA.TCKind._tk_double: case org.omg.CORBA.TCKind._tk_boolean: case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_wchar: case org.omg.CORBA.TCKind._tk_octet: case org.omg.CORBA.TCKind._tk_enum: case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: case org.omg.CORBA.TCKind._tk_fixed: return value_.equals(any.value_); case org.omg.CORBA.TCKind._tk_any: return extract_any().equal(any.extract_any()); case org.omg.CORBA.TCKind._tk_TypeCode: return extract_TypeCode().equal(any.extract_TypeCode()); case org.omg.CORBA.TCKind._tk_Principal: return extract_Principal().equals(any.extract_Principal()); case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA_2_4.TCKind._tk_local_interface: return extract_Object()._is_equivalent(any.extract_Object()); case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: case org.omg.CORBA.TCKind._tk_union: case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: { org.apache.yoko.orb.OCI.Buffer buf1 = ((InputStream) value_) ._OB_buffer(); org.apache.yoko.orb.OCI.Buffer buf2 = ((InputStream) any.value_) ._OB_buffer(); return compare(buf1, buf2); } case org.omg.CORBA.TCKind._tk_value: case org.omg.CORBA.TCKind._tk_value_box: { if (value_ instanceof InputStream && any.value_ instanceof InputStream) { org.apache.yoko.orb.OCI.Buffer buf1 = ((InputStream) value_) ._OB_buffer(); org.apache.yoko.orb.OCI.Buffer buf2 = ((InputStream) any.value_) ._OB_buffer(); return compare(buf1, buf2); } else return false; } case org.omg.CORBA.TCKind._tk_abstract_interface: { if (value_ instanceof org.omg.CORBA.Object && any.value_ instanceof org.omg.CORBA.Object) { return extract_Object()._is_equivalent(any.extract_Object()); } else if (value_ instanceof InputStream && any.value_ instanceof InputStream) { org.apache.yoko.orb.OCI.Buffer buf1 = ((InputStream) value_) ._OB_buffer(); org.apache.yoko.orb.OCI.Buffer buf2 = ((InputStream) any.value_) ._OB_buffer(); return compare(buf1, buf2); } return false; } case org.omg.CORBA.TCKind._tk_native: return (value_ == any.value_); case org.omg.CORBA.TCKind._tk_alias: default: org.apache.yoko.orb.OB.Assert._OB_assert("tk_alias not supported for comparison"); } return false; // The compiler needs this } public synchronized org.omg.CORBA.TypeCode type() { return type_; } public synchronized void type(org.omg.CORBA.TypeCode tc) { setType(tc); value_ = null; } public synchronized void read_value(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.TypeCode tc) throws org.omg.CORBA.MARSHAL { setType(tc); readValue(in); } public synchronized void write_value(org.omg.CORBA.portable.OutputStream out) { int kind = origType_.kind().value(); if (value_ instanceof org.omg.CORBA.portable.Streamable && kind != org.omg.CORBA.TCKind._tk_value && kind != org.omg.CORBA.TCKind._tk_value_box && kind != org.omg.CORBA.TCKind._tk_abstract_interface) { ((org.omg.CORBA.portable.Streamable) value_)._write(out); return; } switch (kind) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: break; case org.omg.CORBA.TCKind._tk_short: out.write_short((short) ((Integer) value_).intValue()); break; case org.omg.CORBA.TCKind._tk_long: out.write_long(((Integer) value_).intValue()); break; case org.omg.CORBA.TCKind._tk_longlong: out.write_longlong(((Long) value_).longValue()); break; case org.omg.CORBA.TCKind._tk_ushort: out.write_ushort((short) ((Integer) value_).intValue()); break; case org.omg.CORBA.TCKind._tk_ulong: out.write_ulong(((Integer) value_).intValue()); break; case org.omg.CORBA.TCKind._tk_ulonglong: out.write_ulonglong(((Long) value_).longValue()); break; case org.omg.CORBA.TCKind._tk_float: out.write_float(((Float) value_).floatValue()); break; case org.omg.CORBA.TCKind._tk_double: out.write_double(((Double) value_).doubleValue()); break; case org.omg.CORBA.TCKind._tk_boolean: out.write_boolean(((Boolean) value_).booleanValue()); break; case org.omg.CORBA.TCKind._tk_char: out.write_char(((Character) value_).charValue()); break; case org.omg.CORBA.TCKind._tk_wchar: out.write_wchar(((Character) value_).charValue()); break; case org.omg.CORBA.TCKind._tk_octet: out.write_octet(((Byte) value_).byteValue()); break; case org.omg.CORBA.TCKind._tk_any: out.write_any((org.omg.CORBA.Any) value_); break; case org.omg.CORBA.TCKind._tk_TypeCode: out.write_TypeCode((org.omg.CORBA.TypeCode) value_); break; case org.omg.CORBA.TCKind._tk_Principal: out.write_Principal((org.omg.CORBA.Principal) value_); break; case org.omg.CORBA.TCKind._tk_objref: out.write_Object((org.omg.CORBA.Object) value_); break; case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: case org.omg.CORBA.TCKind._tk_union: case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: { OutputStream o = (OutputStream) out; InputStream in = (InputStream) value_; in._OB_reset(); o.write_InputStream(in, type_); break; } case org.omg.CORBA.TCKind._tk_value: { OutputStream o = (OutputStream) out; if (value_ instanceof InputStream) { InputStream in = (InputStream) value_; in._OB_reset(); o.write_InputStream(in, type_); } else o.write_value((java.io.Serializable) value_); break; } case org.omg.CORBA.TCKind._tk_value_box: { OutputStream o = (OutputStream) out; if (value_ instanceof InputStream) { InputStream in = (InputStream) value_; in._OB_reset(); o.write_InputStream(in, type_); } else { o.write_value((java.io.Serializable) value_, origType_, null); } break; } case org.omg.CORBA.TCKind._tk_enum: out.write_ulong(((Integer) value_).intValue()); break; case org.omg.CORBA.TCKind._tk_string: out.write_string((String) value_); break; case org.omg.CORBA.TCKind._tk_wstring: out.write_wstring((String) value_); break; case org.omg.CORBA.TCKind._tk_fixed: { // TODO: check ranges here? compare scale against TypeCode? try { out.write_fixed(((java.math.BigDecimal) value_) .movePointRight(origType_.fixed_scale())); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } break; } case org.omg.CORBA.TCKind._tk_abstract_interface: { OutputStream o = (OutputStream) out; if (value_ != null && value_ instanceof InputStream) { InputStream in = (InputStream) value_; in._OB_reset(); org.apache.yoko.orb.OB.Assert ._OB_assert(in.read_boolean() == false); o.write_abstract_interface(in.read_value()); } else o.write_abstract_interface(value_); break; } case org.omg.CORBA.TCKind._tk_native: throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorNativeNotSupported), org.apache.yoko.orb.OB.MinorCodes.MinorNativeNotSupported, CompletionStatus.COMPLETED_NO); case org.omg.CORBA_2_4.TCKind._tk_local_interface: throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorLocalObject), org.apache.yoko.orb.OB.MinorCodes.MinorLocalObject, org.omg.CORBA.CompletionStatus.COMPLETED_NO); case org.omg.CORBA.TCKind._tk_alias: default: org.apache.yoko.orb.OB.Assert._OB_assert("unable to write tk_alias types"); } } public synchronized org.omg.CORBA.portable.OutputStream create_output_stream() { // TODO: // Spec says that calling create_output_stream and // writing to the any will update the state of the // last streamable object, if present. org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); return out; } public synchronized org.omg.CORBA.portable.InputStream create_input_stream() { if (value_ instanceof InputStream) { return ((InputStream) value_)._OB_clone(); } else { org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); write_value(out); return out.create_input_stream(); } } public synchronized short extract_short() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_short, false); return (short) ((Integer) value_).intValue(); } public synchronized void insert_short(short val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_short)); value_ = new Integer(val); } public synchronized int extract_long() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_long, false); return ((Integer) value_).intValue(); } public synchronized void insert_long(int val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_long)); value_ = new Integer(val); } public synchronized long extract_longlong() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_longlong, false); return ((Long) value_).longValue(); } public synchronized void insert_longlong(long val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_longlong)); value_ = new Long(val); } public synchronized short extract_ushort() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_ushort, false); return (short) ((Integer) value_).intValue(); } public synchronized void insert_ushort(short val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_ushort)); value_ = new Integer(val); } public synchronized int extract_ulong() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_ulong, false); return ((Integer) value_).intValue(); } public synchronized void insert_ulong(int val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_ulong)); value_ = new Integer(val); } public synchronized long extract_ulonglong() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_ulonglong, false); return ((Long) value_).longValue(); } public synchronized void insert_ulonglong(long val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_ulonglong)); value_ = new Long(val); } public synchronized boolean extract_boolean() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_boolean, false); return ((Boolean) value_).booleanValue(); } public synchronized void insert_boolean(boolean val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_boolean)); value_ = new Boolean(val); } public synchronized char extract_char() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_char, false); return ((Character) value_).charValue(); } public synchronized void insert_char(char val) throws org.omg.CORBA.DATA_CONVERSION { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_char)); value_ = new Character(val); } public synchronized char extract_wchar() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_wchar, false); return ((Character) value_).charValue(); } public synchronized void insert_wchar(char val) throws org.omg.CORBA.DATA_CONVERSION { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_wchar)); value_ = new Character(val); } public synchronized byte extract_octet() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_octet, false); return ((Byte) value_).byteValue(); } public synchronized void insert_octet(byte val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_octet)); value_ = new Byte(val); } public synchronized float extract_float() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_float, false); return ((Float) value_).floatValue(); } public synchronized void insert_float(float val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_float)); value_ = new Float(val); } public synchronized double extract_double() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_double, false); return ((Double) value_).doubleValue(); } public synchronized void insert_double(double val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_double)); value_ = new Double(val); } public synchronized org.omg.CORBA.Any extract_any() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_any, false); return (org.omg.CORBA.Any) value_; } public synchronized void insert_any(org.omg.CORBA.Any val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_any)); value_ = val; } public synchronized org.omg.CORBA.TypeCode extract_TypeCode() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_TypeCode, false); return (org.omg.CORBA.TypeCode) value_; } public synchronized void insert_TypeCode(org.omg.CORBA.TypeCode val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_TypeCode)); value_ = val; } public synchronized org.omg.CORBA.Principal extract_Principal() throws org.omg.CORBA.BAD_OPERATION { // Deprecated by CORBA 2.2 throw new org.omg.CORBA.NO_IMPLEMENT(); } public synchronized void insert_Principal(org.omg.CORBA.Principal val) { // Deprecated by CORBA 2.2 throw new org.omg.CORBA.NO_IMPLEMENT(); } public synchronized org.omg.CORBA.Object extract_Object() throws org.omg.CORBA.BAD_OPERATION { org.omg.CORBA.TCKind kind = origType_.kind(); if (kind != org.omg.CORBA.TCKind.tk_objref && kind != org.omg.CORBA.TCKind.tk_abstract_interface && kind != org.omg.CORBA_2_4.TCKind.tk_local_interface) { throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, CompletionStatus.COMPLETED_NO); } if (value_ != null && !(value_ instanceof org.omg.CORBA.Object)) { throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, CompletionStatus.COMPLETED_NO); } return (org.omg.CORBA.Object) value_; } public synchronized void insert_Object(org.omg.CORBA.Object val) { // // If we don't have an ORB instance, then try to get one from // the object reference // if (orbInstance_ == null && val != null) { try { Delegate d = (Delegate) ((org.omg.CORBA.portable.ObjectImpl) val) ._get_delegate(); orbInstance_ = d._OB_ORBInstance(); } catch (org.omg.CORBA.BAD_OPERATION ex) { // Object has no delegate - ignore } } org.omg.CORBA.TypeCode tc = org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_objref); insert_Object(val, tc); } public synchronized void insert_Object(org.omg.CORBA.Object val, org.omg.CORBA.TypeCode tc) { // // If we don't have an ORB instance, then try to get one from // the object reference // if (orbInstance_ == null && val != null) { try { Delegate d = (Delegate) ((org.omg.CORBA.portable.ObjectImpl) val) ._get_delegate(); orbInstance_ = d._OB_ORBInstance(); } catch (org.omg.CORBA.BAD_OPERATION ex) { // Object has no delegate - ignore } } type(tc); value_ = val; } public synchronized String extract_string() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_string, false); return (String) value_; } public synchronized void insert_string(String val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_string)); value_ = val; } public synchronized String extract_wstring() throws org.omg.CORBA.BAD_OPERATION { checkValue(org.omg.CORBA.TCKind.tk_wstring, false); return (String) value_; } public synchronized void insert_wstring(String val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_wstring)); value_ = val; } public org.omg.CORBA.portable.Streamable extract_Streamable() throws org.omg.CORBA.BAD_INV_ORDER { if (!(value_ instanceof org.omg.CORBA.portable.Streamable)) throw new org.omg.CORBA.BAD_INV_ORDER("Type mismatch"); return (org.omg.CORBA.portable.Streamable) value_; } public synchronized void insert_Streamable( org.omg.CORBA.portable.Streamable val) { type(val._type()); value_ = val; } public synchronized java.math.BigDecimal extract_fixed() { checkValue(org.omg.CORBA.TCKind.tk_fixed, false); return (java.math.BigDecimal) value_; } public synchronized void insert_fixed(java.math.BigDecimal val) { type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_fixed)); value_ = val; } public synchronized void insert_fixed(java.math.BigDecimal val, org.omg.CORBA.TypeCode tc) throws org.omg.CORBA.BAD_INV_ORDER { type(tc); value_ = val; } public java.io.Serializable extract_Value() throws org.omg.CORBA.BAD_OPERATION { org.omg.CORBA.TCKind kind = origType_.kind(); if (kind != org.omg.CORBA.TCKind.tk_value && kind != org.omg.CORBA.TCKind.tk_value_box && kind != org.omg.CORBA.TCKind.tk_abstract_interface) { throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, CompletionStatus.COMPLETED_NO); } if (kind == org.omg.CORBA.TCKind.tk_abstract_interface && value_ instanceof org.omg.CORBA.Object) { throw new org.omg.CORBA.BAD_OPERATION( org.apache.yoko.orb.OB.MinorCodes .describeBadOperation(org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch), org.apache.yoko.orb.OB.MinorCodes.MinorTypeMismatch, CompletionStatus.COMPLETED_NO); } if (value_ instanceof InputStream) { InputStream in = (InputStream) value_; in._OB_reset(); if (kind == org.omg.CORBA.TCKind.tk_abstract_interface) org.apache.yoko.orb.OB.Assert ._OB_assert(in.read_boolean() == false); return in.read_value(); } else return (java.io.Serializable) value_; } public synchronized void insert_Value(java.io.Serializable val) { org.omg.CORBA.TypeCode tc = org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_value); insert_Value(val, tc); } public synchronized void insert_Value(java.io.Serializable val, org.omg.CORBA.TypeCode tc) throws org.omg.CORBA.MARSHAL { type(tc); value_ = val; } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public Any() { this((org.apache.yoko.orb.OB.ORBInstance) null); } public Any(org.apache.yoko.orb.OB.ORBInstance orbInstance) { orbInstance_ = orbInstance; type(org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_null)); value_ = null; } public Any(Any any) { copyFrom(any); } public Any(org.omg.CORBA.Any any) { // // This constructor creates a new Any using the standard interface // // // Optimization // if (any instanceof Any) { copyFrom((Any) any); return; } orbInstance_ = null; setType(any.type()); switch (origType_.kind().value()) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: case org.omg.CORBA.TCKind._tk_Principal: break; case org.omg.CORBA.TCKind._tk_short: value_ = new Integer(any.extract_short()); break; case org.omg.CORBA.TCKind._tk_long: value_ = new Integer(any.extract_long()); break; case org.omg.CORBA.TCKind._tk_longlong: value_ = new Long(any.extract_longlong()); break; case org.omg.CORBA.TCKind._tk_ushort: value_ = new Integer(any.extract_ushort()); break; case org.omg.CORBA.TCKind._tk_ulong: value_ = new Integer(any.extract_ulong()); break; case org.omg.CORBA.TCKind._tk_ulonglong: value_ = new Long(any.extract_ulonglong()); break; case org.omg.CORBA.TCKind._tk_float: value_ = new Float(any.extract_float()); break; case org.omg.CORBA.TCKind._tk_double: value_ = new Double(any.extract_double()); break; case org.omg.CORBA.TCKind._tk_boolean: value_ = new Boolean(any.extract_boolean()); break; case org.omg.CORBA.TCKind._tk_char: value_ = new Character(any.extract_char()); break; case org.omg.CORBA.TCKind._tk_wchar: value_ = new Character(any.extract_wchar()); break; case org.omg.CORBA.TCKind._tk_octet: value_ = new Byte(any.extract_octet()); break; case org.omg.CORBA.TCKind._tk_string: value_ = any.extract_string(); break; case org.omg.CORBA.TCKind._tk_wstring: value_ = any.extract_wstring(); break; case org.omg.CORBA.TCKind._tk_fixed: value_ = any.extract_fixed(); break; case org.omg.CORBA.TCKind._tk_TypeCode: value_ = any.extract_TypeCode(); break; case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA.TCKind._tk_abstract_interface: case org.omg.CORBA_2_4.TCKind._tk_local_interface: try { value_ = any.extract_Object(); break; } catch (org.omg.CORBA.BAD_OPERATION ex) { // // Any must hold an abstract interface representing // a valuetype, so fall through to default case // } default: readValue(any.create_input_stream()); break; } } public Any(org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type, java.lang.Object value) { orbInstance_ = orbInstance; setType(type); value_ = value; } public synchronized java.lang.Object value() { return value_; } public synchronized void replace(org.omg.CORBA.TypeCode tc, java.lang.Object value) { setType(tc); value_ = value; } public synchronized org.apache.yoko.orb.OB.ORBInstance _OB_ORBInstance() { return orbInstance_; } public synchronized void _OB_ORBInstance( org.apache.yoko.orb.OB.ORBInstance orbInstance) { orbInstance_ = orbInstance; } public synchronized org.omg.CORBA.TypeCode _OB_type() { return obType_; } }
6,741
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/Environment.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class Environment extends org.omg.CORBA.Environment { private java.lang.Exception exception_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public void exception(java.lang.Exception except) { exception_ = except; } public java.lang.Exception exception() { return exception_; } public void clear() { exception_ = null; } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public Environment() { } }
6,742
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/InputStreamHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class InputStreamHolder { public InputStream value; public InputStreamHolder() { } public InputStreamHolder(InputStream initial) { value = initial; } }
6,743
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ObjectImpl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; import static org.apache.yoko.orb.OCI.GiopVersion.GIOP1_2; import org.apache.yoko.osgi.ProviderLocator; // // ObjectImpl is the base class for proprietary stubs with full // interceptor support // abstract public class ObjectImpl extends org.omg.CORBA_2_4.portable.ObjectImpl { public org.apache.yoko.orb.OB.DowncallStub _OB_getDowncallStub() throws org.apache.yoko.orb.OB.LocationForward, org.apache.yoko.orb.OB.FailureException { Delegate delegate = (Delegate) _get_delegate(); return delegate._OB_getDowncallStub(this); } public void _OB_handleException(Exception ex, RetryInfo info) { Delegate delegate = (Delegate) _get_delegate(); delegate._OB_handleException(this, ex, info, false); } public org.apache.yoko.orb.OB.GIOPOutgoingMessage _OB_ami_router_preMarshal( String operation, boolean responseExpected, OutputStreamHolder out, org.apache.yoko.orb.OCI.ProfileInfoHolder info) { Delegate delegate = (Delegate) _get_delegate(); try { org.apache.yoko.orb.OB.DowncallStub downStub = delegate ._OB_getDowncallStub(this); org.apache.yoko.orb.OB.GIOPOutgoingMessage message = downStub .AMIRouterPreMarshal(operation, responseExpected, out, info); return message; } catch (org.apache.yoko.orb.OB.LocationForward ex) { } catch (org.apache.yoko.orb.OB.FailureException ex) { } return null; } public void _OB_ami_router_postMarshal( org.apache.yoko.orb.OB.GIOPOutgoingMessage message, OutputStreamHolder out) { Delegate delegate = (Delegate) _get_delegate(); try { org.apache.yoko.orb.OB.DowncallStub downStub = delegate ._OB_getDowncallStub(this); downStub.AMIRouterPostMarshal(message, out); } catch (org.apache.yoko.orb.OB.LocationForward ex) { } catch (org.apache.yoko.orb.OB.FailureException ex) { } } // public org.apache.yoko.orb.CORBA.OutputStream public org.apache.yoko.orb.OB.CodeConverters _OB_setup_ami_poll_request( org.omg.IOP.ServiceContextListHolder sclHolder, org.apache.yoko.orb.CORBA.OutputStreamHolder out) { Delegate delegate = (Delegate) _get_delegate(); try { org.apache.yoko.orb.OB.DowncallStub downStub = delegate ._OB_getDowncallStub(this); org.apache.yoko.orb.OB.CodeConverters cc = downStub .setupPollingRequest(sclHolder, out); return cc; } catch (org.apache.yoko.orb.OB.LocationForward ex) { } catch (org.apache.yoko.orb.OB.FailureException ex) { } return null; } public org.omg.CORBA.Object _OB_get_ami_poll_target() { // // This is needed since we don't have access to the IOR information // from the DowncallStub like we do in C++ (MarshalStub) // Delegate delegate = (Delegate) _get_delegate(); try { org.apache.yoko.orb.OB.DowncallStub downStub = delegate ._OB_getDowncallStub(this); return downStub.getAMIPollTarget(); } catch (org.apache.yoko.orb.OB.LocationForward ex) { } catch (org.apache.yoko.orb.OB.FailureException ex) { } return null; } public org.apache.yoko.orb.OB.ORBInstance _OB_get_ami_poll_ORBInstance() { // // We need to be able to retrieve the ORB instance to use with a // persistent poller in case we want to use pollable sets // Delegate delegate = (Delegate) _get_delegate(); try { org.apache.yoko.orb.OB.DowncallStub downStub = delegate ._OB_getDowncallStub(this); return downStub._OB_getORBInstance(); } catch (org.apache.yoko.orb.OB.LocationForward ex) { } catch (org.apache.yoko.orb.OB.FailureException ex) { } return null; } public org.omg.MessageRouting.PersistentRequest _OB_ami_poll_request( org.omg.CORBA.portable.OutputStream out, String operation, org.omg.IOP.ServiceContext[] scl) throws org.omg.CORBA.portable.RemarshalException { Delegate delegate = (Delegate) _get_delegate(); try { org.apache.yoko.orb.OB.DowncallStub downStub = delegate ._OB_getDowncallStub(this); org.omg.MessageRouting.PersistentRequest req = downStub .ami_poll_request(out, operation, scl); return req; } catch (org.apache.yoko.orb.OB.LocationForward ex) { } catch (org.apache.yoko.orb.OB.FailureException ex) { } // // Something happened other than what we expected. Remarshal so // the stub can try again. // throw new org.omg.CORBA.portable.RemarshalException(); } public boolean _OB_ami_callback_request( org.omg.CORBA.portable.OutputStream out, org.omg.Messaging.ReplyHandler reply, org.apache.yoko.orb.OCI.ProfileInfo info) throws org.omg.CORBA.portable.RemarshalException { Delegate delegate = (Delegate) _get_delegate(); boolean success = false; try { org.apache.yoko.orb.OB.DowncallStub downStub = delegate ._OB_getDowncallStub(this); success = downStub.ami_callback_request(out, reply, info); } catch (org.apache.yoko.orb.OB.LocationForward ex) { } catch (org.apache.yoko.orb.OB.FailureException ex) { } return success; } public org.omg.Messaging._ExceptionHolder _OB_repackageException( java.lang.Exception ex, boolean system_exception) { // // Create a stream for writing our exception // org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer( 32); org.apache.yoko.orb.CORBA.OutputStream out = new org.apache.yoko.orb.CORBA.OutputStream( buf, null, GIOP1_2); // // Put the exception into the output stream // Class exClass = ex.getClass(); String className = exClass.getName(); try { // // Get the appropriate helper class for the exception and // retrieve the write method from the helper // // get the appropriate class for the loading. ClassLoader loader = Thread.currentThread().getContextClassLoader(); Class c = ProviderLocator.loadClass(className + "Helper", this.getClass(), loader); Class[] paramTypes = new Class[2]; paramTypes[0] = ProviderLocator.loadClass("org.omg.CORBA.portable.OutputStream", this.getClass(), loader); paramTypes[1] = ProviderLocator.loadClass(className, this.getClass(), loader); java.lang.reflect.Method m = c.getMethod("write", paramTypes); // // Build up the parameter list // Object[] parameters = new Object[2]; parameters[0] = out; parameters[1] = ex; // // No object is needed as the first parameter because the // method is a static method // m.invoke(null, parameters); } catch (ClassNotFoundException e) { // // REVISIT: // This just means that we probably caught a non-CORBA // exception. For now, just return null. // return null; } catch (NoSuchMethodException e) { org.apache.yoko.orb.OB.Assert._OB_assert(e); } catch (IllegalAccessException e) { org.apache.yoko.orb.OB.Assert._OB_assert(e); } catch (IllegalArgumentException e) { org.apache.yoko.orb.OB.Assert._OB_assert(e); } catch (java.lang.reflect.InvocationTargetException e) { org.apache.yoko.orb.OB.Assert._OB_assert(e); } catch (SecurityException e) { // // REVISIT: // What to do in this case? // return null; } // // Now create the exception holder // org.apache.yoko.orb.OBMessaging.ExceptionHolder_impl exHolder = new org.apache.yoko.orb.OBMessaging.ExceptionHolder_impl( false, system_exception); out._OB_pos(0); exHolder._OB_extractSequence(out._OB_buffer()); return exHolder; } }
6,744
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/DataOutputStream.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class DataOutputStream implements org.omg.CORBA.DataOutputStream { private OutputStream out_; // ------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------ public DataOutputStream(OutputStream out) { out_ = out; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String[] _truncatable_ids() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void write_any(org.omg.CORBA.Any value) { out_.write_any(value); } public void write_boolean(boolean value) { out_.write_boolean(value); } public void write_char(char value) { out_.write_char(value); } public void write_wchar(char value) { out_.write_wchar(value); } public void write_octet(byte value) { out_.write_octet(value); } public void write_short(short value) { out_.write_short(value); } public void write_ushort(short value) { out_.write_ushort(value); } public void write_long(int value) { out_.write_long(value); } public void write_ulong(int value) { out_.write_ulong(value); } public void write_longlong(long value) { out_.write_longlong(value); } public void write_ulonglong(long value) { out_.write_ulonglong(value); } public void write_float(float value) { out_.write_float(value); } public void write_double(double value) { out_.write_double(value); } public void write_string(String value) { out_.write_string(value); } public void write_wstring(String value) { out_.write_wstring(value); } public void write_Object(org.omg.CORBA.Object value) { out_.write_Object(value); } public void write_Abstract(java.lang.Object value) { out_.write_abstract_interface(value); } public void write_Value(java.io.Serializable value) { out_.write_value(value); } public void write_TypeCode(org.omg.CORBA.TypeCode value) { out_.write_TypeCode(value); } public void write_any_array(org.omg.CORBA.Any[] seq, int offset, int length) { for (int i = offset; i < offset + length; i++) out_.write_any(seq[i]); } public void write_boolean_array(boolean[] seq, int offset, int length) { out_.write_boolean_array(seq, offset, length); } public void write_char_array(char[] seq, int offset, int length) { out_.write_char_array(seq, offset, length); } public void write_wchar_array(char[] seq, int offset, int length) { out_.write_wchar_array(seq, offset, length); } public void write_octet_array(byte[] seq, int offset, int length) { out_.write_octet_array(seq, offset, length); } public void write_short_array(short[] seq, int offset, int length) { out_.write_short_array(seq, offset, length); } public void write_ushort_array(short[] seq, int offset, int length) { out_.write_ushort_array(seq, offset, length); } public void write_long_array(int[] seq, int offset, int length) { out_.write_long_array(seq, offset, length); } public void write_ulong_array(int[] seq, int offset, int length) { out_.write_ulong_array(seq, offset, length); } public void write_ulonglong_array(long[] seq, int offset, int length) { out_.write_ulonglong_array(seq, offset, length); } public void write_longlong_array(long[] seq, int offset, int length) { out_.write_longlong_array(seq, offset, length); } public void write_float_array(float[] seq, int offset, int length) { out_.write_float_array(seq, offset, length); } public void write_double_array(double[] seq, int offset, int length) { out_.write_double_array(seq, offset, length); } }
6,745
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/NVList.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class NVList extends org.omg.CORBA.NVList { private org.omg.CORBA.ORB orb_; private java.util.Vector namedValueVec_ = new java.util.Vector(); // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public int count() { return namedValueVec_.size(); } public org.omg.CORBA.NamedValue add(int flags) { NamedValue n = new NamedValue("", orb_.create_any(), flags); namedValueVec_.addElement(n); return n; } public org.omg.CORBA.NamedValue add_item(String item_name, int flags) { NamedValue n = new NamedValue(item_name, orb_.create_any(), flags); namedValueVec_.addElement(n); return n; } public org.omg.CORBA.NamedValue add_value(String item_name, org.omg.CORBA.Any a, int flags) { NamedValue n = new NamedValue(item_name, a, flags); namedValueVec_.addElement(n); return n; } public org.omg.CORBA.NamedValue item(int index) throws org.omg.CORBA.Bounds { try { return (NamedValue) namedValueVec_.elementAt(index); } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.Bounds(); } } public void remove(int index) throws org.omg.CORBA.Bounds { try { namedValueVec_.removeElementAt(index); } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.Bounds(); } } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public NVList(org.omg.CORBA.ORB orb) { orb_ = orb; } public NVList(org.omg.CORBA.ORB orb, int n) { orb_ = orb; // // The parameter n is only a "hint" for how many elements the // user intends to create with operations such as // add_item(). Thus the following code is disabled: // // for(int i = 0 ; i < n ; i++) // { // NamedValue nv = new NamedValue("", orb_.create_any(), 0); // namedValueVec_.addElement(nv); // } } }
6,746
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/NamedValue.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class NamedValue extends org.omg.CORBA.NamedValue { private String name_; private org.omg.CORBA.Any value_; private int flags_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String name() { return name_; } public org.omg.CORBA.Any value() { return value_; } public int flags() { return flags_; } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public NamedValue(String name, org.omg.CORBA.Any any, int flags) { name_ = name; value_ = any; flags_ = flags; } }
6,747
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ExceptionList.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class ExceptionList extends org.omg.CORBA.ExceptionList { java.util.Vector typeCodeVec_ = new java.util.Vector(); // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public int count() { return typeCodeVec_.size(); } public void add(org.omg.CORBA.TypeCode exc) { typeCodeVec_.addElement(exc); } public org.omg.CORBA.TypeCode item(int index) throws org.omg.CORBA.Bounds { try { return (org.omg.CORBA.TypeCode) typeCodeVec_.elementAt(index); } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.Bounds(); } } public void remove(int index) throws org.omg.CORBA.Bounds { try { typeCodeVec_.removeElementAt(index); } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.Bounds(); } } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ExceptionList() { } }
6,748
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/Context.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; import org.apache.yoko.orb.OB.MinorCodes; import org.omg.CORBA.CompletionStatus; final public class Context extends org.omg.CORBA.Context { private org.omg.CORBA.ORB orb_; private String name_; private Context parent_; private java.util.Hashtable values_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String context_name() { return name_; } public org.omg.CORBA.Context parent() { return parent_; } public org.omg.CORBA.Context create_child(String child_ctx_name) { if (child_ctx_name == null) { throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidName), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidName, CompletionStatus.COMPLETED_NO); } Context ctx = new Context(orb_, child_ctx_name); ctx.parent_ = this; return ctx; } public void set_one_value(String propname, org.omg.CORBA.Any propvalue) { if (propname == null) { throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidName), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidName, CompletionStatus.COMPLETED_NO); } String s; try { s = propvalue.extract_string(); } catch (org.omg.CORBA.BAD_OPERATION ex) { throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPropertyType), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPropertyType, CompletionStatus.COMPLETED_NO); } // // Set value // values_.put(propname, s); } public void set_values(org.omg.CORBA.NVList values) { // // Create new, empty list // values_.clear(); // // Copy named values // for (int i = 0; i < values.count(); i++) { org.omg.CORBA.NamedValue nv = null; try { nv = values.item(i); } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } String s = null; try { s = nv.value().extract_string(); } catch (org.omg.CORBA.SystemException ex) { throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPropertyType), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPropertyType, CompletionStatus.COMPLETED_NO); } if (nv.flags() != 0) { throw new org.omg.CORBA.INV_FLAG("Unsupported named value flag"); } values_.put(nv.name(), s); } } public void delete_values(String pattern) { if (pattern == null) { throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPattern), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPattern, CompletionStatus.COMPLETED_NO); } // // Match the pattern // char last = 0; if (pattern.length() > 0) last = pattern.charAt(pattern.length() - 1); boolean found = false; java.util.Enumeration enumerator = values_.keys(); while (enumerator.hasMoreElements()) { String key = (String) enumerator.nextElement(); boolean match = false; if (last == '*') { // // Wildcard match? // if (key.startsWith(pattern.substring(0, pattern.length() - 1))) match = true; } else { // // Regular match? // if (key.equals(pattern)) match = true; } if (match) { values_.remove(key); found = true; } } if (!found) { throw new org.omg.CORBA.BAD_CONTEXT( org.apache.yoko.orb.OB.MinorCodes .describeBadContext(org.apache.yoko.orb.OB.MinorCodes.MinorNoPatternMatch), org.apache.yoko.orb.OB.MinorCodes.MinorNoPatternMatch, CompletionStatus.COMPLETED_NO); } } public org.omg.CORBA.NVList get_values(String start_scope, int op_flags, String pattern) { if (start_scope == null) { throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidScope), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidScope, CompletionStatus.COMPLETED_NO); } if (pattern == null) { throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPattern), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPattern, CompletionStatus.COMPLETED_NO); } java.util.Vector seq = new java.util.Vector(); _OB_getValues(start_scope, op_flags, pattern, seq); if (seq.isEmpty()) throw new org.omg.CORBA.BAD_CONTEXT( org.apache.yoko.orb.OB.MinorCodes .describeBadContext(org.apache.yoko.orb.OB.MinorCodes.MinorNoPatternMatch), org.apache.yoko.orb.OB.MinorCodes.MinorNoPatternMatch, CompletionStatus.COMPLETED_NO); NVList values = new NVList(orb_); for (int i = 0; i < seq.size(); i += 2) { org.omg.CORBA.Any any = orb_.create_any(); any.insert_string((String) seq.elementAt(i + 1)); values.add_value((String) seq.elementAt(i), any, 0); } return values; } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public Context(org.omg.CORBA.ORB orb, String name) { orb_ = orb; name_ = name; values_ = new java.util.Hashtable(); } public Context(org.omg.CORBA.ORB orb, String name, String[] strings) { orb_ = orb; name_ = name; values_ = new java.util.Hashtable(); for (int i = 0; i < strings.length; i += 2) values_.put(strings[i], strings[i + 1]); } void _OB_getValues(String start_scope, int op_flags, String pattern, java.util.Vector seq) { // // Don't do anything in this context if start_scope doesn't match name_ // if (start_scope.length() != 0 && !start_scope.equals(name_)) { if (parent_ == null) { throw new org.omg.CORBA.BAD_CONTEXT( org.apache.yoko.orb.OB.MinorCodes .describeBadContext(org.apache.yoko.orb.OB.MinorCodes.MinorNoPatternMatch), org.apache.yoko.orb.OB.MinorCodes.MinorNoPatternMatch, CompletionStatus.COMPLETED_NO); } parent_._OB_getValues(start_scope, op_flags, pattern, seq); return; } // // If there is a parent and scope is not restricted, get values // from parent. Otherwise create new value list. // if (op_flags != org.omg.CORBA.CTX_RESTRICT_SCOPE.value && parent_ != null) parent_._OB_getValues("", op_flags, pattern, seq); // // Match the pattern // char last = 0; if (pattern.length() > 0) last = pattern.charAt(pattern.length() - 1); java.util.Enumeration enumerator = values_.keys(); while (enumerator.hasMoreElements()) { String key = (String) enumerator.nextElement(); boolean match = false; if (last == '*') { // // Wildcard match? // if (key.startsWith(pattern.substring(0, pattern.length() - 1))) match = true; } else { // // Regular match? // if (key.equals(pattern)) match = true; } if (match) { String value = (String) values_.get(key); // // First try to replace value // int j; for (j = 0; j < seq.size(); j += 2) if (seq.elementAt(j).equals(key)) { seq.setElementAt(value, j + 1); break; } // // Value not found, add to list // if (j == seq.size()) { seq.addElement(key); seq.addElement(value); } } } } java.util.Hashtable _OB_getValues() { return values_; } }
6,749
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/TypeCode.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; // Note: TypeCodes are immutable, so I don't need thread // synchronization final public class TypeCode extends org.omg.CORBA.TypeCode { // // TypeCode kind // public org.omg.CORBA.TCKind kind_; // // tk_objref, tk_struct, tk_union, tk_enum, tk_alias, tk_value, // tk_value_box, tk_native, tk_abstract_interface, tk_except, // tk_local_interface // public String id_; public String name_; // // tk_struct, tk_union, tk_enum, tk_value, tk_except // public String[] memberNames_; // // tk_struct, tk_union, tk_value, tk_except // public TypeCode[] memberTypes_; // // tk_union // public Any[] labels_; // // tk_union // public TypeCode discriminatorType_; // // tk_string, tk_wstring, tk_sequence, tk_array // public int length_; // // tk_sequence, tk_array, tk_value_box, tk_alias // public TypeCode contentType_; // // tk_fixed // public short fixedDigits_; public short fixedScale_; // // tk_value // public short[] memberVisibility_; public short typeModifier_; public TypeCode concreteBaseType_; // // If recId_ is set, this is a placeholder recursive TypeCode that // was generated with create_recursive_tc(). If the placeholder // recursive TypeCode is already embedded, recType_ points to the // recursive TypeCode this placeholder delegates to. // public String recId_; TypeCode recType_; // ------------------------------------------------------------------ // Private member implementations // ------------------------------------------------------------------ private boolean equivalentRecHelper(org.omg.CORBA.TypeCode t, java.util.Vector history, java.util.Vector otherHistory) { if (t == null) return false; if (t == this) return true; // // Avoid infinite loops // boolean foundLoop = false, foundOtherLoop = false; for (int i = 0; i < history.size() && !foundLoop; i++) if (this == history.elementAt(i)) foundLoop = true; for (int i = 0; i < otherHistory.size() && !foundOtherLoop; i++) if (t == otherHistory.elementAt(i)) foundOtherLoop = true; if (foundLoop && foundOtherLoop) return true; history.addElement(this); otherHistory.addElement(t); boolean result = equivalentRec(t, history, otherHistory); history.setSize(history.size() - 1); otherHistory.setSize(otherHistory.size() - 1); return result; } private boolean equivalentRec(org.omg.CORBA.TypeCode t, java.util.Vector history, java.util.Vector otherHistory) { TypeCode tc = null; try { tc = (TypeCode) t; } catch (ClassCastException ex) { tc = _OB_convertForeignTypeCode(t); } if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.equivalentRecHelper(t, history, otherHistory); } if (tc.recId_ != null) { if (tc.recType_ == null) throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCodeParameter), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCodeParameter, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return equivalentRecHelper(tc.recType_, history, otherHistory); } TypeCode tc1 = _OB_getOrigType(); TypeCode tc2 = tc._OB_getOrigType(); if (tc1.kind_ != tc2.kind_) return false; if (tc1.kind_ == org.omg.CORBA.TCKind.tk_objref || tc1.kind_ == org.omg.CORBA.TCKind.tk_struct || tc1.kind_ == org.omg.CORBA.TCKind.tk_union || tc1.kind_ == org.omg.CORBA.TCKind.tk_enum || tc1.kind_ == org.omg.CORBA.TCKind.tk_alias || tc1.kind_ == org.omg.CORBA.TCKind.tk_value || tc1.kind_ == org.omg.CORBA.TCKind.tk_value_box || tc1.kind_ == org.omg.CORBA.TCKind.tk_native || tc1.kind_ == org.omg.CORBA.TCKind.tk_abstract_interface || tc1.kind_ == org.omg.CORBA.TCKind.tk_except || tc1.kind_ == org.omg.CORBA_2_4.TCKind.tk_local_interface) { if (!tc1.id_.equals("") && !tc2.id_.equals("")) { if (tc1.id_.equals(tc2.id_)) return true; else return false; } } // names_ and memberNames_ must be ignored if (tc1.kind_ == org.omg.CORBA.TCKind.tk_struct || tc1.kind_ == org.omg.CORBA.TCKind.tk_union || tc1.kind_ == org.omg.CORBA.TCKind.tk_value || tc1.kind_ == org.omg.CORBA.TCKind.tk_except) { if (tc1.memberTypes_.length != tc2.memberTypes_.length) return false; for (int i = 0; i < tc1.memberTypes_.length; i++) { if (!(tc1.memberTypes_[i].equivalentRecHelper( tc2.memberTypes_[i], history, otherHistory))) return false; } } if (tc1.kind_ == org.omg.CORBA.TCKind.tk_union) { if (tc1.labels_.length != tc2.labels_.length) return false; for (int i = 0; i < tc1.labels_.length; i++) { org.omg.CORBA.TypeCode ltc1 = tc1.labels_[i]._OB_type(); org.omg.CORBA.TypeCode ltc2 = tc2.labels_[i]._OB_type(); // // Don't use equivalentRecHelper here // if (!ltc1.equivalent(ltc2)) return false; java.lang.Object v1 = tc1.labels_[i].value(); java.lang.Object v2 = tc2.labels_[i].value(); ltc1 = _OB_getOrigType(ltc1); switch (ltc1.kind().value()) { case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_ushort: case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_enum: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_boolean: if (!v1.equals(v2)) return false; break; case org.omg.CORBA.TCKind._tk_octet: break; default: org.apache.yoko.orb.OB.Assert._OB_assert("unsupported type in tk_union"); break; } } // // Don't use equivalentRecHelper here // if (!tc1.discriminatorType_.equivalent(tc2.discriminatorType_)) return false; } if (tc1.kind_ == org.omg.CORBA.TCKind.tk_string || tc1.kind_ == org.omg.CORBA.TCKind.tk_wstring || tc1.kind_ == org.omg.CORBA.TCKind.tk_sequence || tc1.kind_ == org.omg.CORBA.TCKind.tk_array) { if (tc1.length_ != tc2.length_) return false; } if (tc1.kind_ == org.omg.CORBA.TCKind.tk_sequence || tc1.kind_ == org.omg.CORBA.TCKind.tk_array || tc1.kind_ == org.omg.CORBA.TCKind.tk_value_box || tc1.kind_ == org.omg.CORBA.TCKind.tk_alias) { if (!(tc1.contentType_.equivalentRecHelper(tc2.contentType_, history, otherHistory))) return false; } if (tc1.kind_ == org.omg.CORBA.TCKind.tk_fixed) { if (tc1.fixedDigits_ != tc2.fixedDigits_ || tc1.fixedScale_ != tc2.fixedScale_) return false; } if (tc1.kind_ == org.omg.CORBA.TCKind.tk_value) { if (tc1.memberVisibility_.length != tc2.memberVisibility_.length) return false; for (int i = 0; i < tc1.memberVisibility_.length; i++) if (tc1.memberVisibility_[i] != tc2.memberVisibility_[i]) return false; if (tc1.typeModifier_ != tc2.typeModifier_) return false; if (tc1.concreteBaseType_ != null || tc2.concreteBaseType_ != null) { if (!(tc1.concreteBaseType_ != null && tc2.concreteBaseType_ != null)) return false; // // Don't use equivalentRecHelper here // if (!(tc1.concreteBaseType_.equivalent(tc2.concreteBaseType_))) return false; } } return true; } private TypeCode getCompactTypeCodeRec(java.util.Vector history, java.util.Vector compacted) { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.getCompactTypeCodeRec(history, compacted); } // // Avoid infinite loops // for (int i = 0; i < history.size(); i++) if (this == history.elementAt(i)) return (TypeCode) compacted.elementAt(i); history.addElement(this); // // Create the new compacted type code (needed for recursive type // codes). // TypeCode result = new TypeCode(); compacted.addElement(result); String[] names = null; if (memberNames_ != null) { names = new String[memberNames_.length]; for (int i = 0; i < memberNames_.length; i++) names[i] = ""; } TypeCode[] types = null; if (memberTypes_ != null) { types = new TypeCode[memberTypes_.length]; for (int i = 0; i < memberTypes_.length; i++) types[i] = memberTypes_[i].getCompactTypeCodeRec(history, compacted); } // // Compact content type // TypeCode content = null; if (contentType_ != null) content = contentType_.getCompactTypeCodeRec(history, compacted); // // Compact discriminator type // TypeCode discriminator = null; if (discriminatorType_ != null) discriminator = discriminatorType_.getCompactTypeCodeRec(history, compacted); // // Compact concrete base type // TypeCode concrete = null; if (concreteBaseType_ != null) concrete = concreteBaseType_.getCompactTypeCodeRec(history, compacted); switch (kind_.value()) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ushort: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_float: case org.omg.CORBA.TCKind._tk_double: case org.omg.CORBA.TCKind._tk_longdouble: case org.omg.CORBA.TCKind._tk_boolean: case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_wchar: case org.omg.CORBA.TCKind._tk_octet: case org.omg.CORBA.TCKind._tk_any: case org.omg.CORBA.TCKind._tk_TypeCode: case org.omg.CORBA.TCKind._tk_Principal: result.kind_ = kind_; break; case org.omg.CORBA.TCKind._tk_fixed: result.kind_ = kind_; result.fixedDigits_ = fixedDigits_; result.fixedScale_ = fixedScale_; break; case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA.TCKind._tk_abstract_interface: case org.omg.CORBA.TCKind._tk_native: case org.omg.CORBA_2_4.TCKind._tk_local_interface: result.kind_ = kind_; result.id_ = id_; result.name_ = ""; break; case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: result.kind_ = kind_; result.id_ = id_; result.name_ = ""; result.memberNames_ = names; result.memberTypes_ = types; break; case org.omg.CORBA.TCKind._tk_union: result.kind_ = kind_; result.id_ = id_; result.name_ = ""; result.memberNames_ = names; result.memberTypes_ = types; result.labels_ = labels_; result.discriminatorType_ = discriminator; break; case org.omg.CORBA.TCKind._tk_enum: result.kind_ = kind_; result.id_ = id_; result.name_ = ""; result.memberNames_ = names; break; case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: result.kind_ = kind_; result.length_ = length_; break; case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: result.kind_ = kind_; result.length_ = length_; result.contentType_ = content; break; case org.omg.CORBA.TCKind._tk_alias: case org.omg.CORBA.TCKind._tk_value_box: result.kind_ = kind_; result.id_ = id_; result.name_ = ""; result.contentType_ = content; break; case org.omg.CORBA.TCKind._tk_value: result.kind_ = kind_; result.id_ = id_; result.name_ = ""; result.memberNames_ = names; result.memberTypes_ = types; result.memberVisibility_ = memberVisibility_; result.typeModifier_ = typeModifier_; result.concreteBaseType_ = concrete; break; default: org.apache.yoko.orb.OB.Assert._OB_assert("unsupported typecode"); } return result; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public boolean equal(org.omg.CORBA.TypeCode t) { if (t == null) return false; if (t == this) return true; if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.equal(t); } TypeCode tc = null; try { tc = (TypeCode) t; } catch (ClassCastException ex) { tc = _OB_convertForeignTypeCode(t); } if (tc.recId_ != null) { if (tc.recType_ == null) throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCodeParameter), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCodeParameter, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return equal(tc.recType_); } if (kind_ != tc.kind_) return false; if (kind_ == org.omg.CORBA.TCKind.tk_objref || kind_ == org.omg.CORBA.TCKind.tk_struct || kind_ == org.omg.CORBA.TCKind.tk_union || kind_ == org.omg.CORBA.TCKind.tk_enum || kind_ == org.omg.CORBA.TCKind.tk_alias || kind_ == org.omg.CORBA.TCKind.tk_value || kind_ == org.omg.CORBA.TCKind.tk_value_box || kind_ == org.omg.CORBA.TCKind.tk_native || kind_ == org.omg.CORBA.TCKind.tk_abstract_interface || kind_ == org.omg.CORBA.TCKind.tk_except || kind_ == org.omg.CORBA_2_4.TCKind.tk_local_interface) { if (!id_.equals("") || !tc.id_.equals("")) { if (id_.equals(tc.id_)) return true; else return false; } if (!name_.equals("") || !tc.name_.equals("")) { if (!name_.equals(tc.name_)) return false; } } if (kind_ == org.omg.CORBA.TCKind.tk_struct || kind_ == org.omg.CORBA.TCKind.tk_union || kind_ == org.omg.CORBA.TCKind.tk_enum || kind_ == org.omg.CORBA.TCKind.tk_value || kind_ == org.omg.CORBA.TCKind.tk_except) { if (memberNames_.length != tc.memberNames_.length) return false; for (int i = 0; i < memberNames_.length; i++) { if (!memberNames_[i].equals("") || !tc.memberNames_[i].equals("")) { if (!memberNames_[i].equals(tc.memberNames_[i])) return false; } } } if (kind_ == org.omg.CORBA.TCKind.tk_struct || kind_ == org.omg.CORBA.TCKind.tk_union || kind_ == org.omg.CORBA.TCKind.tk_value || kind_ == org.omg.CORBA.TCKind.tk_except) { if (memberTypes_.length != tc.memberTypes_.length) return false; for (int i = 0; i < memberTypes_.length; i++) if (!memberTypes_[i].equal(tc.memberTypes_[i])) return false; } if (kind_ == org.omg.CORBA.TCKind.tk_union) { if (labels_.length != tc.labels_.length) return false; for (int i = 0; i < labels_.length; i++) { if (!labels_[i].type().equal(tc.labels_[i].type())) return false; if (!labels_[i].equal(tc.labels_[i])) return false; } if (!discriminatorType_.equal(tc.discriminatorType_)) return false; } if (kind_ == org.omg.CORBA.TCKind.tk_string || kind_ == org.omg.CORBA.TCKind.tk_wstring || kind_ == org.omg.CORBA.TCKind.tk_sequence || kind_ == org.omg.CORBA.TCKind.tk_array) { if (length_ != tc.length_) return false; } if (kind_ == org.omg.CORBA.TCKind.tk_sequence || kind_ == org.omg.CORBA.TCKind.tk_array || kind_ == org.omg.CORBA.TCKind.tk_value_box || kind_ == org.omg.CORBA.TCKind.tk_alias) { if (!contentType_.equal(tc.contentType_)) return false; } if (kind_ == org.omg.CORBA.TCKind.tk_fixed) { if (fixedDigits_ != tc.fixedDigits_ || fixedScale_ != tc.fixedScale_) return false; } if (kind_ == org.omg.CORBA.TCKind.tk_value) { if (memberVisibility_.length != tc.memberVisibility_.length) return false; for (int i = 0; i < memberVisibility_.length; i++) if (memberVisibility_[i] != tc.memberVisibility_[i]) return false; if (typeModifier_ != tc.typeModifier_) return false; if (concreteBaseType_ != null || tc.concreteBaseType_ != null) { if (!(concreteBaseType_ != null && tc.concreteBaseType_ != null)) return false; if (!(concreteBaseType_.equal(tc.concreteBaseType_))) return false; } } return true; } public boolean equivalent(org.omg.CORBA.TypeCode t) { java.util.Vector history = new java.util.Vector(); java.util.Vector otherHistory = new java.util.Vector(); boolean result = equivalentRecHelper(t, history, otherHistory); org.apache.yoko.orb.OB.Assert._OB_assert(history.size() == 0); org.apache.yoko.orb.OB.Assert._OB_assert(otherHistory.size() == 0); return result; } public org.omg.CORBA.TypeCode get_compact_typecode() { java.util.Vector history = new java.util.Vector(); java.util.Vector compacted = new java.util.Vector(); return getCompactTypeCodeRec(history, compacted); } public org.omg.CORBA.TCKind kind() { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.kind(); } return kind_; } public String id() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.id(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_objref || kind_ == org.omg.CORBA.TCKind.tk_struct || kind_ == org.omg.CORBA.TCKind.tk_union || kind_ == org.omg.CORBA.TCKind.tk_enum || kind_ == org.omg.CORBA.TCKind.tk_alias || kind_ == org.omg.CORBA.TCKind.tk_value || kind_ == org.omg.CORBA.TCKind.tk_value_box || kind_ == org.omg.CORBA.TCKind.tk_native || kind_ == org.omg.CORBA.TCKind.tk_abstract_interface || kind_ == org.omg.CORBA.TCKind.tk_except || kind_ == org.omg.CORBA_2_4.TCKind.tk_local_interface)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return id_; } public String name() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.name(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_objref || kind_ == org.omg.CORBA.TCKind.tk_struct || kind_ == org.omg.CORBA.TCKind.tk_union || kind_ == org.omg.CORBA.TCKind.tk_enum || kind_ == org.omg.CORBA.TCKind.tk_alias || kind_ == org.omg.CORBA.TCKind.tk_value || kind_ == org.omg.CORBA.TCKind.tk_value_box || kind_ == org.omg.CORBA.TCKind.tk_native || kind_ == org.omg.CORBA.TCKind.tk_abstract_interface || kind_ == org.omg.CORBA.TCKind.tk_except || kind_ == org.omg.CORBA_2_4.TCKind.tk_local_interface)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return name_; } public int member_count() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.member_count(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_struct || kind_ == org.omg.CORBA.TCKind.tk_union || kind_ == org.omg.CORBA.TCKind.tk_enum || kind_ == org.omg.CORBA.TCKind.tk_value || kind_ == org.omg.CORBA.TCKind.tk_except)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return memberNames_.length; } public String member_name(int index) throws org.omg.CORBA.TypeCodePackage.BadKind, org.omg.CORBA.TypeCodePackage.Bounds { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.member_name(index); } if (!(kind_ == org.omg.CORBA.TCKind.tk_struct || kind_ == org.omg.CORBA.TCKind.tk_union || kind_ == org.omg.CORBA.TCKind.tk_enum || kind_ == org.omg.CORBA.TCKind.tk_value || kind_ == org.omg.CORBA.TCKind.tk_except)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); try { return memberNames_[index]; } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.TypeCodePackage.Bounds(); } } public org.omg.CORBA.TypeCode member_type(int index) throws org.omg.CORBA.TypeCodePackage.BadKind, org.omg.CORBA.TypeCodePackage.Bounds { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.member_type(index); } if (!(kind_ == org.omg.CORBA.TCKind.tk_struct || kind_ == org.omg.CORBA.TCKind.tk_union || kind_ == org.omg.CORBA.TCKind.tk_value || kind_ == org.omg.CORBA.TCKind.tk_except)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); try { return memberTypes_[index]; } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.TypeCodePackage.Bounds(); } } public org.omg.CORBA.Any member_label(int index) throws org.omg.CORBA.TypeCodePackage.BadKind, org.omg.CORBA.TypeCodePackage.Bounds { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.member_label(index); } if (!(kind_ == org.omg.CORBA.TCKind.tk_union)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); try { return labels_[index]; } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.TypeCodePackage.Bounds(); } } public org.omg.CORBA.TypeCode discriminator_type() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.discriminator_type(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_union)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return discriminatorType_; } public int default_index() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.default_index(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_union)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); for (int i = 0; i < labels_.length; i++) { org.omg.CORBA.TypeCode tc = labels_[i].type(); if (tc.kind() == org.omg.CORBA.TCKind.tk_octet) return i; } return -1; } public int length() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.length(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_string || kind_ == org.omg.CORBA.TCKind.tk_wstring || kind_ == org.omg.CORBA.TCKind.tk_sequence || kind_ == org.omg.CORBA.TCKind.tk_array)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return length_; } public org.omg.CORBA.TypeCode content_type() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.content_type(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_sequence || kind_ == org.omg.CORBA.TCKind.tk_array || kind_ == org.omg.CORBA.TCKind.tk_value_box || kind_ == org.omg.CORBA.TCKind.tk_alias)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return contentType_; } public short fixed_digits() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.fixed_digits(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_fixed)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return fixedDigits_; } public short fixed_scale() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.fixed_scale(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_fixed)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return fixedScale_; } public short member_visibility(int index) throws org.omg.CORBA.TypeCodePackage.BadKind, org.omg.CORBA.TypeCodePackage.Bounds { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.member_visibility(index); } if (!(kind_ == org.omg.CORBA.TCKind.tk_value)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); try { return memberVisibility_[index]; } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.TypeCodePackage.Bounds(); } } public short type_modifier() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.type_modifier(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_value)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return typeModifier_; } public org.omg.CORBA.TypeCode concrete_base_type() throws org.omg.CORBA.TypeCodePackage.BadKind { if (recId_ != null) { if (recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return recType_.concrete_base_type(); } if (!(kind_ == org.omg.CORBA.TCKind.tk_value)) throw new org.omg.CORBA.TypeCodePackage.BadKind(); return concreteBaseType_; } // ------------------------------------------------------------------ // Additional Yoko specific functions // ------------------------------------------------------------------ // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public TypeCode() { } public TypeCode _OB_getOrigType() { return (TypeCode) _OB_getOrigType(this); } static public org.omg.CORBA.TypeCode _OB_getOrigType( org.omg.CORBA.TypeCode tc) { try { while (tc.kind() == org.omg.CORBA.TCKind.tk_alias) tc = tc.content_type(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } return tc; } public boolean _OB_isSystemException() { if (kind_ != org.omg.CORBA.TCKind.tk_except) return false; return org.apache.yoko.orb.OB.Util.isSystemException(id_); } static private TypeCode _OB_convertForeignTypeCodeHelper( org.omg.CORBA.TypeCode tc, java.util.Hashtable history, java.util.Vector recHistory) { if (tc instanceof TypeCode) return (TypeCode) tc; TypeCode result = null; try { org.omg.CORBA.TCKind kind = tc.kind(); int kindValue = kind.value(); // // Check for recursion // if (kindValue == org.omg.CORBA.TCKind._tk_struct || kindValue == org.omg.CORBA.TCKind._tk_except || kindValue == org.omg.CORBA.TCKind._tk_union || kindValue == org.omg.CORBA.TCKind._tk_value) { for (int i = 0; i < recHistory.size(); i++) if (tc == recHistory.elementAt(i)) { result = new TypeCode(); result.recId_ = tc.id(); result.recType_ = (TypeCode) history.get(tc); org.apache.yoko.orb.OB.Assert ._OB_assert(result.recType_ != null); return result; } } // // Avoid creating the TypeCode again // result = (TypeCode) history.get(tc); if (result != null) return result; result = new TypeCode(); history.put(tc, result); switch (kindValue) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ushort: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_float: case org.omg.CORBA.TCKind._tk_double: case org.omg.CORBA.TCKind._tk_longdouble: case org.omg.CORBA.TCKind._tk_boolean: case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_wchar: case org.omg.CORBA.TCKind._tk_octet: case org.omg.CORBA.TCKind._tk_any: case org.omg.CORBA.TCKind._tk_TypeCode: case org.omg.CORBA.TCKind._tk_Principal: result.kind_ = kind; break; case org.omg.CORBA.TCKind._tk_fixed: result.kind_ = kind; result.fixedDigits_ = tc.fixed_digits(); result.fixedScale_ = tc.fixed_scale(); break; case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA.TCKind._tk_abstract_interface: case org.omg.CORBA.TCKind._tk_native: case org.omg.CORBA_2_4.TCKind._tk_local_interface: result.kind_ = kind; result.id_ = tc.id(); result.name_ = tc.name(); break; case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: { result.kind_ = kind; result.id_ = tc.id(); result.name_ = tc.name(); int count = tc.member_count(); result.memberNames_ = new String[count]; for (int i = 0; i < count; i++) result.memberNames_[i] = tc.member_name(i); recHistory.addElement(tc); result.memberTypes_ = new TypeCode[count]; for (int i = 0; i < count; i++) result.memberTypes_[i] = _OB_convertForeignTypeCodeHelper( tc.member_type(i), history, recHistory); recHistory.setSize(recHistory.size() - 1); break; } case org.omg.CORBA.TCKind._tk_union: { result.kind_ = kind; result.id_ = tc.id(); result.name_ = tc.name(); int count = tc.member_count(); result.memberNames_ = new String[count]; for (int i = 0; i < count; i++) result.memberNames_[i] = tc.member_name(i); recHistory.addElement(tc); result.memberTypes_ = new TypeCode[count]; for (int i = 0; i < count; i++) result.memberTypes_[i] = _OB_convertForeignTypeCodeHelper( tc.member_type(i), history, recHistory); recHistory.setSize(recHistory.size() - 1); result.labels_ = new Any[count]; for (int i = 0; i < count; i++) result.labels_[i] = new Any(tc.member_label(i)); // // Discriminator can't be recursive, so no history needed // result.discriminatorType_ = _OB_convertForeignTypeCodeHelper(tc .discriminator_type(), history, null); break; } case org.omg.CORBA.TCKind._tk_enum: { result.kind_ = kind; result.id_ = tc.id(); result.name_ = tc.name(); int count = tc.member_count(); result.memberNames_ = new String[count]; for (int i = 0; i < count; i++) result.memberNames_[i] = tc.member_name(i); break; } case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: result.kind_ = kind; result.length_ = tc.length(); break; case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: result.kind_ = kind; result.length_ = tc.length(); result.contentType_ = _OB_convertForeignTypeCodeHelper(tc .content_type(), history, recHistory); break; case org.omg.CORBA.TCKind._tk_alias: case org.omg.CORBA.TCKind._tk_value_box: result.kind_ = kind; result.id_ = tc.id(); result.name_ = tc.name(); result.contentType_ = _OB_convertForeignTypeCodeHelper(tc .content_type(), history, recHistory); break; case org.omg.CORBA.TCKind._tk_value: result.kind_ = kind; result.id_ = tc.id(); result.name_ = tc.name(); int count = tc.member_count(); result.memberNames_ = new String[count]; for (int i = 0; i < count; i++) result.memberNames_[i] = tc.member_name(i); recHistory.addElement(tc); result.memberTypes_ = new TypeCode[count]; for (int i = 0; i < count; i++) result.memberTypes_[i] = _OB_convertForeignTypeCodeHelper( tc.member_type(i), history, recHistory); recHistory.setSize(recHistory.size() - 1); result.memberVisibility_ = new short[count]; for (int i = 0; i < count; i++) result.memberVisibility_[i] = tc.member_visibility(i); result.typeModifier_ = tc.type_modifier(); result.concreteBaseType_ = _OB_convertForeignTypeCodeHelper(tc .concrete_base_type(), history, recHistory); break; default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported typecode"); } } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.TypeCodePackage.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } return result; } static public TypeCode _OB_convertForeignTypeCode(org.omg.CORBA.TypeCode tc) { org.apache.yoko.orb.OB.Assert._OB_assert(!(tc instanceof TypeCode)); java.util.Hashtable history = new java.util.Hashtable(7); java.util.Vector recHistory = new java.util.Vector(); return _OB_convertForeignTypeCodeHelper(tc, history, recHistory); } // ---------------------------------------------------------------------- // Embed recursive placeholder TypeCodes // ---------------------------------------------------------------------- static public void _OB_embedRecTC(TypeCode outer) { // // Recursive placeholder TypeCodes are illegal as "outer" argument // org.apache.yoko.orb.OB.Assert._OB_assert(outer.recId_ == null); // // Check for illegal recursion // if (!(outer.kind_ == org.omg.CORBA.TCKind.tk_struct || outer.kind_ == org.omg.CORBA.TCKind.tk_except || outer.kind_ == org.omg.CORBA.TCKind.tk_union || outer.kind_ == org.omg.CORBA.TCKind.tk_value)) { throw new org.omg.CORBA.BAD_TYPECODE("Illegal recursion"); } _OB_embedRecTC(outer, outer); } static public void _OB_embedRecTC(TypeCode outer, TypeCode inner) { // // Embed recursive placeholder TypeCodes // if (inner.recId_ != null) { if (inner.recId_.equals(outer.id_)) { if (inner.recType_ != null) { // Recursive TC already embedded - ensure it's the right one org.apache.yoko.orb.OB.Assert ._OB_assert(inner.recType_ == outer); } else { // // Embed the recursive placeholder TypeCode // inner.recType_ = outer; } } } else { // // Embed content type // if (inner.kind_ == org.omg.CORBA.TCKind.tk_sequence || inner.kind_ == org.omg.CORBA.TCKind.tk_value_box || inner.kind_ == org.omg.CORBA.TCKind.tk_array || inner.kind_ == org.omg.CORBA.TCKind.tk_alias) { org.apache.yoko.orb.OB.Assert ._OB_assert(inner.contentType_ != outer); _OB_embedRecTC(outer, inner.contentType_); } // // Embed member types // if (inner.kind_ == org.omg.CORBA.TCKind.tk_struct || inner.kind_ == org.omg.CORBA.TCKind.tk_union || inner.kind_ == org.omg.CORBA.TCKind.tk_value || inner.kind_ == org.omg.CORBA.TCKind.tk_except) { for (int i = 0; i < inner.memberTypes_.length; i++) { org.apache.yoko.orb.OB.Assert ._OB_assert(inner.memberTypes_[i] != outer); _OB_embedRecTC(outer, inner.memberTypes_[i]); } } // // Embed base valuetype // if (inner.kind_ == org.omg.CORBA.TCKind.tk_value && inner.concreteBaseType_ != null) _OB_embedRecTC(outer, inner.concreteBaseType_); } } }
6,750
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/DataInputStream.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class DataInputStream implements org.omg.CORBA.DataInputStream { private InputStream in_; // ------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------ public DataInputStream(InputStream in) { in_ = in; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String[] _truncatable_ids() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Any read_any() { return in_.read_any(); } public boolean read_boolean() { return in_.read_boolean(); } public char read_char() { return in_.read_char(); } public char read_wchar() { return in_.read_wchar(); } public byte read_octet() { return in_.read_octet(); } public short read_short() { return in_.read_short(); } public short read_ushort() { return in_.read_ushort(); } public int read_long() { return in_.read_long(); } public int read_ulong() { return in_.read_ulong(); } public long read_longlong() { return in_.read_longlong(); } public long read_ulonglong() { return in_.read_ulonglong(); } public float read_float() { return in_.read_float(); } public double read_double() { return in_.read_double(); } public String read_string() { return in_.read_string(); } public String read_wstring() { return in_.read_wstring(); } public org.omg.CORBA.Object read_Object() { return in_.read_Object(); } public java.lang.Object read_Abstract() { return in_.read_abstract_interface(); } public java.io.Serializable read_Value() { return in_.read_value(); } public org.omg.CORBA.TypeCode read_TypeCode() { return in_.read_TypeCode(); } public void read_any_array(org.omg.CORBA.AnySeqHolder seq, int offset, int length) { for (int i = offset; i < offset + length; i++) seq.value[i] = in_.read_any(); } public void read_boolean_array(org.omg.CORBA.BooleanSeqHolder seq, int offset, int length) { in_.read_boolean_array(seq.value, offset, length); } public void read_char_array(org.omg.CORBA.CharSeqHolder seq, int offset, int length) { in_.read_char_array(seq.value, offset, length); } public void read_wchar_array(org.omg.CORBA.WCharSeqHolder seq, int offset, int length) { in_.read_wchar_array(seq.value, offset, length); } public void read_octet_array(org.omg.CORBA.OctetSeqHolder seq, int offset, int length) { in_.read_octet_array(seq.value, offset, length); } public void read_short_array(org.omg.CORBA.ShortSeqHolder seq, int offset, int length) { in_.read_short_array(seq.value, offset, length); } public void read_ushort_array(org.omg.CORBA.UShortSeqHolder seq, int offset, int length) { in_.read_ushort_array(seq.value, offset, length); } public void read_long_array(org.omg.CORBA.LongSeqHolder seq, int offset, int length) { in_.read_long_array(seq.value, offset, length); } public void read_ulong_array(org.omg.CORBA.ULongSeqHolder seq, int offset, int length) { in_.read_ulong_array(seq.value, offset, length); } public void read_ulonglong_array(org.omg.CORBA.ULongLongSeqHolder seq, int offset, int length) { in_.read_ulonglong_array(seq.value, offset, length); } public void read_longlong_array(org.omg.CORBA.LongLongSeqHolder seq, int offset, int length) { in_.read_longlong_array(seq.value, offset, length); } public void read_float_array(org.omg.CORBA.FloatSeqHolder seq, int offset, int length) { in_.read_float_array(seq.value, offset, length); } public void read_double_array(org.omg.CORBA.DoubleSeqHolder seq, int offset, int length) { in_.read_double_array(seq.value, offset, length); } }
6,751
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/OutputStreamHolder.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class OutputStreamHolder { public OutputStream value; public OutputStreamHolder() { } public OutputStreamHolder(OutputStream initial) { value = initial; } }
6,752
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ORBPolicyManager_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class ORBPolicyManager_impl extends org.omg.CORBA.LocalObject implements org.omg.CORBA.PolicyManager { // // Vector is owned by OBORB_impl - do not use Policy[] // private java.util.Vector policies_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized org.omg.CORBA.Policy[] get_policy_overrides(int[] ts) { if (ts.length == 0) { org.omg.CORBA.Policy[] result = new org.omg.CORBA.Policy[policies_ .size()]; policies_.copyInto(result); return result; } java.util.Vector v = new java.util.Vector(); for (int i = 0; i < ts.length; ++i) { java.util.Enumeration e = policies_.elements(); while (e.hasMoreElements()) { org.omg.CORBA.Policy p = (org.omg.CORBA.Policy) e.nextElement(); if (p.policy_type() == ts[i]) v.add(p); } } org.omg.CORBA.Policy[] result = new org.omg.CORBA.Policy[v.size()]; v.copyInto(result); return result; } public synchronized void set_policy_overrides( org.omg.CORBA.Policy[] policies, org.omg.CORBA.SetOverrideType set_add) throws org.omg.CORBA.InvalidPolicies { for (int i = 0; i < policies.length; ++i) { for (int j = i + 1; j < policies.length; ++j) { if (policies[i].policy_type() == policies[j].policy_type()) throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes.MinorDuplicatePolicyType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } } if ((set_add == org.omg.CORBA.SetOverrideType.SET_OVERRIDE) || policies.length == 0) { java.util.Vector v = new java.util.Vector(); for (int i = 0; i < policies.length; ++i) { v.add(policies[i]); } policies_ = v; return; } java.util.Vector appendList = new java.util.Vector(); for (int i = 0; i < policies.length; ++i) { boolean override = false; java.util.Enumeration e = policies_.elements(); int j = 0; while (e.hasMoreElements() && !override) { org.omg.CORBA.Policy p = (org.omg.CORBA.Policy) e.nextElement(); if (p.policy_type() == policies[i].policy_type()) { override = true; policies_.setElementAt(policies[i], j); break; } ++j; } if (!override) { appendList.add(policies[i]); } } policies_.addAll(appendList); } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ORBPolicyManager_impl(java.util.Vector policies) { policies_ = policies; } }
6,753
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/InputStream.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.rmi.Remote; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.logging.Level; import java.util.logging.Logger; import javax.rmi.CORBA.Util; import org.apache.yoko.orb.OB.Assert; import org.apache.yoko.orb.OB.MinorCodes; import org.apache.yoko.orb.OB.OB_Extras; import org.apache.yoko.orb.OCI.GiopVersion; import org.omg.CORBA.CompletionStatus; import org.omg.CORBA.MARSHAL; import org.omg.CORBA.portable.IDLEntity; import org.omg.CORBA.portable.ObjectImpl; import org.omg.CORBA.portable.ValueInputStream; import org.omg.SendingContext.CodeBase; final public class InputStream extends org.omg.CORBA_2_3.portable.InputStream implements ValueInputStream { static final Logger logger = Logger.getLogger(InputStream.class.getName()); org.apache.yoko.orb.OB.ORBInstance orbInstance_; public org.apache.yoko.orb.OCI.Buffer buf_; boolean swap_; private GiopVersion giopVersion_ = org.apache.yoko.orb.OB.OB_Extras.DEFAULT_GIOP_VERSION; private int origPos_; private boolean origSwap_; // // Handles all OBV marshaling // private org.apache.yoko.orb.OB.ValueReader valueReader_; private org.apache.yoko.orb.OB.TypeCodeCache cache_; // // Character conversion properties // private org.apache.yoko.orb.OB.CodeConverters codeConverters_; private boolean charReaderRequired_; private boolean charConversionRequired_; private boolean wCharReaderRequired_; private boolean wCharConversionRequired_; private CodeBase sendingContextRuntime_; private String codebase_; // ------------------------------------------------------------------ // Private and protected members // ------------------------------------------------------------------ private TypeCode checkCache(String id, int startPos, int length) { TypeCode tc = null; if (id.length() > 0) { tc = cache_.get(id); if (tc != null) { _OB_skip(length + startPos - buf_.pos_); } } return tc; } private org.omg.CORBA.TypeCode readTypeCodeImpl(java.util.Hashtable history, boolean isTopLevel) { int kind = read_ulong(); int oldPos = buf_.pos_ - 4; if (logger.isLoggable(Level.FINEST)) logger.finest(String.format("Reading a TypeCode of kind %d from position 0x%x", kind, oldPos)); TypeCode tc = null; if (kind == -1) { int offs = read_long(); int indirectionPos = buf_.pos_ - 4 + offs; indirectionPos += (indirectionPos & 0x3); // adjust for alignment TypeCode p = (TypeCode) history.get(new Integer(indirectionPos)); if (p == null) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadInvTypeCodeIndirection), org.apache.yoko.orb.OB.MinorCodes.MinorReadInvTypeCodeIndirection, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } history.put(new Integer(oldPos), p); tc = p; } else { switch (kind) { case org.omg.CORBA.TCKind._tk_null : case org.omg.CORBA.TCKind._tk_void : case org.omg.CORBA.TCKind._tk_short : case org.omg.CORBA.TCKind._tk_long : case org.omg.CORBA.TCKind._tk_ushort : case org.omg.CORBA.TCKind._tk_ulong : case org.omg.CORBA.TCKind._tk_float : case org.omg.CORBA.TCKind._tk_double : case org.omg.CORBA.TCKind._tk_boolean : case org.omg.CORBA.TCKind._tk_char : case org.omg.CORBA.TCKind._tk_octet : case org.omg.CORBA.TCKind._tk_any : case org.omg.CORBA.TCKind._tk_TypeCode : case org.omg.CORBA.TCKind._tk_Principal : case org.omg.CORBA.TCKind._tk_longlong : case org.omg.CORBA.TCKind._tk_ulonglong : case org.omg.CORBA.TCKind._tk_longdouble : case org.omg.CORBA.TCKind._tk_wchar : tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createPrimitiveTC(org.omg.CORBA_2_4.TCKind.from_int(kind)); history.put(new Integer(oldPos), tc); break; case org.omg.CORBA.TCKind._tk_fixed : { short digits = read_ushort(); short scale = read_short(); tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createFixedTC(digits, scale); history.put(new Integer(oldPos), tc); break; } case org.omg.CORBA.TCKind._tk_objref : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createInterfaceTC(id, read_string()); if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } history.put(new Integer(oldPos), tc); swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_struct : case org.omg.CORBA.TCKind._tk_except : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { // // For potentially recursive types, we must // construct the TypeCode manually in order to // add it to the history // TypeCode p = new TypeCode(); history.put(new Integer(oldPos), p); p.kind_ = org.omg.CORBA_2_4.TCKind.from_int(kind); p.id_ = id; p.name_ = read_string(); int num = read_ulong(); p.memberNames_ = new String[num]; p.memberTypes_ = new TypeCode[num]; for (int i = 0; i < num; i++) { p.memberNames_[i] = read_string(); p.memberTypes_[i] = (TypeCode) readTypeCodeImpl(history, false); } tc = p; if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_union : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { // // For potentially recursive types, we must construct // the TypeCode manually in order to add it to the // history // TypeCode p = new TypeCode(); history.put(new Integer(oldPos), p); p.kind_ = org.omg.CORBA.TCKind.tk_union; p.id_ = id; p.name_ = read_string(); p.discriminatorType_ = (TypeCode) readTypeCodeImpl(history, false); int defaultIndex = read_long(); int num = read_ulong(); p.labels_ = new Any[num]; p.memberNames_ = new String[num]; p.memberTypes_ = new TypeCode[num]; // // Check the discriminator type // TypeCode origTC = p.discriminatorType_._OB_getOrigType(); switch (origTC.kind().value()) { case org.omg.CORBA.TCKind._tk_short : case org.omg.CORBA.TCKind._tk_ushort : case org.omg.CORBA.TCKind._tk_long : case org.omg.CORBA.TCKind._tk_ulong : case org.omg.CORBA.TCKind._tk_longlong : case org.omg.CORBA.TCKind._tk_ulonglong : case org.omg.CORBA.TCKind._tk_boolean : case org.omg.CORBA.TCKind._tk_char : case org.omg.CORBA.TCKind._tk_enum : break; default : // // Invalid discriminator type // throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidUnionDiscriminator), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidUnionDiscriminator, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } for (int i = 0; i < num; i++) { p.labels_[i] = new Any(); if (i == defaultIndex) { // // Unmarshal a dummy value of the // appropriate size for the // discriminator type // Any dummy = new Any(); dummy.read_value(this, p.discriminatorType_); // // Default label value is the zero octet // p.labels_[i].insert_octet((byte) 0); } else { p.labels_[i].read_value(this, p.discriminatorType_); } p.memberNames_[i] = read_string(); p.memberTypes_[i] = (TypeCode) readTypeCodeImpl(history, false); } tc = p; if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_enum : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { String name = read_string(); int num = read_ulong(); String[] members = new String[num]; for (int i = 0; i < num; i++) members[i] = read_string(); tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createEnumTC(id, name, members); history.put(new Integer(oldPos), tc); if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_string : { tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createStringTC(read_ulong()); history.put(new Integer(oldPos), tc); break; } case org.omg.CORBA.TCKind._tk_wstring : { tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createWStringTC(read_ulong()); history.put(new Integer(oldPos), tc); break; } case org.omg.CORBA.TCKind._tk_sequence : case org.omg.CORBA.TCKind._tk_array : { read_ulong(); // encapsulation length boolean swap = swap_; _OB_readEndian(); // // For potentially recursive types, we must construct // the TypeCode manually in order to add it to the // history // TypeCode p = new TypeCode(); history.put(new Integer(oldPos), p); p.kind_ = org.omg.CORBA_2_4.TCKind.from_int(kind); p.contentType_ = (TypeCode) readTypeCodeImpl(history, false); p.length_ = read_ulong(); tc = p; swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_alias : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createAliasTC(id, read_string(), readTypeCodeImpl(history, false)); history.put(new Integer(oldPos), tc); if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_value : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { // // For potentially recursive types, we must // construct the TypeCode manually in order to // add it to the history // TypeCode p = new TypeCode(); history.put(new Integer(oldPos), p); p.kind_ = org.omg.CORBA_2_4.TCKind.from_int(kind); p.id_ = id; p.name_ = read_string(); p.typeModifier_ = read_short(); p.concreteBaseType_ = (TypeCode) readTypeCodeImpl(history, false); if (p.concreteBaseType_.kind().value() == org.omg.CORBA.TCKind._tk_null) p.concreteBaseType_ = null; int num = read_ulong(); p.memberNames_ = new String[num]; p.memberTypes_ = new TypeCode[num]; p.memberVisibility_ = new short[num]; for (int i = 0; i < num; i++) { p.memberNames_[i] = read_string(); p.memberTypes_[i] = (TypeCode) readTypeCodeImpl(history, false); p.memberVisibility_[i] = read_short(); } tc = p; if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_value_box : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createValueBoxTC(id, read_string(), readTypeCodeImpl(history, false)); history.put(new Integer(oldPos), tc); if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_abstract_interface : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (logger.isLoggable(Level.FINE)) logger.fine(String.format("Abstract interface typecode encapsulaton length=0x%x id=%s", length, id)); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createAbstractInterfaceTC(id, read_string()); history.put(new Integer(oldPos), tc); if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } swap_ = swap; break; } case org.omg.CORBA.TCKind._tk_native : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createNativeTC(id, read_string()); if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } history.put(new Integer(oldPos), tc); swap_ = swap; break; } case org.omg.CORBA_2_4.TCKind._tk_local_interface : { int length = read_ulong(); // encapsulation length // save this position after the read, since we might be on a chunk boundary. // however, we do an explicit check for the chunk boundary before doing the // read. checkChunk(); int typePos = buf_.pos_; boolean swap = swap_; _OB_readEndian(); String id = read_string(); if (isTopLevel && cache_ != null) tc = checkCache(id, typePos, length); // may advance pos if (tc == null) { tc = (TypeCode) org.apache.yoko.orb.OB.TypeCodeFactory.createLocalInterfaceTC(id, read_string()); history.put(new Integer(oldPos), tc); if (id.length() > 0 && cache_ != null) cache_.put(id, tc); } swap_ = swap; break; } default : throw new org.omg.CORBA.BAD_TYPECODE("Unknown TypeCode kind: " + kind); } } return tc; } private org.apache.yoko.orb.OB.ValueReader valueReader() { if (valueReader_ == null) valueReader_ = new org.apache.yoko.orb.OB.ValueReader(this); return valueReader_; } // // reads wide-characters using the old non-compliant method // private char _OB_read_wchar_old() { checkChunk(); if (wCharConversionRequired_) { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.inputWcharConverter; char value; // // For GIOP 1.1 non byte-oriented wide characters are written // as ushort or ulong, depending on their maximum length // listed in the code set registry. // switch (giopVersion_) { case GIOP1_1: { if (converter.getFrom().max_bytes <= 2) value = (char) read_ushort(); else value = (char) read_ulong(); break; } default : { final int wcharLen = buf_.data_[buf_.pos_++] & 0xff; if (buf_.pos_ + wcharLen > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); value = converter.read_wchar(this, wcharLen); break; } } return converter.convert(value); } // // UTF-16 // else { switch (giopVersion_) { // // Orbix2000/ORBacus/E compatible GIOP 1.0 marshaling // case GIOP1_0: { buf_.pos_ += (buf_.pos_ & 0x1); if (buf_.pos_ + 2 > buf_.len_) throw new org.omg.CORBA.MARSHAL(org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // Assume big endian // return (char) ((buf_.data_[buf_.pos_++] << 8) | (buf_.data_[buf_.pos_++] & 0xff)); } case GIOP1_1: { return (char) read_ushort(); } default : { final int wcharLen = buf_.data_[buf_.pos_++] & 0xff; if (buf_.pos_ + wcharLen > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return (char) ((buf_.data_[buf_.pos_++] << 8) | (buf_.data_[buf_.pos_++] & 0xff)); } } } } // // reads wide-characters using compliant method // private char _OB_read_wchar_new(boolean partOfString) { checkChunk(); char value; final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.inputWcharConverter; if (wCharReaderRequired_) { if (partOfString == false) converter.set_reader_flags(org.apache.yoko.orb.OB.CodeSetReader.FIRST_CHAR); int wcLen = 2; switch (giopVersion_) { case GIOP1_0: // // we should not require a reader for GIOP 1.0 // wchars since this would mean we are using UTF-16. // This is not available in Orbix/E compatibility, // only UCS-2... // org.apache.yoko.orb.OB.Assert._OB_assert(false); break; case GIOP1_1: // // align on two-byte boundary // buf_.pos_ += (buf_.pos_ & 1); break; default : // // get the octet indicating the wchar len // wcLen = buf_.data_[buf_.pos_++] & 0xff; break; } // // check for an overflow condition // if (buf_.pos_ + wcLen > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // read in the value with the reader // value = converter.read_wchar(this, wcLen); } else { // // no reader is required then // switch (giopVersion_) { case GIOP1_0: // // UCS-2 is the native wchar codeset for both Orbacus // and Orbix/E so conversion should not be necessary // org.apache.yoko.orb.OB.Assert._OB_assert(!wCharConversionRequired_); // // align to 2-byte boundary // buf_.pos_ += (buf_.pos_ & 1); // // check for overflow on reader // if (buf_.pos_ + 2 > buf_.len_) throw new org.omg.CORBA.MARSHAL(org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // assume big-endian (both Orbacus and Orbix/E do here) // and read in the wchar // return (char) ((buf_.data_[buf_.pos_++] << 8) | (buf_.data_[buf_.pos_++] & 0xff)); case GIOP1_1: // // read according to the endian of the message // if (converter.getFrom().max_bytes <= 2) value = (char) read_ushort(); else value = (char) read_ulong(); break; default : { // // read the length octet off the front // final int wcLen = buf_.data_[buf_.pos_++] & 0xff; // // check for an overflow // if (buf_.pos_ + wcLen > buf_.len_) throw new org.omg.CORBA.MARSHAL(org.apache.yoko.orb.OB.MinorCodes.MinorReadWCharOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // read the character off in proper endian format // if (swap_) { // // the message was in little endian format // value = (char) ((buf_.data_[buf_.pos_++] & 0xff) | (buf_.data_[buf_.pos_++] << 8)); } else { // // the message was in big endian format // value = (char) ((buf_.data_[buf_.pos_++] << 8) | (buf_.data_[buf_.pos_++] & 0xff)); } break; } } } // // perform conversion is necessary // if (wCharConversionRequired_) value = converter.convert(value); return value; } // // reads wide strings using the old improper way // private String _OB_read_wstring_old() { String s = ""; checkChunk(); int len = read_ulong(); // // 15.3.2.7: For GIOP version 1.1, a wide string is encoded as an // unsigned long indicating the length of the string in octets or // unsigned integers (determined by the transfer syntax for wchar) // followed by the individual wide characters. Both the string length // and contents include a terminating null. The terminating null // character for a wstring is also a wide character. // // For GIOP 1.1 the length must not be 0. // switch (giopVersion_) { case GIOP1_0: case GIOP1_1: { if (len == 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringZeroLength), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringZeroLength, org.omg.CORBA.CompletionStatus.COMPLETED_NO); char[] tmp = new char[len]; read_wchar_array(tmp, 0, len); // // Check for terminating null wchar // if (tmp[len - 1] != 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNoTerminator), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNoTerminator, org.omg.CORBA.CompletionStatus.COMPLETED_NO); s = new String(tmp, 0, len - 1); break; } default : { StringBuffer stringBuffer = new StringBuffer(len); if (wCharConversionRequired_) { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.inputWcharConverter; while (len > 0) { final int wcharLen = converter.read_count_wchar((char) buf_.data_[buf_.pos_]); len -= wcharLen; if (buf_.pos_ + wcharLen > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); char c = converter.read_wchar(this, wcharLen); c = converter.convert(c); // // String must not contain null characters // if (c == 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNullWChar), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNullWChar, org.omg.CORBA.CompletionStatus.COMPLETED_NO); stringBuffer.append(c); } } // // UTF-16 // else { while (len > 0) { final int wcharLen = 2; len -= wcharLen; if (buf_.pos_ + wcharLen > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); char c = (char) ((buf_.data_[buf_.pos_++] << 8) | (buf_.data_[buf_.pos_++] & 0xff)); // // String must not contain null characters // if (c == 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNullWChar), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNullWChar, org.omg.CORBA.CompletionStatus.COMPLETED_NO); stringBuffer.append(c); } } s = stringBuffer.toString(); break; } } return s; } // // reads wide strings using the new compliant method // private String _OB_read_wstring_new() { String s = ""; checkChunk(); final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.inputWcharConverter; // // read the length of the string (specified in characters for // GIOP 1.0/1.1 and in octets for GIOP 1.2+) // int len = read_ulong(); if (logger.isLoggable(Level.FINE)) logger.fine(String.format("Reading wstring of length 0x%x", len)); switch (giopVersion_) { case GIOP1_0: case GIOP1_1: { // // it is not legal in GIOP 1.0/1.1 for a string to be 0 in // length... it MUST have a null terminator // if (len == 0) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringZeroLength), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringZeroLength, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } char[] tmp = new char[len]; if (wCharReaderRequired_) { converter.set_reader_flags(org.apache.yoko.orb.OB.CodeSetReader.FIRST_CHAR); } for (int i = 0; i < len; i++) { tmp[i] = read_wchar(true); } // // Check for terminating null wchar // if (tmp[len - 1] != 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNoTerminator), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNoTerminator, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // create the final string // s = new String(tmp, 0, len - 1); break; } default : { StringBuffer stringBuffer = new StringBuffer(len); if (wCharReaderRequired_) { converter.set_reader_flags(org.apache.yoko.orb.OB.CodeSetReader.FIRST_CHAR); // // start adding the characters to the string buffer // while (len > 0) { if (buf_.pos_ + 2 > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); int checkChar = (buf_.data_[buf_.pos_] << 8) | (buf_.data_[buf_.pos_ + 1] & 0xff); int wcLen = converter.read_count_wchar((char) checkChar); len -= wcLen; // // check for an overflow in the read // if (buf_.pos_ + wcLen > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // read the character and convert if necessary // char c = converter.read_wchar(this, wcLen); if (wCharConversionRequired_) c = converter.convert(c); // // check for invalid null character // if (c == 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNullWChar), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNullWChar, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // append to the string buffer // stringBuffer.append(c); } } else { final int wcLen = 2; while (len > 0) { len -= wcLen; // // check for an overflow condition // if (buf_.pos_ + wcLen > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // read in the char using the message endian // format for GIOP 1.2/1.3 // REVISIT: GIOP 1.4 changes these rules // char c; if (swap_) c = (char) ((buf_.data_[buf_.pos_++] & 0xff) | (buf_.data_[buf_.pos_++] << 8)); else c = (char) ((buf_.data_[buf_.pos_++] << 8) | (buf_.data_[buf_.pos_++] & 0xff)); if (wCharConversionRequired_) c = converter.convert(c); // // check for invalid null character // if (c == 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNullWChar), org.apache.yoko.orb.OB.MinorCodes.MinorReadWStringNullWChar, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // append to the string buffer // stringBuffer.append(c); } } s = stringBuffer.toString(); break; } } return s; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public int available() throws java.io.IOException { org.apache.yoko.orb.OB.Assert._OB_assert(buf_.len_ >= buf_.pos_); return buf_.len_ - buf_.pos_; } public int read() throws java.io.IOException { checkChunk(); if (buf_.pos_ + 1 > buf_.len_) return -1; return (0xff & buf_.data_[buf_.pos_++]); } public org.omg.CORBA.ORB orb() { if (orbInstance_ != null) return orbInstance_.getORB(); return null; } public boolean read_boolean() { checkChunk(); if (buf_.pos_ + 1 > buf_.len_) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadBooleanOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadBooleanOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } if (logger.isLoggable(Level.FINEST)) logger.finest(String.format("Boolean value is %b from position 0x%x", buf_.data_[buf_.pos_], buf_.pos_)); return buf_.data_[buf_.pos_++] != (byte) 0; } public char read_char() { checkChunk(); if (buf_.pos_ + 1 > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadCharOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadCharOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (charReaderRequired_ || charConversionRequired_) { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.inputCharConverter; if (charReaderRequired_ && charConversionRequired_) return converter.convert(converter.read_char(this)); else if (charReaderRequired_) return converter.read_char(this); else return converter.convert((char) (buf_.data_[buf_.pos_++] & 0xff)); } else { // // Note: byte must be masked with 0xff to correct negative values // return (char) (buf_.data_[buf_.pos_++] & 0xff); } } public char read_wchar() { return read_wchar(false); } public char read_wchar(boolean partOfString) { if (org.apache.yoko.orb.OB.OB_Extras.COMPAT_WIDE_MARSHAL == false) return _OB_read_wchar_new(partOfString); return _OB_read_wchar_old(); } public byte read_octet() { checkChunk(); if (buf_.pos_ + 1 > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadOctetOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadOctetOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return buf_.data_[buf_.pos_++]; } public short read_short() { checkChunk(); buf_.pos_ += (buf_.pos_ & 0x1); if (buf_.pos_ + 2 > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadShortOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadShortOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (swap_) return (short) ((buf_.data_[buf_.pos_++] & 0xff) | (buf_.data_[buf_.pos_++] << 8)); else return (short) ((buf_.data_[buf_.pos_++] << 8) | (buf_.data_[buf_.pos_++] & 0xff)); } public short read_ushort() { return read_short(); } public int read_long() { checkChunk(); return _OB_readLongUnchecked(); } public int read_ulong() { return read_long(); } public long read_longlong() { checkChunk(); final int pmod8 = buf_.pos_ & 0x7; if (pmod8 != 0) buf_.pos_ += 8 - pmod8; if (buf_.pos_ + 8 > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadLongLongOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadLongLongOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (swap_) return ((long) buf_.data_[buf_.pos_++] & 0xffL) | (((long) buf_.data_[buf_.pos_++] << 8) & 0xff00L) | (((long) buf_.data_[buf_.pos_++] << 16) & 0xff0000L) | (((long) buf_.data_[buf_.pos_++] << 24) & 0xff000000L) | (((long) buf_.data_[buf_.pos_++] << 32) & 0xff00000000L) | (((long) buf_.data_[buf_.pos_++] << 40) & 0xff0000000000L) | (((long) buf_.data_[buf_.pos_++] << 48) & 0xff000000000000L) | ((long) buf_.data_[buf_.pos_++] << 56); else return ((long) buf_.data_[buf_.pos_++] << 56) | (((long) buf_.data_[buf_.pos_++] << 48) & 0xff000000000000L) | (((long) buf_.data_[buf_.pos_++] << 40) & 0xff0000000000L) | (((long) buf_.data_[buf_.pos_++] << 32) & 0xff00000000L) | (((long) buf_.data_[buf_.pos_++] << 24) & 0xff000000L) | (((long) buf_.data_[buf_.pos_++] << 16) & 0xff0000L) | (((long) buf_.data_[buf_.pos_++] << 8) & 0xff00L) | ((long) buf_.data_[buf_.pos_++] & 0xffL); } public long read_ulonglong() { return read_longlong(); } public float read_float() { return Float.intBitsToFloat(read_long()); } public double read_double() { return Double.longBitsToDouble(read_longlong()); } public String read_string() { checkChunk(); // // Number of octets (i.e. bytes) in the string (including // the null terminator). This may not be the same as the // number of characters if encoding was done. // int length = read_ulong(); if (length == 0) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadStringZeroLength), org.apache.yoko.orb.OB.MinorCodes.MinorReadStringZeroLength, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } int newPos = buf_.pos_ + length; if (newPos < buf_.pos_ || newPos > buf_.len_) { if (logger.isLoggable(Level.FINE)) logger.fine(String.format("String length=0x%x newPos=0x%x buf_.pos=0x%x buf_.len=0x%x", length, newPos, buf_.pos_, buf_.len_)); throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadStringOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadStringOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } length--; char[] arr = new char[length]; // // Character Count // int maxChars = length; int numChars = 0; if (!(charReaderRequired_ || charConversionRequired_)) { for (int i = 0; i < length; i++) { // // Note: byte must be masked with 0xff to correct negative // values // arr[i] = (char) (buf_.data_[buf_.pos_++] & 0xff); // // String must not contain null characters // if (arr[i] == 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadStringNullChar), org.apache.yoko.orb.OB.MinorCodes.MinorReadStringNullChar, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } } else { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.inputCharConverter; int bufPos0 = buf_.pos_; int i = 0; while (buf_.pos_ - bufPos0 < length) { char value; if (charReaderRequired_) value = converter.read_char(this); else // // Note: byte must be masked with 0xff to correct negative // values // value = (char) (buf_.data_[buf_.pos_++] & 0xff); // // String must not contain null characters // if (value == 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadStringNullChar), org.apache.yoko.orb.OB.MinorCodes.MinorReadStringNullChar, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (charConversionRequired_) arr[i] = converter.convert(value); else arr[i] = value; i++; } numChars = i; } buf_.pos_ = newPos; if (buf_.data_[buf_.pos_ - 1] != 0) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadStringNoTerminator), org.apache.yoko.orb.OB.MinorCodes.MinorReadStringNoTerminator, org.omg.CORBA.CompletionStatus.COMPLETED_NO); int numExtraBytes = 0; if (numChars != 0 && numChars != maxChars) { // // Multiple bytes were required to represent at least one of // the characters present. // numExtraBytes = maxChars - numChars; } if (numExtraBytes > 0) { // // Need to ignore the last 'n' chars in 'arr', where // n = numExtraChars // String arrStr = new String(arr); return arrStr.substring(0, numChars); } else return new String(arr); } public String read_wstring() { if (org.apache.yoko.orb.OB.OB_Extras.COMPAT_WIDE_MARSHAL == false) return _OB_read_wstring_new(); return _OB_read_wstring_old(); } public void read_boolean_array(boolean[] value, int offset, int length) { if (length > 0) { checkChunk(); if (buf_.pos_ + length < buf_.pos_ || buf_.pos_ + length > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadBooleanArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadBooleanArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); for (int i = offset; i < offset + length; i++) value[i] = buf_.data_[buf_.pos_++] != (byte) 0; } } public void read_char_array(char[] value, int offset, int length) { if (length > 0) { checkChunk(); if (buf_.pos_ + length < buf_.pos_ || buf_.pos_ + length > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadCharArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadCharArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (!(charReaderRequired_ || charConversionRequired_)) { for (int i = offset; i < offset + length; i++) { // // Note: byte must be masked with 0xff to correct negative // values // value[i] = (char) (buf_.data_[buf_.pos_++] & 0xff); } } else { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.inputCharConverter; // // Intermediate variable used for efficiency // boolean bothRequired = charReaderRequired_ && charConversionRequired_; for (int i = offset; i < offset + length; i++) { if (bothRequired) value[i] = converter.convert(converter.read_char(this)); else if (charReaderRequired_) value[i] = converter.read_char(this); else { // // Note: byte must be masked with 0xff // to correct negative values // final char c = (char) (buf_.data_[buf_.pos_++] & 0xff); value[i] = converter.convert(c); } } } } } public void read_wchar_array(char[] value, int offset, int length) { if (length > 0) { if (buf_.pos_ + length < buf_.pos_ || buf_.pos_ + length > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadCharArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadCharArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); for (int i = offset; i < offset + length; i++) value[i] = read_wchar(false); } } public void read_octet_array(byte[] value, int offset, int length) { if (length > 0) { checkChunk(); int newPos = buf_.pos_ + length; if (newPos < buf_.pos_ || newPos > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadOctetArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadOctetArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); System.arraycopy(buf_.data_, buf_.pos_, value, offset, length); buf_.pos_ = newPos; } } public void read_short_array(short[] value, int offset, int length) { if (length <= 0) return; checkChunk(); buf_.pos_ += (buf_.pos_ & 0x1); int newPos = buf_.pos_ + length * 2; if (newPos < buf_.pos_ || newPos > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadShortArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadShortArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (swap_) for (int i = offset; i < offset + length; i++) value[i] = (short) (((short) buf_.data_[buf_.pos_++] & 0xff) | ((short) buf_.data_[buf_.pos_++] << 8)); else for (int i = offset; i < offset + length; i++) value[i] = (short) (((short) buf_.data_[buf_.pos_++] << 8) | ((short) buf_.data_[buf_.pos_++] & 0xff)); } public void read_ushort_array(short[] value, int offset, int length) { read_short_array(value, offset, length); } public void read_long_array(int[] value, int offset, int length) { if (length <= 0) return; checkChunk(); final int pmod4 = buf_.pos_ & 0x3; if (pmod4 != 0) buf_.pos_ += 4 - pmod4; int newPos = buf_.pos_ + length * 4; if (newPos < buf_.pos_ || newPos > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadLongArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadLongArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (swap_) for (int i = offset; i < offset + length; i++) value[i] = ((int) buf_.data_[buf_.pos_++] & 0xff) | (((int) buf_.data_[buf_.pos_++] << 8) & 0xff00) | (((int) buf_.data_[buf_.pos_++] << 16) & 0xff0000) | ((int) buf_.data_[buf_.pos_++] << 24); else for (int i = offset; i < offset + length; i++) value[i] = ((int) buf_.data_[buf_.pos_++] << 24) | (((int) buf_.data_[buf_.pos_++] << 16) & 0xff0000) | (((int) buf_.data_[buf_.pos_++] << 8) & 0xff00) | ((int) buf_.data_[buf_.pos_++] & 0xff); } public void read_ulong_array(int[] value, int offset, int length) { read_long_array(value, offset, length); } public void read_longlong_array(long[] value, int offset, int length) { if (length <= 0) return; checkChunk(); final int pmod8 = buf_.pos_ & 0x7; if (pmod8 != 0) buf_.pos_ += 8 - pmod8; int newPos = buf_.pos_ + length * 8; if (newPos < buf_.pos_ || newPos > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadLongLongArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadLongLongArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (swap_) for (int i = offset; i < offset + length; i++) value[i] = ((long) buf_.data_[buf_.pos_++] & 0xffL) | (((long) buf_.data_[buf_.pos_++] << 8) & 0xff00L) | (((long) buf_.data_[buf_.pos_++] << 16) & 0xff0000L) | (((long) buf_.data_[buf_.pos_++] << 24) & 0xff000000L) | (((long) buf_.data_[buf_.pos_++] << 32) & 0xff00000000L) | (((long) buf_.data_[buf_.pos_++] << 40) & 0xff0000000000L) | (((long) buf_.data_[buf_.pos_++] << 48) & 0xff000000000000L) | ((long) buf_.data_[buf_.pos_++] << 56); else for (int i = offset; i < offset + length; i++) value[i] = ((long) buf_.data_[buf_.pos_++] << 56) | (((long) buf_.data_[buf_.pos_++] << 48) & 0xff000000000000L) | (((long) buf_.data_[buf_.pos_++] << 40) & 0xff0000000000L) | (((long) buf_.data_[buf_.pos_++] << 32) & 0xff00000000L) | (((long) buf_.data_[buf_.pos_++] << 24) & 0xff000000L) | (((long) buf_.data_[buf_.pos_++] << 16) & 0xff0000L) | (((long) buf_.data_[buf_.pos_++] << 8) & 0xff00L) | ((long) buf_.data_[buf_.pos_++] & 0xffL); } public void read_ulonglong_array(long[] value, int offset, int length) { read_longlong_array(value, offset, length); } public void read_float_array(float[] value, int offset, int length) { if (length > 0) { checkChunk(); final int pmod4 = buf_.pos_ & 0x3; if (pmod4 != 0) buf_.pos_ += 4 - pmod4; int newPos = buf_.pos_ + length * 4; if (newPos < buf_.pos_ || newPos > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadFloatArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadFloatArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (swap_) for (int i = offset; i < offset + length; i++) { int v = (buf_.data_[buf_.pos_++] & 0xff) | ((buf_.data_[buf_.pos_++] << 8) & 0xff00) | ((buf_.data_[buf_.pos_++] << 16) & 0xff0000) | (buf_.data_[buf_.pos_++] << 24); value[i] = Float.intBitsToFloat(v); } else for (int i = offset; i < offset + length; i++) { int v = (buf_.data_[buf_.pos_++] << 24) | ((buf_.data_[buf_.pos_++] << 16) & 0xff0000) | ((buf_.data_[buf_.pos_++] << 8) & 0xff00) | (buf_.data_[buf_.pos_++] & 0xff); value[i] = Float.intBitsToFloat(v); } } } public void read_double_array(double[] value, int offset, int length) { if (length <= 0) return; checkChunk(); final int pmod8 = buf_.pos_ & 0x7; if (pmod8 != 0) buf_.pos_ += 8 - pmod8; int newPos = buf_.pos_ + length * 8; if (newPos < buf_.pos_ || newPos > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadDoubleArrayOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadDoubleArrayOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (swap_) for (int i = offset; i < offset + length; i++) { long v = ((long) buf_.data_[buf_.pos_++] & 0xffL) | (((long) buf_.data_[buf_.pos_++] << 8) & 0xff00L) | (((long) buf_.data_[buf_.pos_++] << 16) & 0xff0000L) | (((long) buf_.data_[buf_.pos_++] << 24) & 0xff000000L) | (((long) buf_.data_[buf_.pos_++] << 32) & 0xff00000000L) | (((long) buf_.data_[buf_.pos_++] << 40) & 0xff0000000000L) | (((long) buf_.data_[buf_.pos_++] << 48) & 0xff000000000000L) | ((long) buf_.data_[buf_.pos_++] << 56); value[i] = Double.longBitsToDouble(v); } else for (int i = offset; i < offset + length; i++) { long v = ((long) buf_.data_[buf_.pos_++] << 56) | (((long) buf_.data_[buf_.pos_++] << 48) & 0xff000000000000L) | (((long) buf_.data_[buf_.pos_++] << 40) & 0xff0000000000L) | (((long) buf_.data_[buf_.pos_++] << 32) & 0xff00000000L) | (((long) buf_.data_[buf_.pos_++] << 24) & 0xff000000L) | (((long) buf_.data_[buf_.pos_++] << 16) & 0xff0000L) | (((long) buf_.data_[buf_.pos_++] << 8) & 0xff00L) | ((long) buf_.data_[buf_.pos_++] & 0xffL); value[i] = Double.longBitsToDouble(v); } } public org.omg.CORBA.Object read_Object() { checkChunk(); org.omg.IOP.IOR ior = org.omg.IOP.IORHelper.read(this); if ((ior.type_id.length() == 0) && (ior.profiles.length == 0)) return null; if (orbInstance_ == null) throw new org.omg.CORBA.INITIALIZE("InputStream must be created " + "by a full ORB"); org.apache.yoko.orb.OB.ObjectFactory objectFactory = orbInstance_.getObjectFactory(); return objectFactory.createObject(ior); } public org.omg.CORBA.Object read_Object(Class expectedType) { org.omg.CORBA.Object obj = read_Object(); if (obj == null) return null; // OK, we have two possibilities here. The usual possibility is we're asked to load // an object using a specified Stub class. We just create an instance of the stub class, // attach the object as a delegate, and we're done. // // The second possibility is a request for an instance of an interface. This will require // us to locate a stub class using the defined Stub search orders. After that, the process // is largely the same. org.omg.CORBA.portable.ObjectImpl impl = (org.omg.CORBA.portable.ObjectImpl) obj; if (org.omg.CORBA.portable.ObjectImpl.class.isAssignableFrom(expectedType)) { return createStub(expectedType, impl._get_delegate()); } final String codebase = ((org.omg.CORBA_2_3.portable.ObjectImpl) impl)._get_codebase(); try { if (IDLEntity.class.isAssignableFrom(expectedType)) { final Class<?> helperClass = Util.loadClass(expectedType.getName() + "Helper", codebase, expectedType.getClassLoader()); final Method helperNarrow = AccessController.doPrivileged(new PrivilegedExceptionAction<Method>() { @Override public Method run() throws NoSuchMethodException { return helperClass.getMethod("narrow", org.omg.CORBA.Object.class); } }); return (org.omg.CORBA.Object) helperNarrow.invoke(null, impl); } return createStub(getRMIStubClass(codebase, expectedType), impl._get_delegate()); } catch (IllegalAccessException | ClassNotFoundException | ClassCastException | PrivilegedActionException | InvocationTargetException ex) { logger.log(java.util.logging.Level.FINE, "Exception creating object stub", ex); MARSHAL m = new org.omg.CORBA.MARSHAL("Unable to create stub for class " + expectedType.getName(), org.apache.yoko.orb.OB.MinorCodes.MinorLoadStub, org.omg.CORBA.CompletionStatus.COMPLETED_NO); m.initCause(ex); throw m; } } private org.omg.CORBA.Object createStub(Class<?> stubClass, org.omg.CORBA.portable.Delegate delegate) { Assert._OB_assert(ObjectImpl.class.isAssignableFrom(stubClass), "stub class " + stubClass.getName() + " must extend ObjectImpl"); @SuppressWarnings("unchecked") Class<? extends ObjectImpl> clz = (Class<? extends ObjectImpl>) stubClass; try { org.omg.CORBA.portable.ObjectImpl stub = clz.newInstance(); stub._set_delegate(delegate); return stub; } catch (IllegalAccessException | InstantiationException ex) { logger.log(Level.FINE, "Exception creating object stub", ex); MARSHAL m = new MARSHAL("Unable to create stub for class " + clz.getName(), MinorCodes.MinorLoadStub, CompletionStatus.COMPLETED_NO); m.initCause(ex); throw m; } } /** * Convert a class type into a stub class name using the RMI stub name rules. * @param c The class we need to stub. * @return The target stub class name. */ private String getRMIStubClassName(Class<?> c) { final String cname = c.getName(); int idx = cname.lastIndexOf('.'); return cname.substring(0, idx + 1) + "_" + cname.substring(idx + 1) + "_Stub"; } /** * Load a statically-created Stub class for a type, attempting both the old * and new stub class rules. * @param codebase The search codebase to use. * @param type The type we need a stub for. * @return A loaded stub class. */ @SuppressWarnings("unchecked") private Class<? extends org.omg.CORBA.portable.ObjectImpl> getRMIStubClass(String codebase, Class<?> type) throws ClassNotFoundException { String name = getRMIStubClassName(type); ClassLoader cl = type.getClassLoader(); try { return Util.loadClass(name, codebase, cl); } catch (ClassNotFoundException e1) { try { return Util.loadClass("org.omg.stub." + name, codebase, cl); } catch (ClassNotFoundException e2) { e2.addSuppressed(e1); throw e2; } } } public org.omg.CORBA.TypeCode read_TypeCode() { // // NOTE: // // No data with natural alignment of greater than four octets // is needed for TypeCode. Therefore it is not necessary to do // encapsulation in a separate buffer. // checkChunk(); java.util.Hashtable history = new java.util.Hashtable(11); return readTypeCodeImpl(history, true); } public org.omg.CORBA.Any read_any() { org.omg.CORBA.Any any = new Any(orbInstance_); any.read_value(this, read_TypeCode()); return any; } public org.omg.CORBA.Context read_Context() { final int len = read_ulong(); String[] values = new String[len]; for (int i = 0; i < len; i++) values[i] = read_string(); return new Context(orbInstance_.getORB(), "", values); } public org.omg.CORBA.Principal read_Principal() { // Deprecated by CORBA 2.2 throw new org.omg.CORBA.NO_IMPLEMENT(); } public java.math.BigDecimal read_fixed() { StringBuffer vBuffer = new StringBuffer("0"); StringBuffer sBuffer = new StringBuffer(); boolean first = true; while (true) { final byte b = read_octet(); int hi = (b >>> 4) & 0x0f; if (hi > 9) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadFixedInvalid), org.apache.yoko.orb.OB.MinorCodes.MinorReadFixedInvalid, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // 0 as high nibble is only valid if it's not the first nibble // if (!first || hi > 0) vBuffer.append((char) (hi + '0')); final int lo = b & 0x0f; if (lo < 10) vBuffer.append((char) (lo + '0')); else if (lo == 0x0c || lo == 0x0d) { if (lo == 0x0d) sBuffer.append("-"); break; } else throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadFixedInvalid), org.apache.yoko.orb.OB.MinorCodes.MinorReadFixedInvalid, org.omg.CORBA.CompletionStatus.COMPLETED_NO); first = false; } sBuffer.append(vBuffer); try { return new java.math.BigDecimal(sBuffer.toString()); } catch (NumberFormatException ex) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadFixedInvalid), org.apache.yoko.orb.OB.MinorCodes.MinorReadFixedInvalid, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } } public java.io.Serializable read_value() { return valueReader().readValue(); } public java.io.Serializable read_value(String id) { return valueReader().readValue(id); } public java.io.Serializable read_value(Class clz) { return valueReader().readValue(clz); } public java.io.Serializable read_value(org.omg.CORBA.portable.BoxedValueHelper helper) { return valueReader().readValueBox(helper); } public java.io.Serializable read_value(java.io.Serializable value) { // // This version of read_value is intended for use by factories // valueReader().initializeValue(value); return value; } public java.lang.Object read_abstract_interface() { return valueReader().readAbstractInterface(); } public java.lang.Object read_abstract_interface(java.lang.Class clz) { return valueReader().readAbstractInterface(clz); } // ------------------------------------------------------------------ // ORBacus-specific methods // ------------------------------------------------------------------ public void read_value(org.omg.CORBA.Any any, org.omg.CORBA.TypeCode tc) { valueReader().readValueAny(any, tc); } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public InputStream(org.apache.yoko.orb.OCI.Buffer buf, int offs, boolean swap, org.apache.yoko.orb.OB.CodeConverters codeConverters, GiopVersion giopVersion) { buf_ = buf; buf_.pos(offs); swap_ = swap; origPos_ = offs; origSwap_ = swap; _OB_codeConverters(codeConverters, giopVersion); } public InputStream(org.apache.yoko.orb.OCI.Buffer buf, int offs, boolean swap) { this(buf, offs, swap, null, null); } public InputStream(org.apache.yoko.orb.OCI.Buffer buf) { this(buf, 0, false, null, null); } public void _OB_codeConverters(org.apache.yoko.orb.OB.CodeConverters converters, GiopVersion giopVersion) { if (giopVersion != null) giopVersion_ = giopVersion; charReaderRequired_ = false; charConversionRequired_ = false; wCharReaderRequired_ = false; wCharConversionRequired_ = false; codeConverters_ = new org.apache.yoko.orb.OB.CodeConverters(converters); if (converters != null) { if (codeConverters_.inputCharConverter != null) { charReaderRequired_ = codeConverters_.inputCharConverter.readerRequired(); charConversionRequired_ = codeConverters_.inputCharConverter.conversionRequired(); } if (codeConverters_.inputWcharConverter != null) { wCharReaderRequired_ = codeConverters_.inputWcharConverter.readerRequired(); wCharConversionRequired_ = codeConverters_.inputWcharConverter.conversionRequired(); } } } public org.apache.yoko.orb.OB.CodeConverters _OB_codeConverters() { return codeConverters_; } public org.apache.yoko.orb.OCI.Buffer _OB_buffer() { return buf_; } public int _OB_pos() { return buf_.pos_; } public void _OB_pos(int pos) { buf_.pos_ = pos; } public boolean _OB_swap() { return swap_; } public void _OB_swap(boolean swap) { swap_ = swap; } public InputStream _OB_clone() { InputStream result; byte[] data = new byte[buf_.len_]; System.arraycopy(buf_.data_, 0, data, 0, buf_.len_); org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(data, data.length); result = new InputStream(buf, origPos_, origSwap_, codeConverters_, giopVersion_); result.orbInstance_ = orbInstance_; return result; } public void _OB_reset() { swap_ = origSwap_; buf_.pos_ = origPos_; } public void _OB_skip(int n) { int newPos = buf_.pos_ + n; if (newPos < buf_.pos_ || newPos > buf_.len_) throw new org.omg.CORBA.MARSHAL(org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); buf_.pos_ = newPos; } public void _OB_skipAlign(int n) { if (buf_.pos_ % n != 0) { int newPos = buf_.pos_ + n - buf_.pos_ % n; if (newPos < buf_.pos_ || newPos > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); buf_.pos_ = newPos; } } public void _OB_readEndian() { swap_ = read_boolean() != false; // false means big endian } public void _OB_ORBInstance(org.apache.yoko.orb.OB.ORBInstance orbInstance) { orbInstance_ = orbInstance; if (orbInstance_ != null && orbInstance_.useTypeCodeCache()) { // // Get the TypeCodeCache of this ORBInstance // cache_ = org.apache.yoko.orb.OB.TypeCodeCache.instance(); } } public org.apache.yoko.orb.OB.ORBInstance _OB_ORBInstance() { return orbInstance_; } public int _OB_readLongUnchecked() { // // The chunking code needs to read a long value without entering // an infinite loop // final int pmod4 = buf_.pos_ & 0x3; if (pmod4 != 0) buf_.pos_ += 4 - pmod4; if (buf_.pos_ + 4 > buf_.len_) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes.describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadLongOverflow), org.apache.yoko.orb.OB.MinorCodes.MinorReadLongOverflow, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (swap_) return (buf_.data_[buf_.pos_++] & 0xff) | ((buf_.data_[buf_.pos_++] << 8) & 0xff00) | ((buf_.data_[buf_.pos_++] << 16) & 0xff0000) | (buf_.data_[buf_.pos_++] << 24); else return (buf_.data_[buf_.pos_++] << 24) | ((buf_.data_[buf_.pos_++] << 16) & 0xff0000) | ((buf_.data_[buf_.pos_++] << 8) & 0xff00) | (buf_.data_[buf_.pos_++] & 0xff); } public void _OB_beginValue() { valueReader().beginValue(); } public void _OB_endValue() { valueReader().endValue(); } public void _OB_remarshalValue(org.omg.CORBA.TypeCode tc, OutputStream out) { valueReader().remarshalValue(tc, out); } public void __setSendingContextRuntime(org.omg.SendingContext.CodeBase runtime) { sendingContextRuntime_ = runtime; } public org.omg.SendingContext.CodeBase __getSendingContextRuntime() { return sendingContextRuntime_; } public void __setCodeBase(String codebase) { this.codebase_ = codebase; } public String __getCodeBase() { return codebase_; } public String dumpData() { return buf_.dumpData(); } private void checkChunk() { if (valueReader_ != null) { valueReader_.checkChunk(); } } @Override public void end_value() { valueReader().endValue(); } @Override public void start_value() { valueReader().beginValue(); } }
6,754
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/OutputStream.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.yoko.orb.OCI.GiopVersion; import org.omg.CORBA.portable.ValueOutputStream; final public class OutputStream extends org.omg.CORBA_2_3.portable.OutputStream implements ValueOutputStream { static final Logger LOGGER = Logger.getLogger(OutputStream.class.getName()); private org.apache.yoko.orb.OB.ORBInstance orbInstance_; // Java only public org.apache.yoko.orb.OCI.Buffer buf_; private GiopVersion giopVersion_ = org.apache.yoko.orb.OB.OB_Extras.DEFAULT_GIOP_VERSION; private org.apache.yoko.orb.OB.CodeConverters codeConverters_; private boolean charWriterRequired_; private boolean charConversionRequired_; private boolean wCharWriterRequired_; private boolean wCharConversionRequired_; // // Handles all OBV marshalling // private org.apache.yoko.orb.OB.ValueWriter valueWriter_; // // If alignNext_ > 0, the next write should be aligned on this // boundary // private int alignNext_; private java.lang.Object invocationContext_; // Java only private java.lang.Object delegateContext_; // Java only // ------------------------------------------------------------------ // Private and protected functions // ------------------------------------------------------------------ // Write a gap of four bytes (ulong aligned), avoids byte shifts private int writeGap() { LOGGER.finest("Writing a gap value"); addCapacity(4, 4); int result = buf_.pos_; buf_.pos_ += 4; return result; } private void writeLength(int start) { int length = buf_.pos_ - (start + 4); LOGGER.finest("Writing a length value of " + length + " at offset " + start); buf_.data_[start++] = (byte) (length >>> 24); buf_.data_[start++] = (byte) (length >>> 16); buf_.data_[start++] = (byte) (length >>> 8); buf_.data_[start] = (byte) length; } public void writeTypeCodeImpl(org.omg.CORBA.TypeCode tc, java.util.Hashtable history) { // // Try casting the TypeCode to org.apache.yoko.orb.CORBA.TypeCode. This // could // fail if the TypeCode was created by a foreign singleton ORB. // TypeCode obTC = null; try { obTC = (TypeCode) tc; } catch (ClassCastException ex) { } if (obTC != null) { if (obTC.recId_ != null) { if (obTC.recType_ == null) throw new org.omg.CORBA.BAD_TYPECODE( org.apache.yoko.orb.OB.MinorCodes .describeBadTypecode(org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode), org.apache.yoko.orb.OB.MinorCodes.MinorIncompleteTypeCode, org.omg.CORBA.CompletionStatus.COMPLETED_NO); writeTypeCodeImpl(obTC.recType_, history); return; } } LOGGER.finest("Writing a type code of type " + tc.kind().value()); // // For performance reasons, handle the primitive TypeCodes first // switch (tc.kind().value()) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ushort: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_float: case org.omg.CORBA.TCKind._tk_double: case org.omg.CORBA.TCKind._tk_longdouble: case org.omg.CORBA.TCKind._tk_boolean: case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_wchar: case org.omg.CORBA.TCKind._tk_octet: case org.omg.CORBA.TCKind._tk_any: case org.omg.CORBA.TCKind._tk_TypeCode: case org.omg.CORBA.TCKind._tk_Principal: write_ulong(tc.kind().value()); return; default: break; } Integer indirectionPos = (Integer) history.get(tc); if (indirectionPos != null) { write_long(-1); int offs = indirectionPos.intValue() - buf_.pos_; LOGGER.finest("Writing an indirect type code for offset " + offs); write_long(offs); } else { write_ulong(tc.kind().value()); Integer oldPos = new Integer(buf_.pos_ - 4); try { switch (tc.kind().value()) { case org.omg.CORBA.TCKind._tk_fixed: { history.put(tc, oldPos); write_ushort(tc.fixed_digits()); write_short(tc.fixed_scale()); break; } case org.omg.CORBA.TCKind._tk_objref: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); writeLength(start); break; } case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); write_ulong(tc.member_count()); for (int i = 0; i < tc.member_count(); i++) { write_string(tc.member_name(i)); writeTypeCodeImpl(tc.member_type(i), history); } writeLength(start); break; } case org.omg.CORBA.TCKind._tk_union: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); org.omg.CORBA.TypeCode discType = tc.discriminator_type(); writeTypeCodeImpl(discType, history); int defaultIndex = tc.default_index(); write_long(defaultIndex); write_ulong(tc.member_count()); for (int i = 0; i < tc.member_count(); i++) { // // Check for default label value // if (i == defaultIndex) { // // Marshal a dummy value of the appropriate size // for the discriminator type // org.omg.CORBA.TypeCode origDiscType = TypeCode ._OB_getOrigType(discType); switch (origDiscType.kind().value()) { case org.omg.CORBA.TCKind._tk_short: write_short((short) 0); break; case org.omg.CORBA.TCKind._tk_ushort: write_ushort((short) 0); break; case org.omg.CORBA.TCKind._tk_long: write_long(0); break; case org.omg.CORBA.TCKind._tk_ulong: write_ulong(0); break; case org.omg.CORBA.TCKind._tk_longlong: write_longlong(0); break; case org.omg.CORBA.TCKind._tk_ulonglong: write_ulonglong(0); break; case org.omg.CORBA.TCKind._tk_boolean: write_boolean(false); break; case org.omg.CORBA.TCKind._tk_char: write_char((char) 0); break; case org.omg.CORBA.TCKind._tk_enum: write_ulong(0); break; default: org.apache.yoko.orb.OB.Assert._OB_assert("Invalid sub-type in tk_union"); } } else { tc.member_label(i).write_value(this); } write_string(tc.member_name(i)); writeTypeCodeImpl(tc.member_type(i), history); } writeLength(start); break; } case org.omg.CORBA.TCKind._tk_enum: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); write_ulong(tc.member_count()); for (int i = 0; i < tc.member_count(); i++) write_string(tc.member_name(i)); writeLength(start); break; } case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: write_ulong(tc.length()); break; case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); writeTypeCodeImpl(tc.content_type(), history); write_ulong(tc.length()); writeLength(start); break; } case org.omg.CORBA.TCKind._tk_alias: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); writeTypeCodeImpl(tc.content_type(), history); writeLength(start); break; } case org.omg.CORBA.TCKind._tk_value: { history.put(tc, oldPos); org.omg.CORBA.TypeCode concreteBase = tc .concrete_base_type(); if (concreteBase == null) { concreteBase = org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_null); } int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); write_short(tc.type_modifier()); writeTypeCodeImpl(concreteBase, history); write_ulong(tc.member_count()); for (int i = 0; i < tc.member_count(); i++) { write_string(tc.member_name(i)); writeTypeCodeImpl(tc.member_type(i), history); write_short(tc.member_visibility(i)); } writeLength(start); break; } case org.omg.CORBA.TCKind._tk_value_box: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); writeTypeCodeImpl(tc.content_type(), history); writeLength(start); break; } case org.omg.CORBA.TCKind._tk_abstract_interface: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); writeLength(start); break; } case org.omg.CORBA.TCKind._tk_native: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); writeLength(start); break; } case org.omg.CORBA_2_4.TCKind._tk_local_interface: { history.put(tc, oldPos); int start = writeGap(); _OB_writeEndian(); write_string(tc.id()); write_string(tc.name()); writeLength(start); break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Invalid typecode"); } } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.TypeCodePackage.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } } // // Must be called prior to any writes // private void checkBeginChunk() { org.apache.yoko.orb.OB.Assert._OB_assert(valueWriter_ != null); valueWriter_.checkBeginChunk(); } private org.apache.yoko.orb.OB.ValueWriter valueWriter() { if (valueWriter_ == null) valueWriter_ = new org.apache.yoko.orb.OB.ValueWriter(this); return valueWriter_; } private void addCapacity(int size) { // // Expand buffer to hold requested size // // Note: OutputStreams are not always written to in a linear // fashion, i.e., sometimes the position is reset to // an earlier point and data is patched in. Therefore, // do NOT do this: // // buf_.realloc(buf_.len_ + size); // // if (alignNext_ > 0) { int align = alignNext_; alignNext_ = 0; addCapacity(size, align); } else { // // If we're at the end of the current buffer, then we are about // to write new data. We must first check if we need to start a // chunk, which may result in a recursive call to addCapacity(). // if (buf_.pos_ == buf_.len_ && valueWriter_ != null) { checkBeginChunk(); } // // If there isn't enough room, then reallocate the buffer // final int len = buf_.pos_ + size; if (len > buf_.len_) { buf_.realloc(len); } } } private int roundUp(final int i, final int align) { switch (align) { case 0x00: return i; case 0x01: return i; case 0x02: return ((i + 0b0001) & ~(0b0001)); case 0x04: return ((i + 0b0011) & ~(0b0011)); case 0x08: return ((i + 0b0111) & ~(0b0111)); case 0x10: return ((i + 0b1111) & ~(0b1111)); default: if (LOGGER.isLoggable(Level.WARNING)) LOGGER.warning(String.format("Aligning on a strange number 0x%x", align)); final int j = (i + align - 1); return (j - (j % align)); } } private static final byte PAD_BYTE = (byte)0xbd; private void addCapacity(int size, int align) { // use addCapacity(int) if align == 0 org.apache.yoko.orb.OB.Assert._OB_assert(align > 0); // // If we're at the end of the current buffer, then we are about // to write new data. We must first check if we need to start a // chunk, which may result in a recursive call to addCapacity(). // if (buf_.pos_ == buf_.len_ && valueWriter_ != null) { checkBeginChunk(); } // // If alignNext_ is set, then use the larger of alignNext_ and align // if (alignNext_ > 0) { align = (alignNext_ > align ? alignNext_ : align); alignNext_ = 0; } final int newPos = roundUp(buf_.pos_, align); // // If there isn't enough room, then reallocate the buffer // final int len = newPos + size; if (len > buf_.len_) { buf_.realloc(len); } // // Pad to the requested boundary // for (; buf_.pos_ < newPos; buf_.pos_++) { buf_.data_[buf_.pos_] = PAD_BYTE; } } // // write wchar using old non-compliant method // private void _OB_write_wchar_old(char value) { if (wCharConversionRequired_) { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.outputWcharConverter; value = converter.convert(value); // // For GIOP 1.1 non byte-oriented wide characters are written // as ushort or ulong, depending on their maximum length // listed in the code set registry. // switch (giopVersion_) { case GIOP1_1: { if (converter.getTo().max_bytes <= 2) write_ushort((short) value); else write_ulong((int) value); } break; default: { final int length = converter.write_count_wchar(value); write_octet((byte) length); addCapacity(length); converter.write_wchar(this, value); } break; } } // // UTF-16 // else { switch (giopVersion_) { case GIOP1_0: case GIOP1_1: write_ushort((short) value); break; default: addCapacity(3); buf_.data_[buf_.pos_++] = 2; buf_.data_[buf_.pos_++] = (byte) (value >> 8); buf_.data_[buf_.pos_++] = (byte) value; break; } } } // // write wchar using new compilant method // private void _OB_write_wchar_new(char value, boolean partOfString) { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.outputWcharConverter; // // pre-convert the character if necessary // if (wCharConversionRequired_) value = converter.convert(value); if (wCharWriterRequired_) { if (partOfString == false) converter .set_writer_flags(org.apache.yoko.orb.OB.CodeSetWriter.FIRST_CHAR); // // For GIOP 1.1 non byte-oriented wide characters are written // as ushort or ulong, depending on their maximum length // listed in the code set registry. // switch (giopVersion_) { case GIOP1_0: { // // we don't support special writers for GIOP 1.0 if // conversion is required or if a writer is required // org.apache.yoko.orb.OB.Assert._OB_assert(false); } break; case GIOP1_1: { // // get the length of the character // int len = converter.write_count_wchar(value); // // For GIOP 1.1 we are limited to 2-byte wchars // so make sure to check for that // org.apache.yoko.orb.OB.Assert._OB_assert(len == 2); // // allocate aligned space // addCapacity(2, 2); // // write using the writer // converter.write_wchar(this, value); } break; default: { // // get the length of the character // int len = converter.write_count_wchar(value); // // write the octet length at the beginning // write_octet((byte) len); // // add unaligned capacity // addCapacity(len); // // write the actual character // converter.write_wchar(this, value); } break; } } else { switch (giopVersion_) { case GIOP1_0: { // // Orbix2000/Orbacus/E compatible 1.0 marshal // // // add aligned capacity // addCapacity(2, 2); // // write 2-byte character in big endian // buf_.data_[buf_.pos_++] = (byte) (value >>> 8); buf_.data_[buf_.pos_++] = (byte) (value & 0xff); } break; case GIOP1_1: { write_ushort((short) value); } break; default: { // // add unaligned space for character // addCapacity(3); // // write the octet length at the start // buf_.data_[buf_.pos_++] = 2; // // write the character in big endian format // buf_.data_[buf_.pos_++] = (byte) (value >>> 8); buf_.data_[buf_.pos_++] = (byte) (value & 0xff); } break; } } } // // write wstring using old non-compliant method // private void _OB_write_wstring_old(String value) { final char[] arr = value.toCharArray(); final int len = arr.length; // // 15.3.2.7: For GIOP version 1.1, a wide string is encoded as an // unsigned long indicating the length of the string in octets or // unsigned integers (determined by the transfer syntax for wchar) // followed by the individual wide characters. Both the string length // and contents include a terminating null. The terminating null // character for a wstring is also a wide character. // switch (giopVersion_) { case GIOP1_0: case GIOP1_1: { write_ulong(len + 1); write_wchar_array(arr, 0, len); write_wchar((char) 0); } break; default: { // // For octet count // int start = writeGap(); if (wCharConversionRequired_) { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.outputWcharConverter; for (int i = 0; i < len; i++) { char v = converter.convert(arr[i]); if (v == 0) throw new org.omg.CORBA.DATA_CONVERSION( "illegal wchar value for wstring: " + (int) v); addCapacity(converter.write_count_wchar(v)); converter.write_wchar(this, v); } } // // UTF-16 // else { addCapacity(2 * len); for (int i = 0; i < len; i++) { char v = arr[i]; if (v == 0) throw new org.omg.CORBA.DATA_CONVERSION( "illegal wchar value for wstring: " + (int) v); buf_.data_[buf_.pos_++] = (byte) (v >> 8); buf_.data_[buf_.pos_++] = (byte) v; } } // // Write octet count // writeLength(start); } break; } } // // write wstring using new compliant method // private void _OB_write_wstring_new(String value) { final char[] arr = value.toCharArray(); final int len = arr.length; LOGGER.finest("Writing wstring value " + value); // // get converter/writer instance // final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.outputWcharConverter; // // some writers (specially UTF-16) requires the possible BOM // only found at the beginning of a string... this will // indicate that we are at the start of the first character // of the string to the writer if (wCharWriterRequired_) converter .set_writer_flags(org.apache.yoko.orb.OB.CodeSetWriter.FIRST_CHAR); // // for GIOP 1.0/1.1 we don't need to differentiate between // strings requiring a writer/converter (or not) since they can // be handled by the write_wchar() method // switch (giopVersion_) { case GIOP1_0: case GIOP1_1: // // write the length of the string // write_ulong(len + 1); // // now write all the characters // for (int i = 0; i < len; i++) write_wchar(arr[i], true); // // and the null terminator // write_wchar((char) 0, true); return; default: } // // save the starting position and write the gap to place the // length of the string later // int start = writeGap(); // // we've handled GIOP 1.0/1.1 above so this must be GIOP 1.2+ // if (wCharWriterRequired_) { for (int i = 0; i < len; i++) { char v = arr[i]; // // check if the character requires conversion // if (wCharConversionRequired_) v = converter.convert(v); // // illegal for the string to contain nulls // if (v == 0) throw new org.omg.CORBA.DATA_CONVERSION( "illegal wchar value for wstring: " + (int) v); // // add capacity for the character // addCapacity(converter.write_count_wchar(v)); // // write the character // converter.write_wchar(this, v); } } else { // // since we don't require a special writer, each character // MUST be 2-bytes in size // addCapacity(len << 1); for (int i = 0; i < len; i++) { char v = arr[i]; // // check for conversion // if (wCharConversionRequired_) v = converter.convert(v); // // write character in big endian format // buf_.data_[buf_.pos_++] = (byte) (v >>> 8); buf_.data_[buf_.pos_++] = (byte) (v & 0xff); } } // // write the octet length // writeLength(start); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public void write(int b) throws java.io.IOException { // // this matches the behaviour of this function in the Java ORB // and not what is outlined in the java.io.OutputStream // write_long(b); } public org.omg.CORBA.ORB orb() { if (orbInstance_ != null) return orbInstance_.getORB(); return null; } public org.omg.CORBA.portable.InputStream create_input_stream() { org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer( buf_.len_); if (buf_.len_ > 0) System.arraycopy(buf_.data_, 0, buf.data_, 0, buf_.len_); // this is a useful tracepoint, but produces a lot of data, so turn on only // if really needed. // if (logger.isLoggable(Level.FINEST)) { // logger.fine("new input stream created:\n" + buf.dumpData()); // } InputStream in = new InputStream(buf, 0, false, codeConverters_, giopVersion_); in._OB_ORBInstance(orbInstance_); return in; } public void write_boolean(boolean value) { addCapacity(1); buf_.data_[buf_.pos_++] = value ? (byte) 1 : (byte) 0; } public void write_char(char value) { if (value > 255) throw new org.omg.CORBA.DATA_CONVERSION("char value exceeds 255: " + (int) value); addCapacity(1); final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.outputCharConverter; if (charConversionRequired_) value = converter.convert(value); if (charWriterRequired_) converter.write_char(this, value); else buf_.data_[buf_.pos_++] = (byte) value; } public void write_wchar(char value) { write_wchar(value, false); } public void write_wchar(char value, boolean partOfString) { if (org.apache.yoko.orb.OB.OB_Extras.COMPAT_WIDE_MARSHAL == false) _OB_write_wchar_new(value, partOfString); else _OB_write_wchar_old(value); } public void write_octet(byte value) { addCapacity(1); buf_.data_[buf_.pos_++] = value; } public void write_short(short value) { addCapacity(2, 2); buf_.data_[buf_.pos_++] = (byte) (value >>> 8); buf_.data_[buf_.pos_++] = (byte) value; } public void write_ushort(short value) { write_short(value); } public void write_long(int value) { addCapacity(4, 4); buf_.data_[buf_.pos_++] = (byte) (value >>> 24); buf_.data_[buf_.pos_++] = (byte) (value >>> 16); buf_.data_[buf_.pos_++] = (byte) (value >>> 8); buf_.data_[buf_.pos_++] = (byte) value; } public void write_ulong(int value) { write_long(value); } public void write_longlong(long value) { addCapacity(8, 8); buf_.data_[buf_.pos_++] = (byte) (value >>> 56); buf_.data_[buf_.pos_++] = (byte) (value >>> 48); buf_.data_[buf_.pos_++] = (byte) (value >>> 40); buf_.data_[buf_.pos_++] = (byte) (value >>> 32); buf_.data_[buf_.pos_++] = (byte) (value >>> 24); buf_.data_[buf_.pos_++] = (byte) (value >>> 16); buf_.data_[buf_.pos_++] = (byte) (value >>> 8); buf_.data_[buf_.pos_++] = (byte) value; } public void write_ulonglong(long value) { write_longlong(value); } public void write_float(float value) { write_long(Float.floatToIntBits(value)); } public void write_double(double value) { write_longlong(Double.doubleToLongBits(value)); } public void write_string(String value) { LOGGER.finest("Writing string value " + value); final char[] arr = value.toCharArray(); int len = arr.length; int capacity = len + 1; if (!(charWriterRequired_ || charConversionRequired_)) { write_ulong(capacity); addCapacity(capacity); for (int i = 0; i < len; i++) { char c = arr[i]; if (c == 0 || c > 255) throw new org.omg.CORBA.DATA_CONVERSION( "illegal char value for string: " + (int) c); buf_.data_[buf_.pos_++] = (byte) c; } } else { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.outputCharConverter; // // Intermediate variable used for efficiency // boolean bothRequired = charWriterRequired_ && charConversionRequired_; // // Temporary OCI buffer required // org.apache.yoko.orb.OCI.Buffer buffer = new org.apache.yoko.orb.OCI.Buffer( 64); OutputStream tmpStream = new OutputStream(buffer); for (int i = 0; i < len; i++) { char c = arr[i]; if (c == 0 || c > 255) throw new org.omg.CORBA.DATA_CONVERSION( "illegal char value for string: " + (int) c); // // Expand the temporary buffer, if necessary // if (buffer.length() - buffer.pos() <= 4) buffer.realloc(buffer.length() * 2); if (bothRequired) converter.write_char(tmpStream, converter.convert(c)); else if (charWriterRequired_) converter.write_char(tmpStream, c); else buffer.data_[buffer.pos_++] = (byte) converter.convert(c); } // // Copy the contents from the temporary buffer // int bufSize = buffer.pos_; write_ulong(bufSize + 1); addCapacity(bufSize + 1); for (int i = 0; i < bufSize; i++) { buf_.data_[buf_.pos_++] = buffer.data_[i]; } } buf_.data_[buf_.pos_++] = (byte) 0; } public void write_wstring(String value) { if (org.apache.yoko.orb.OB.OB_Extras.COMPAT_WIDE_MARSHAL == false) _OB_write_wstring_new(value); else _OB_write_wstring_old(value); } public void write_boolean_array(boolean[] value, int offset, int length) { if (length > 0) { addCapacity(length); for (int i = offset; i < offset + length; i++) buf_.data_[buf_.pos_++] = value[i] ? (byte) 1 : (byte) 0; } } public void write_char_array(char[] value, int offset, int length) { if (length > 0) { addCapacity(length); if (!(charWriterRequired_ || charConversionRequired_)) { for (int i = offset; i < offset + length; i++) { if (value[i] > 255) throw new org.omg.CORBA.DATA_CONVERSION( "char value exceeds 255: " + (int) value[i]); buf_.data_[buf_.pos_++] = (byte) value[i]; } } else { final org.apache.yoko.orb.OB.CodeConverterBase converter = codeConverters_.outputCharConverter; // // Intermediate variable used for efficiency // boolean bothRequired = charWriterRequired_ && charConversionRequired_; for (int i = offset; i < offset + length; i++) { if (value[i] > 255) throw new org.omg.CORBA.DATA_CONVERSION( "char value exceeds 255: " + (int) value[i]); if (bothRequired) converter.write_char(this, converter.convert(value[i])); else if (charWriterRequired_) converter.write_char(this, value[i]); else buf_.data_[buf_.pos_++] = (byte) converter .convert(value[i]); } } } } public void write_wchar_array(char[] value, int offset, int length) { for (int i = offset; i < offset + length; i++) write_wchar(value[i], false); } public void write_octet_array(byte[] value, int offset, int length) { if (length > 0) { addCapacity(length); System.arraycopy(value, offset, buf_.data_, buf_.pos_, length); buf_.pos_ += length; } } public void write_short_array(short[] value, int offset, int length) { if (length > 0) { addCapacity(length * 2, 2); for (int i = offset; i < offset + length; i++) { buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 8); buf_.data_[buf_.pos_++] = (byte) value[i]; } } } public void write_ushort_array(short[] value, int offset, int length) { write_short_array(value, offset, length); } public void write_long_array(int[] value, int offset, int length) { if (length > 0) { addCapacity(length * 4, 4); for (int i = offset; i < offset + length; i++) { buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 24); buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 16); buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 8); buf_.data_[buf_.pos_++] = (byte) value[i]; } } } public void write_ulong_array(int[] value, int offset, int length) { write_long_array(value, offset, length); } public void write_longlong_array(long[] value, int offset, int length) { if (length > 0) { addCapacity(length * 8, 8); for (int i = offset; i < offset + length; i++) { buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 56); buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 48); buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 40); buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 32); buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 24); buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 16); buf_.data_[buf_.pos_++] = (byte) (value[i] >>> 8); buf_.data_[buf_.pos_++] = (byte) value[i]; } } } public void write_ulonglong_array(long[] value, int offset, int length) { write_longlong_array(value, offset, length); } public void write_float_array(float[] value, int offset, int length) { if (length > 0) { addCapacity(length * 4, 4); for (int i = offset; i < offset + length; i++) { int v = Float.floatToIntBits(value[i]); buf_.data_[buf_.pos_++] = (byte) (v >>> 24); buf_.data_[buf_.pos_++] = (byte) (v >>> 16); buf_.data_[buf_.pos_++] = (byte) (v >>> 8); buf_.data_[buf_.pos_++] = (byte) v; } } } public void write_double_array(double[] value, int offset, int length) { if (length > 0) { addCapacity(length * 8, 8); for (int i = offset; i < offset + length; i++) { long v = Double.doubleToLongBits(value[i]); buf_.data_[buf_.pos_++] = (byte) (v >>> 56); buf_.data_[buf_.pos_++] = (byte) (v >>> 48); buf_.data_[buf_.pos_++] = (byte) (v >>> 40); buf_.data_[buf_.pos_++] = (byte) (v >>> 32); buf_.data_[buf_.pos_++] = (byte) (v >>> 24); buf_.data_[buf_.pos_++] = (byte) (v >>> 16); buf_.data_[buf_.pos_++] = (byte) (v >>> 8); buf_.data_[buf_.pos_++] = (byte) v; } } } public void write_Object(org.omg.CORBA.Object value) { if (value == null) { LOGGER.finest("Writing a null CORBA object value"); org.omg.IOP.IOR ior = new org.omg.IOP.IOR(); ior.type_id = ""; ior.profiles = new org.omg.IOP.TaggedProfile[0]; org.omg.IOP.IORHelper.write(this, ior); } else { if (value instanceof org.omg.CORBA.LocalObject) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorLocalObject), org.apache.yoko.orb.OB.MinorCodes.MinorLocalObject, org.omg.CORBA.CompletionStatus.COMPLETED_NO); Delegate p = (Delegate) ((org.omg.CORBA.portable.ObjectImpl) value) ._get_delegate(); p._OB_marshalOrigIOR(this); } } public void write_TypeCode(org.omg.CORBA.TypeCode t) { // // NOTE: // // No data with natural alignment of greater than four octets // is needed for TypeCode. Therefore it is not necessary to do // encapsulation in a separate buffer. // if (t == null) throw new org.omg.CORBA.BAD_TYPECODE("TypeCode is nil"); java.util.Hashtable history = new java.util.Hashtable(11); writeTypeCodeImpl(t, history); } public void write_any(org.omg.CORBA.Any value) { LOGGER.finest("Writing an ANY value of type " + value.type().kind()); write_TypeCode(value.type()); value.write_value(this); } public void write_Context(org.omg.CORBA.Context ctx, org.omg.CORBA.ContextList contexts) { int count = contexts.count(); java.util.Vector v = new java.util.Vector(); org.apache.yoko.orb.CORBA.Context ctxImpl = (org.apache.yoko.orb.CORBA.Context) ctx; for (int i = 0; i < count; i++) { try { String pattern = contexts.item(i); ctxImpl._OB_getValues("", 0, pattern, v); } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } write_ulong(v.size()); java.util.Enumeration e = v.elements(); while (e.hasMoreElements()) write_string((String) e.nextElement()); } public void write_Principal(org.omg.CORBA.Principal value) { // Deprecated by CORBA 2.2 throw new org.omg.CORBA.NO_IMPLEMENT(); } public void write_fixed(java.math.BigDecimal value) { String v = value.abs().toString(); // // Append coded sign to value string // if (value.signum() == -1) v += (char) ('0' + 0x0d); else v += (char) ('0' + 0x0c); String s = ""; if ((v.length() & 1) != 0) s = "0"; s += v; final int len = s.length(); for (int i = 0; i < len - 1; i += 2) { char c1 = s.charAt(i); char c2 = s.charAt(i + 1); write_octet((byte) ((c1 - '0') << 4 | (c2 - '0'))); } } public void write_value(java.io.Serializable value) { valueWriter().writeValue(value, null); } public void write_value(java.io.Serializable value, java.lang.String rep_id) { valueWriter().writeValue(value, rep_id); } public void write_value(java.io.Serializable value, Class clz) { valueWriter().writeValue(value, null); } public void write_value(java.io.Serializable value, org.omg.CORBA.portable.BoxedValueHelper helper) { valueWriter().writeValueBox(value, null, helper); } public void write_abstract_interface(java.lang.Object obj) { valueWriter().writeAbstractInterface(obj); } // ------------------------------------------------------------------ // Additional Yoko specific functions // ------------------------------------------------------------------ public void write_value(java.io.Serializable value, org.omg.CORBA.TypeCode tc, org.omg.CORBA.portable.BoxedValueHelper helper) { valueWriter().writeValueBox(value, tc, helper); } public void write_InputStream(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.TypeCode tc) { InputStream obin = null; try { obin = (InputStream) in; } catch (ClassCastException ex) { // InputStream may have been created by a different ORB } try { LOGGER.fine("writing a value of type " + tc.kind().value()); switch (tc.kind().value()) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: break; case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_ushort: write_short(in.read_short()); break; case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_float: case org.omg.CORBA.TCKind._tk_enum: write_long(in.read_long()); break; case org.omg.CORBA.TCKind._tk_double: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: write_longlong(in.read_longlong()); break; case org.omg.CORBA.TCKind._tk_boolean: case org.omg.CORBA.TCKind._tk_octet: write_octet(in.read_octet()); break; case org.omg.CORBA.TCKind._tk_char: write_char(in.read_char()); break; case org.omg.CORBA.TCKind._tk_wchar: write_wchar(in.read_wchar()); break; case org.omg.CORBA.TCKind._tk_fixed: write_fixed(in.read_fixed()); break; case org.omg.CORBA.TCKind._tk_any: { // Don't do this: write_any(in.read_any()) // This is faster: org.omg.CORBA.TypeCode p = in.read_TypeCode(); write_TypeCode(p); write_InputStream(in, p); break; } case org.omg.CORBA.TCKind._tk_TypeCode: { // Don't do this: write_TypeCode(in.read_TypeCode()) // This is faster: int kind = in.read_ulong(); // // An indirection is not permitted at this level // if (kind == -1) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadInvTypeCodeIndirection), org.apache.yoko.orb.OB.MinorCodes.MinorReadInvTypeCodeIndirection, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } write_ulong(kind); switch (kind) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_ushort: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_float: case org.omg.CORBA.TCKind._tk_double: case org.omg.CORBA.TCKind._tk_boolean: case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_octet: case org.omg.CORBA.TCKind._tk_any: case org.omg.CORBA.TCKind._tk_TypeCode: case org.omg.CORBA.TCKind._tk_Principal: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_longdouble: case org.omg.CORBA.TCKind._tk_wchar: break; case org.omg.CORBA.TCKind._tk_fixed: write_ushort(in.read_ushort()); write_short(in.read_short()); break; case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_union: case org.omg.CORBA.TCKind._tk_enum: case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: case org.omg.CORBA.TCKind._tk_alias: case org.omg.CORBA.TCKind._tk_except: case org.omg.CORBA.TCKind._tk_value: case org.omg.CORBA.TCKind._tk_value_box: case org.omg.CORBA.TCKind._tk_abstract_interface: case org.omg.CORBA.TCKind._tk_native: case org.omg.CORBA_2_4.TCKind._tk_local_interface: { final int len = in.read_ulong(); write_ulong(len); addCapacity(len); in.read_octet_array(buf_.data_, buf_.pos_, len); buf_.pos_ += len; break; } case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: { int bound = in.read_ulong(); write_ulong(bound); break; } default: throw new InternalError(); } break; } case org.omg.CORBA.TCKind._tk_Principal: write_Principal(in.read_Principal()); break; case org.omg.CORBA.TCKind._tk_objref: { // Don't do this: write_Object(in.read_Object()) // This is faster: org.omg.IOP.IOR ior = org.omg.IOP.IORHelper.read(in); org.omg.IOP.IORHelper.write(this, ior); break; } case org.omg.CORBA.TCKind._tk_struct: for (int i = 0; i < tc.member_count(); i++) write_InputStream(in, tc.member_type(i)); break; case org.omg.CORBA.TCKind._tk_except: write_string(in.read_string()); for (int i = 0; i < tc.member_count(); i++) write_InputStream(in, tc.member_type(i)); break; case org.omg.CORBA.TCKind._tk_union: { int defaultIndex = tc.default_index(); int memberIndex = -1; org.omg.CORBA.TypeCode origDiscType = TypeCode ._OB_getOrigType(tc.discriminator_type()); switch (origDiscType.kind().value()) { case org.omg.CORBA.TCKind._tk_short: { short val = in.read_short(); write_short(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).extract_short()) { memberIndex = i; break; } } break; } case org.omg.CORBA.TCKind._tk_ushort: { short val = in.read_ushort(); write_ushort(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).extract_ushort()) { memberIndex = i; break; } } break; } case org.omg.CORBA.TCKind._tk_long: { int val = in.read_long(); write_long(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).extract_long()) { memberIndex = i; break; } } break; } case org.omg.CORBA.TCKind._tk_ulong: { int val = in.read_ulong(); write_ulong(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).extract_ulong()) { memberIndex = i; break; } } break; } case org.omg.CORBA.TCKind._tk_longlong: { long val = in.read_longlong(); write_longlong(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).extract_longlong()) { memberIndex = i; break; } } break; } case org.omg.CORBA.TCKind._tk_ulonglong: { long val = in.read_ulonglong(); write_ulonglong(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).extract_ulonglong()) { memberIndex = i; break; } } break; } case org.omg.CORBA.TCKind._tk_char: { char val = in.read_char(); write_char(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).extract_char()) { memberIndex = i; break; } } break; } case org.omg.CORBA.TCKind._tk_boolean: { boolean val = in.read_boolean(); write_boolean(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).extract_boolean()) { memberIndex = i; break; } } break; } case org.omg.CORBA.TCKind._tk_enum: { int val = in.read_long(); write_long(val); for (int i = 0; i < tc.member_count(); i++) if (i != defaultIndex) { if (val == tc.member_label(i).create_input_stream() .read_long()) { memberIndex = i; break; } } break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Invalid typecode in tk_union"); } if (memberIndex >= 0) write_InputStream(in, tc.member_type(memberIndex)); else if (defaultIndex >= 0) write_InputStream(in, tc.member_type(defaultIndex)); break; } case org.omg.CORBA.TCKind._tk_string: write_string(in.read_string()); break; case org.omg.CORBA.TCKind._tk_wstring: write_wstring(in.read_wstring()); break; case org.omg.CORBA.TCKind._tk_sequence: case org.omg.CORBA.TCKind._tk_array: { int len; if (tc.kind().value() == org.omg.CORBA.TCKind._tk_sequence) { len = in.read_ulong(); write_ulong(len); } else len = tc.length(); if (len > 0) { org.omg.CORBA.TypeCode origContentType = TypeCode ._OB_getOrigType(tc.content_type()); switch (origContentType.kind().value()) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: break; case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_ushort: { if (obin == null || obin.swap_) { short[] s = new short[len]; in.read_short_array(s, 0, len); write_short_array(s, 0, len); } else { // Read one value for the alignment write_short(obin.read_short()); final int n = 2 * (len - 1); if (n > 0) { // Copy the rest addCapacity(n); org.apache.yoko.orb.OCI.Buffer buf = obin ._OB_buffer(); System.arraycopy(buf.data_, buf.pos_, buf_.data_, buf_.pos_, n); buf.pos_ += n; buf_.pos_ += n; } } break; } case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_ulong: case org.omg.CORBA.TCKind._tk_float: { if (obin == null || obin.swap_) { int[] i = new int[len]; in.read_long_array(i, 0, len); write_long_array(i, 0, len); } else { // Read one value for the alignment write_long(obin.read_long()); final int n = 4 * (len - 1); if (n > 0) { // Copy the rest addCapacity(n); org.apache.yoko.orb.OCI.Buffer buf = obin ._OB_buffer(); System.arraycopy(buf.data_, buf.pos_, buf_.data_, buf_.pos_, n); buf.pos_ += n; buf_.pos_ += n; } } break; } case org.omg.CORBA.TCKind._tk_double: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: { if (obin == null || obin.swap_) { long[] l = new long[len]; in.read_longlong_array(l, 0, len); write_longlong_array(l, 0, len); } else { // Read one value for the alignment write_longlong(obin.read_longlong()); final int n = 8 * (len - 1); if (n > 0) { // Copy the rest addCapacity(n); org.apache.yoko.orb.OCI.Buffer buf = obin ._OB_buffer(); System.arraycopy(buf.data_, buf.pos_, buf_.data_, buf_.pos_, n); buf.pos_ += n; buf_.pos_ += n; } } break; } case org.omg.CORBA.TCKind._tk_boolean: case org.omg.CORBA.TCKind._tk_octet: if (obin == null) { addCapacity(len); in.read_octet_array(buf_.data_, buf_.pos_, len); buf_.pos_ += len; } else { addCapacity(len); org.apache.yoko.orb.OCI.Buffer buf = obin ._OB_buffer(); System.arraycopy(buf.data_, buf.pos_, buf_.data_, buf_.pos_, len); buf.pos_ += len; buf_.pos_ += len; } break; case org.omg.CORBA.TCKind._tk_char: if (charWriterRequired_ || charConversionRequired_) { char[] ch = new char[len]; in.read_char_array(ch, 0, len); write_char_array(ch, 0, len); } else { addCapacity(len); in.read_octet_array(buf_.data_, buf_.pos_, len); buf_.pos_ += len; } break; case org.omg.CORBA.TCKind._tk_wchar: { char[] wch = new char[len]; in.read_wchar_array(wch, 0, len); write_wchar_array(wch, 0, len); break; } case org.omg.CORBA.TCKind._tk_alias: org.apache.yoko.orb.OB.Assert._OB_assert("tk_alias not supported in tk_array or tk_sequence"); break; default: for (int i = 0; i < len; i++) write_InputStream(in, tc.content_type()); break; } } break; } case org.omg.CORBA.TCKind._tk_alias: write_InputStream(in, tc.content_type()); break; case org.omg.CORBA.TCKind._tk_value: case org.omg.CORBA.TCKind._tk_value_box: if (obin == null) { org.omg.CORBA_2_3.portable.InputStream i = (org.omg.CORBA_2_3.portable.InputStream) in; write_value(i.read_value()); } else obin._OB_remarshalValue(tc, this); break; case org.omg.CORBA.TCKind._tk_abstract_interface: { boolean b = in.read_boolean(); write_boolean(b); if (b) { write_Object(in.read_Object()); } else { if (obin == null) { org.omg.CORBA_2_3.portable.InputStream i = (org.omg.CORBA_2_3.portable.InputStream) in; write_value(i.read_value()); } else { // // We have no TypeCode information about the // valuetype, so we must use _tc_ValueBase and // rely on the type information sent on the wire // obin._OB_remarshalValue(org.omg.CORBA.ValueBaseHelper .type(), this); } } break; } case org.omg.CORBA_2_4.TCKind._tk_local_interface: case org.omg.CORBA.TCKind._tk_native: default: org.apache.yoko.orb.OB.Assert._OB_assert("unsupported types"); } } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.TypeCodePackage.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public OutputStream(org.apache.yoko.orb.OCI.Buffer buf) { this(buf, null, null); } public OutputStream(org.apache.yoko.orb.OCI.Buffer buf, org.apache.yoko.orb.OB.CodeConverters converters, GiopVersion giopVersion) { buf_ = buf; if (giopVersion != null) giopVersion_ = giopVersion; charWriterRequired_ = false; charConversionRequired_ = false; wCharWriterRequired_ = false; wCharConversionRequired_ = false; codeConverters_ = new org.apache.yoko.orb.OB.CodeConverters(converters); if (converters != null) { if (codeConverters_.outputCharConverter != null) { charWriterRequired_ = codeConverters_.outputCharConverter .writerRequired(); charConversionRequired_ = codeConverters_.outputCharConverter .conversionRequired(); } if (codeConverters_.outputWcharConverter != null) { wCharWriterRequired_ = codeConverters_.outputWcharConverter .writerRequired(); wCharConversionRequired_ = codeConverters_.outputWcharConverter .conversionRequired(); } } } public org.apache.yoko.orb.OCI.Buffer _OB_buffer() { return buf_; } public int _OB_pos() { return buf_.pos_; } public void _OB_pos(int pos) { buf_.pos_ = pos; } public void _OB_align(int n) { if (buf_.pos_ % n != 0) addCapacity(0, n); } public void _OB_alignNext(int n) { alignNext_ = n; } public void _OB_writeEndian() { write_boolean(false); // false means big endian } public void _OB_beginValue(int tag, String[] ids, boolean chunked) { valueWriter().beginValue(tag, ids, null, chunked); } public void _OB_endValue() { valueWriter().endValue(); } // Java only public void _OB_ORBInstance(org.apache.yoko.orb.OB.ORBInstance orbInstance) { orbInstance_ = orbInstance; } // Java only public org.apache.yoko.orb.OB.ORBInstance _OB_ORBInstance() { return orbInstance_; } // Java only public void _OB_invocationContext(java.lang.Object invocationContext) { invocationContext_ = invocationContext; } // Java only public java.lang.Object _OB_invocationContext() { return invocationContext_; } // Java only public void _OB_delegateContext(java.lang.Object delegateContext) { delegateContext_ = delegateContext; } // Java only public java.lang.Object _OB_delegateContext() { return delegateContext_; } @Override public void end_value() { _OB_endValue(); } @Override public void start_value(String rep_id) { final int tag = 0x7fffff02; final String[] ids = { rep_id }; _OB_beginValue(tag, ids, true); } }
6,755
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/NotImplementedError.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class NotImplementedError extends Error { public NotImplementedError() { super("Not implemented yet"); } }
6,756
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ORB.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; // This class must be public public final class ORB extends org.apache.yoko.orb.OBCORBA.ORB_impl { // // This class exists solely for backward-compatibility and ease-of-use // }
6,757
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/Delegate.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; import java.util.logging.Level; import java.util.logging.Logger; import org.omg.CORBA.INV_POLICY; import org.omg.CORBA.LocalObject; // // Delegate is equivalent to OBCORBA::Object in C++ // public final class Delegate extends org.omg.CORBA_2_4.portable.Delegate { static final Logger logger = Logger.getLogger(Delegate.class.getName()); // // The ORBInstance object // private org.apache.yoko.orb.OB.ORBInstance orbInstance_; // // The IOR and the original IOR // private org.omg.IOP.IOR IOR_; private org.omg.IOP.IOR origIOR_; // // The list of policies // private org.apache.yoko.orb.OB.RefCountPolicyList policies_; // // The DowncallStub // private org.apache.yoko.orb.OB.DowncallStub downcallStub_; // // The servant for use in collocated invocations (Java only) // private org.apache.yoko.orb.OBPortableServer.DirectServant directServant_; private java.lang.Object directServantMutex_ = new java.lang.Object(); // // If false, the object is "remote", in the sense that its request // must be marshalled. If true, we need to check if the object // is local. // private boolean checkLocal_ = true; // // Thread-specific storage for tracking retries by portable stubs // private java.util.Hashtable retryTSS_; // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ // // Get (and remove) retry information for current thread from TSS // private synchronized RetryInfo getRetry() { if (retryTSS_ != null) { Thread t = Thread.currentThread(); RetryInfo info = (RetryInfo) retryTSS_.remove(t); if (info != null) { return info; } } return new RetryInfo(); } // // Set retry information for current thread in TSS // private synchronized void setRetry(RetryInfo info) { if (retryTSS_ == null) { retryTSS_ = new java.util.Hashtable(7); } Thread t = Thread.currentThread(); retryTSS_.put(t, info); } // // Check whether it's safe to retry // private synchronized void checkRetry(int retry, org.omg.CORBA.SystemException ex, boolean remote) { // // We remove the downcall stub, whether we retry or not // downcallStub_ = null; // // Reset to the original IOR // IOR_ = origIOR_; // // Reset cached state // directServant_ = null; checkLocal_ = true; // // Get the core trace levels // org.apache.yoko.orb.OB.CoreTraceLevels coreTraceLevels = orbInstance_ .getCoreTraceLevels(); // // We only retry upon COMM_FAILURE, TRANSIENT, and NO_RESPONSE // try { throw ex; } catch (org.omg.CORBA.COMM_FAILURE e) { } catch (org.omg.CORBA.TRANSIENT e) { } catch (org.omg.CORBA.NO_RESPONSE e) { } catch (org.omg.CORBA.SystemException e) { logger.log(java.util.logging.Level.FINE, "System exception during operation", ex); if (coreTraceLevels.traceRetry() > 0) { String msg = "retry only upon COMM_FAILURE, TRANSIENT " + "and NO_RESPONSE exceptions"; String exMsg = ex.getMessage(); if (exMsg != null) { msg += "\n" + exMsg; } logger.fine("retry: " + msg); } throw ex; } // // TODO: Check the Rebind Policy - raise REBIND if the policy // is set to NO_RECONNECT, but only if this object reference // was previously bound // // if(policies_.rebindMode == org.omg.Messaging.NO_RECONNECT.value && // !ignoreRebind) // { // if(coreTraceLevels.traceRetry() > 0) // { // String msg = "can't try again because NO_RECONNECT is set"; // String exMsg = ex.getMessage(); // if(exMsg != null) // msg += "\n" + exMsg; // Logger logger = orbInstance_.getLogger(); // logger.trace("retry", msg); // } // throw new org.omg.CORBA.REBIND(); // } // // Check policy to see if we should retry on remote exceptions // if (!policies_.retry.remote && remote) { if (coreTraceLevels.traceRetry() > 0) { String msg = "retry only upon locally raised exceptions\n"; String exMsg = ex.getMessage(); if (exMsg != null) { msg += "\n" + exMsg; } logger.fine("retry " + msg); } throw ex; } // // Only try maximum number of times. Zero indicates infinite retry. // if (policies_.retry.max != 0 && retry > policies_.retry.max) { if (coreTraceLevels.traceRetry() > 0) { String msg = "can't try again, because I " + "tried maximum times already"; String exMsg = ex.getMessage(); if (exMsg != null) { msg += "\n" + exMsg; } logger.fine("retry " + msg); } throw ex; } // // We can't retry if RETRY_NEVER is set // if (policies_.retry.mode == org.apache.yoko.orb.OB.RETRY_NEVER.value) { if (coreTraceLevels.traceRetry() > 0) { String msg = "can't try again because the " + "RETRY_NEVER policy is set"; String exMsg = ex.getMessage(); if (exMsg != null) { msg += "\n" + exMsg; } logger.fine("retry " + msg); } throw ex; } // // We can't retry if RETRY_STRICT is set and the completion // status is not COMPLETED_NO // if (policies_.retry.mode == org.apache.yoko.orb.OB.RETRY_STRICT.value && ex.completed != org.omg.CORBA.CompletionStatus.COMPLETED_NO) { if (coreTraceLevels.traceRetry() > 0) { String msg = "can't try again, because the " + "RETRY_STRICT policy is set\n" + "and completion status is not " + "COMPLETED_NO"; String exMsg = ex.getMessage(); if (exMsg != null) { msg += "\n" + exMsg; } logger.fine("retry " + msg); } throw ex; } // // If a retry interval has been set then wait the specified // amount of time // if (policies_.retry.interval != 0) { if (coreTraceLevels.traceRetry() > 0) { String msg = "next attempt in " + policies_.retry.interval + " milliseconds"; logger.fine("retry " + msg); } try { Thread.sleep(policies_.retry.interval); } catch (java.lang.InterruptedException e) { } } } protected void finalize() throws Throwable { // // DirectServant must be explicitly destroyed in order to // make it eligible for garbage collection // if (directServant_ != null) { directServant_.destroy(); } super.finalize(); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ /** * @deprecated Deprecated by CORBA 2.3. */ public org.omg.CORBA.InterfaceDef get_interface(org.omg.CORBA.Object self) { while (true) { if (!is_local(self)) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = request(self, "_interface", true); in = invoke(self, out); org.omg.CORBA.InterfaceDef def = org.omg.CORBA.InterfaceDefHelper.read(in); return def; } catch (org.omg.CORBA.portable.ApplicationException ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.portable.RemarshalException ex) { // do nothing - continue loop } finally { releaseReply(self, in); } } else { org.omg.CORBA.portable.ServantObject so = servant_preinvoke( self, "_interface", null); if (so == null) continue; try { org.omg.PortableServer.Servant servant = (org.omg.PortableServer.Servant) so.servant; return servant._get_interface(); } finally { servant_postinvoke(self, so); } } } } public org.omg.CORBA.Object get_interface_def(org.omg.CORBA.Object self) { return get_interface(self); } public org.omg.CORBA.Object duplicate(org.omg.CORBA.Object self) { return self; } public void release(org.omg.CORBA.Object self) { } public boolean is_a(org.omg.CORBA.Object self, String repository_id) { // // Check IDL:omg.org/CORBA/Object:1.0 // if (repository_id.equals("IDL:omg.org/CORBA/Object:1.0")) { return true; } // // Check all other ids // org.omg.CORBA.portable.ObjectImpl o = (org.omg.CORBA.portable.ObjectImpl) self; String[] ids = o._ids(); for (int i = 0; i < ids.length; i++) { if (repository_id.equals(ids[i])) { return true; } } // // Check the type_id in the IOR and the original IOR // synchronized (this) { if (repository_id.equals(IOR_.type_id) || repository_id.equals(origIOR_.type_id)) { return true; } } // // TODO: Some kind of is-a cache should be consulted here // // // Check implementation object // while (true) { if (!is_local(self)) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = request(self, "_is_a", true); out.write_string(repository_id); in = invoke(self, out); return in.read_boolean(); } catch (org.omg.CORBA.portable.ApplicationException ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.portable.RemarshalException ex) { // do nothing - continue loop } finally { releaseReply(self, in); } } else { org.omg.CORBA.portable.ServantObject so = servant_preinvoke( self, "_is_a", null); if (so == null) { continue; } try { org.omg.PortableServer.Servant servant = (org.omg.PortableServer.Servant) so.servant; return servant._is_a(repository_id); } finally { servant_postinvoke(self, so); } } } } public boolean non_existent(org.omg.CORBA.Object self) { while (true) { if (!is_local(self)) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = request(self, "_non_existent", true); in = invoke(self, out); return in.read_boolean(); } catch (org.omg.CORBA.portable.ApplicationException ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.portable.RemarshalException ex) { // do nothing - continue loop } finally { releaseReply(self, in); } } else { org.omg.CORBA.portable.ServantObject so = servant_preinvoke(self, "_non_existent", null); if (so == null) { continue; } try { org.omg.PortableServer.Servant servant = (org.omg.PortableServer.Servant) so.servant; return servant._non_existent(); } finally { servant_postinvoke(self, so); } } } } public boolean is_equivalent(org.omg.CORBA.Object self, org.omg.CORBA.Object rhs) { // // Check for nil reference // if (rhs == null) { return false; } // // Direct object reference comparison // if (self == rhs) { return true; } // // Locality-constrained objects are never equivalent if the // reference comparisons fail // if (self instanceof org.omg.CORBA.LocalObject || rhs instanceof org.omg.CORBA.LocalObject) { return false; } // // Direct delegate reference comparison // Delegate p = (Delegate) ((org.omg.CORBA.portable.ObjectImpl) rhs)._get_delegate(); if (p == this) { return true; } // // Ask the client manager // synchronized (this) { org.apache.yoko.orb.OB.ClientManager clientManager = orbInstance_.getClientManager(); return clientManager.equivalent(origIOR_, p._OB_origIOR()); } } public int hash(org.omg.CORBA.Object self, int maximum) { // // Ask the client manager // synchronized (this) { org.apache.yoko.orb.OB.ClientManager clientManager = orbInstance_.getClientManager(); return clientManager.hash(origIOR_, maximum); } } public org.omg.CORBA.Request create_request(org.omg.CORBA.Object self, org.omg.CORBA.Context ctx, String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result) { Request request = new Request(self, operation, arg_list, result); request.ctx(ctx); return request; } public org.omg.CORBA.Request create_request(org.omg.CORBA.Object self, org.omg.CORBA.Context ctx, String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result, org.omg.CORBA.ExceptionList excepts, org.omg.CORBA.ContextList contexts) { Request request = new Request(self, operation, arg_list, result, excepts, contexts); request.ctx(ctx); return request; } public org.omg.CORBA.Request request(org.omg.CORBA.Object self, String operation) { return new Request(self, operation); } public org.omg.CORBA.portable.OutputStream request( org.omg.CORBA.Object self, String operation, boolean responseExpected) { // // Here's how retry works with portable stubs: // // 1) request() calls getRetry(), which removes any existing // entry from TSS or returns a new RetryInfo if none was found // // 2) request() loops until a request can be setup by the // DowncallStub (i.e., a connection is successfully // established). There is no need to update TSS in this // loop. // // 3) Upon success, the current RetryInfo is stored by the // OutputStream. The invoke() method will retrieve this // from the stream. We don't want to use TSS between // retry() and invoke(), since a marshalling exception // could occur in the stub and potentially cause a leak. // // Continued in invoke()... // RetryInfo info = getRetry(); while (true) { try { org.apache.yoko.orb.OB.DowncallStub downcallStub = _OB_getDowncallStub(self); org.apache.yoko.orb.CORBA.OutputStream out = downcallStub .setupRequest(self, operation, responseExpected); out._OB_delegateContext(info); return out; } catch (Exception ex) { _OB_handleException(self, ex, info, false, false); } } } public org.omg.CORBA.portable.InputStream invoke(org.omg.CORBA.Object self, org.omg.CORBA.portable.OutputStream out) throws org.omg.CORBA.portable.ApplicationException, org.omg.CORBA.portable.RemarshalException { // // Continuing the discussion of retry from request() above... // // 4) invoke() retrieves the current RetryInfo from the // OutputStream. At this point, there should be no // entry in TSS for this thread. // // 5) If a retry is necessary, we must set the current // RetryInfo in TSS so that the next call to request() // can retrieve it. // org.apache.yoko.orb.CORBA.OutputStream obout = (org.apache.yoko.orb.CORBA.OutputStream) out; RetryInfo info = (RetryInfo) obout._OB_delegateContext(); try { org.apache.yoko.orb.OB.DowncallStub downcallStub = _OB_getDowncallStub(self); org.omg.CORBA.portable.InputStream in = downcallStub.invoke(self, obout); return in; } catch (org.omg.CORBA.portable.ApplicationException ex) { logger.log(java.util.logging.Level.FINE, "Received ApplicationException for request", ex); throw ex; } catch (org.omg.CORBA.portable.RemarshalException ex) { // fall through } catch (Exception ex) { logger.log(java.util.logging.Level.FINE, "Received unexpected exception for request", ex); _OB_handleException(self, ex, info, false, true); } // // If we reach this point, then we need to reinvoke // throw new org.omg.CORBA.portable.RemarshalException(); } public void releaseReply(org.omg.CORBA.Object self, org.omg.CORBA.portable.InputStream in) { } public org.omg.CORBA.Policy get_policy(org.omg.CORBA.Object self, int policy_type) { org.omg.CORBA.Policy policy = _OB_getPolicy(policy_type); if (policy == null) { throw new org.omg.CORBA.INV_POLICY( org.apache.yoko.orb.OB.MinorCodes .describeInvPolicy(org.apache.yoko.orb.OB.MinorCodes.MinorNoPolicy), org.apache.yoko.orb.OB.MinorCodes.MinorNoPolicy, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return policy; } public org.omg.CORBA.DomainManager[] get_domain_managers( org.omg.CORBA.Object self) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Object set_policy_override(org.omg.CORBA.Object self, org.omg.CORBA.Policy[] np, org.omg.CORBA.SetOverrideType set_add) { // // Check for duplicate policy type // if (np.length > 1) { for (int i = 0; i < np.length - 1; i++) { for (int j = i + 1; j < np.length; j++) { if (np[i].policy_type() == np[j].policy_type()) { throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorDuplicatePolicyType), org.apache.yoko.orb.OB.MinorCodes.MinorDuplicatePolicyType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } } } } // // Create the new policy list // org.omg.CORBA.Policy[] newPolicies; if (set_add == org.omg.CORBA.SetOverrideType.SET_OVERRIDE) { newPolicies = new org.omg.CORBA.Policy[np.length]; System.arraycopy(np, 0, newPolicies, 0, np.length); } else // ADD_OVERRIDE { java.util.Vector v = new java.util.Vector(); for (int i = 0; i < policies_.value.length; i++) { v.addElement(policies_.value[i]); } for (int i = 0; i < np.length; i++) { int len = v.size(); int j; for (j = 0; j < len; j++) { org.omg.CORBA.Policy policy = (org.omg.CORBA.Policy) v.elementAt(j); if (policy.policy_type() == np[i].policy_type()) { break; } } if (j < len) { v.setElementAt(np[i], j); } else { v.addElement(np[i]); } } newPolicies = new org.omg.CORBA.Policy[v.size()]; v.copyInto(newPolicies); } // // Create and initialize a new delegate // org.apache.yoko.orb.OB.RefCountPolicyList policyList = new org.apache.yoko.orb.OB.RefCountPolicyList( newPolicies); Delegate p = new Delegate(orbInstance_, IOR_, origIOR_, policyList); // // Create new object, set the delegate and return // StubForObject obj = new StubForObject(); obj._set_delegate(p); return obj; } public org.omg.CORBA.ORB orb(org.omg.CORBA.Object self) { return orbInstance_.getORB(); } public boolean is_local(org.omg.CORBA.Object self) { if (checkLocal_) { synchronized (directServantMutex_) { if (directServant_ != null && !directServant_.deactivated()) { return true; } org.apache.yoko.orb.OBPortableServer.POAManagerFactory pmFactory = orbInstance_ .getPOAManagerFactory(); org.apache.yoko.orb.OBPortableServer.POAManagerFactory_impl factory = (org.apache.yoko.orb.OBPortableServer.POAManagerFactory_impl) pmFactory; while (true) { try { directServant_ = factory._OB_getDirectServant(IOR_, policies_); break; } catch (org.apache.yoko.orb.OB.LocationForward ex) { synchronized (this) { // // Change the IOR // IOR_ = ex.ior; if (ex.perm) { origIOR_ = ex.ior; } // // Clear the downcall stub // downcallStub_ = null; } } } // // If the servant is collocated, then we remove the entry // for this thread from the retry TSS // if (directServant_ != null) { // // We can only make collocated calls on a servant if // the servant class was loaded by the same class // loader (which may not be the case in application // servers, for example). The only solution is to // consider the servant to be "remote" and marshal // the request. // if (directServant_.servant.getClass().getClassLoader() == self .getClass().getClassLoader()) { getRetry(); if (!directServant_.locate_request()) { throw new org.omg.CORBA.OBJECT_NOT_EXIST(); } return true; } } // // Collocated invocations are not possible on this object // checkLocal_ = false; } } return false; } public org.omg.CORBA.portable.ServantObject servant_preinvoke( org.omg.CORBA.Object self, String operation, Class expectedType) { org.omg.CORBA.portable.ServantObject result = null; org.apache.yoko.orb.OBPortableServer.DirectServant ds = directServant_; if (ds != null) { if (!ds.deactivated()) { result = ds.preinvoke(operation); if (result != null && expectedType != null && !expectedType.isInstance(result.servant)) { throw new org.omg.CORBA.BAD_PARAM("Servant class " + result.servant.getClass().getName() + " does not match expected type " + expectedType.getName()); } } else { synchronized (directServantMutex_) { directServant_ = null; } } } return result; } public void servant_postinvoke(org.omg.CORBA.Object self, org.omg.CORBA.portable.ServantObject servant) { org.apache.yoko.orb.OBPortableServer.DirectServant directServant = (org.apache.yoko.orb.OBPortableServer.DirectServant) servant; directServant.postinvoke(); } public String get_codebase(org.omg.CORBA.Object self) { // TODO: implement return null; } // ------------------------------------------------------------------ // Operations from org.omg.CORBA_2_4.Delegate // ------------------------------------------------------------------ public org.omg.CORBA.Policy[] get_policy_overrides( org.omg.CORBA.Object self, int[] types) { // // If no types we supplied we need to return a list of // all policies. // if (types.length == 0) { org.omg.CORBA.Policy[] all = new org.omg.CORBA.Policy[policies_.value.length]; System.arraycopy(policies_.value, 0, all, 0, policies_.value.length); return all; } java.util.Vector policies = new java.util.Vector(); for (int i = 0; i < types.length; i++) { for (int j = 0; j < policies_.value.length; j++) { if (policies_.value[j].policy_type() == types[i]) { policies.addElement(policies_.value[j]); } } } org.omg.CORBA.Policy[] result = new org.omg.CORBA.Policy[policies.size()]; policies.copyInto(result); return result; } public org.omg.CORBA.Policy get_client_policy(org.omg.CORBA.Object self, int type) { // // TODO: Implement // return get_policy(self, type); } public boolean validate_connection(org.omg.CORBA.Object self, org.omg.CORBA.PolicyListHolder policies) { // // TODO: Validate the policies // RetryInfo info = new RetryInfo(); while (true) { try { org.apache.yoko.orb.OB.DowncallStub downcallStub = _OB_getDowncallStub(null); return downcallStub.locate_request(); } catch (Exception ex) { _OB_handleException(null, ex, info, true, false); } } } // ------------------------------------------------------------------ // Additional Yoko specific functions // ------------------------------------------------------------------ public org.apache.yoko.orb.OCI.ConnectorInfo get_oci_connector_info() { if (is_local(null)) return null; RetryInfo info = new RetryInfo(); while (true) { try { org.apache.yoko.orb.OB.DowncallStub downcallStub = _OB_getDowncallStub(null); return downcallStub.get_oci_connector_info(); } catch (Exception ex) { _OB_handleException(null, ex, info, false, false); } } } public org.apache.yoko.orb.OCI.TransportInfo get_oci_transport_info() { if (is_local(null)) { return null; } RetryInfo info = new RetryInfo(); while (true) { try { org.apache.yoko.orb.OB.DowncallStub downcallStub = _OB_getDowncallStub(null); return downcallStub.get_oci_transport_info(); } catch (Exception ex) { _OB_handleException(null, ex, info, false, false); } } } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public Delegate(org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.IOP.IOR ior, org.omg.IOP.IOR origIOR, org.apache.yoko.orb.OB.RefCountPolicyList policies) { // // Save the ORBInstance object // orbInstance_ = orbInstance; // // Save the IOR // IOR_ = ior; origIOR_ = origIOR; // // Save the policies // policies_ = policies; } public org.apache.yoko.orb.OB.ORBInstance _OB_ORBInstance() { return orbInstance_; } public synchronized org.omg.IOP.IOR _OB_IOR() { return IOR_; } public synchronized org.omg.IOP.IOR _OB_origIOR() { return origIOR_; } public synchronized void _OB_marshalOrigIOR( org.omg.CORBA.portable.OutputStream out) { org.omg.IOP.IORHelper.write(out, origIOR_); } public org.apache.yoko.orb.OB.RefCountPolicyList _OB_policies() { return policies_; } public org.omg.CORBA.Policy _OB_getPolicy(int policy_type) { for (int i = 0; i < policies_.value.length; i++) { if (policies_.value[i].policy_type() == policy_type) { return policies_.value[i]; } } return null; } void _OB_handleException(org.omg.CORBA.Object self, Exception ex, RetryInfo info, boolean ignoreRebind) { _OB_handleException(self, ex, info, ignoreRebind, false); } void _OB_handleException(org.omg.CORBA.Object self, Exception ex, RetryInfo info, boolean ignoreRebind, boolean useTSS) { try { throw ex; } catch (org.apache.yoko.orb.OB.LocationForward e) { synchronized (this) { org.apache.yoko.orb.OB.CoreTraceLevels coreTraceLevels = orbInstance_ .getCoreTraceLevels(); // // Check the Rebind Policy // // TODO: NO_REBIND should raise exception as well if // LocationForward changes client effective QoS policies // if (policies_.rebindMode == org.omg.Messaging.NO_RECONNECT.value && !ignoreRebind) { if (coreTraceLevels.traceRetry() > 0) { logger.fine("retry: can't try again, because " + "NO_RECONNECT prevents a transparent " + "location forward"); } throw new org.omg.CORBA.REBIND(); } // // Check for a potential infinite forwarding loop. // The maximum is currently hard-coded to 10. If // this is changed, also change the exception // description for the minor code. // info.hop++; if (info.hop > 10) { if (coreTraceLevels.traceRetry() > 0) { logger.fine("retry: location forward hop count exceeded"); } throw new org.omg.CORBA.TRANSIENT( org.apache.yoko.orb.OB.MinorCodes .describeTransient(org.apache.yoko.orb.OB.MinorCodes.MinorLocationForwardHopCountExceeded), org.apache.yoko.orb.OB.MinorCodes.MinorLocationForwardHopCountExceeded, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } // // // Change the IOR // IOR_ = e.ior; if (e.perm) { origIOR_ = e.ior; } // // We need to reget the downcall stub // downcallStub_ = null; // // The object may have changed from remote to local // checkLocal_ = true; if (coreTraceLevels.traceRetry() > 0) { logger.fine("retry: trying again because of location forward"); } } if (useTSS) { setRetry(info); } } catch (org.apache.yoko.orb.OB.FailureException e) { info.retry++; // // If it's not safe to retry, throw the exception // checkRetry(info.retry, e.exception, false); org.apache.yoko.orb.OB.CoreTraceLevels coreTraceLevels = orbInstance_ .getCoreTraceLevels(); if (coreTraceLevels.traceRetry() > 0) { String msg = "trying again (" + info.retry + ") because of failure"; String exMsg = e.exception.getMessage(); if (exMsg != null) { msg += "\n" + exMsg; } logger.fine("retry: " + msg); } if (useTSS) { setRetry(info); } } catch (org.omg.CORBA.TRANSIENT e) { info.retry++; // // If it's not safe to retry, throw the exception // checkRetry(info.retry, e, true); org.apache.yoko.orb.OB.CoreTraceLevels coreTraceLevels = orbInstance_ .getCoreTraceLevels(); if (coreTraceLevels.traceRetry() > 0) { String msg = "trying again (" + info.retry + ") because server sent a TRANSIENT " + "exception"; String exMsg = e.getMessage(); if (exMsg != null) { msg += "\n" + exMsg; } logger.fine("retry: " + msg); } if (useTSS) { setRetry(info); } } catch (org.omg.CORBA.SystemException e) { logger.log(java.util.logging.Level.FINE, "Received SystemException", e); throw e; } catch (org.omg.CORBA.UserException e) { org.apache.yoko.orb.OB.Assert._OB_assert(e); // should never // happen } catch (java.lang.RuntimeException e) { logger.log(java.util.logging.Level.FINE, "Received RuntimeException", e); throw e; } catch (java.lang.Exception e) { org.apache.yoko.orb.OB.Assert._OB_assert(e); // should never // happen } } public synchronized org.apache.yoko.orb.OB.DowncallStub _OB_getDowncallStub( org.omg.CORBA.Object self) throws org.apache.yoko.orb.OB.LocationForward, org.apache.yoko.orb.OB.FailureException { if (downcallStub_ == null) { downcallStub_ = new org.apache.yoko.orb.OB.DowncallStub(orbInstance_, IOR_, origIOR_, policies_); if (!downcallStub_.locate_request()) { throw new org.omg.CORBA.OBJECT_NOT_EXIST(); } } return downcallStub_; } }
6,758
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/StubForObject.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class StubForObject extends org.omg.CORBA_2_4.portable.ObjectImpl implements org.omg.CORBA.portable.IDLEntity { // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String[] _ids() { return new String[0]; } }
6,759
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/RetryInfo.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; // // RetryInfo holds counters which track the number of // retries and location forward replies // public class RetryInfo { int retry; // retry count int hop; // forward hop count }
6,760
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/StubForRemote.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; import java.rmi.Remote; public class StubForRemote extends javax.rmi.CORBA.Stub implements Remote { public String[] _ids() { return new String[0]; } }
6,761
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ORBPolicyFactory_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class ORBPolicyFactory_impl extends org.omg.CORBA.LocalObject implements org.omg.PortableInterceptor.PolicyFactory { // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any any) throws org.omg.CORBA.PolicyError { try { switch (type) { case org.apache.yoko.orb.OB.CONNECTION_REUSE_POLICY_ID.value: { boolean b = any.extract_boolean(); return new org.apache.yoko.orb.OB.ConnectionReusePolicy_impl(b); } case org.apache.yoko.orb.OB.ZERO_PORT_POLICY_ID.value: { boolean b = any.extract_boolean(); return new org.apache.yoko.orb.OB.ZeroPortPolicy_impl(b); } case org.apache.yoko.orb.OB.PROTOCOL_POLICY_ID.value: { String[] seq = org.apache.yoko.orb.OCI.PluginIdSeqHelper .extract(any); return new org.apache.yoko.orb.OB.ProtocolPolicy_impl(seq); } case org.apache.yoko.orb.OB.RETRY_POLICY_ID.value: { try { short v = any.extract_short(); if (v > org.apache.yoko.orb.OB.RETRY_ALWAYS.value) throw new org.omg.CORBA.PolicyError( org.omg.CORBA.BAD_POLICY_VALUE.value); return new org.apache.yoko.orb.OB.RetryPolicy_impl(v, 0, 1, false); } catch (org.omg.CORBA.BAD_OPERATION ex) { } org.apache.yoko.orb.OB.RetryAttributes attr = org.apache.yoko.orb.OB.RetryAttributesHelper .extract(any); return new org.apache.yoko.orb.OB.RetryPolicy_impl(attr.mode, attr.interval, attr.max, attr.remote); } case org.apache.yoko.orb.OB.TIMEOUT_POLICY_ID.value: { int t = any.extract_ulong(); return new org.apache.yoko.orb.OB.TimeoutPolicy_impl(t); } case org.apache.yoko.orb.OB.LOCATION_TRANSPARENCY_POLICY_ID.value: { short v = any.extract_short(); return new org.apache.yoko.orb.OB.LocationTransparencyPolicy_impl( v); } case org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE.value: { org.omg.TimeBase.UtcT v = org.omg.TimeBase.UtcTHelper .extract(any); return new org.apache.yoko.orb.Messaging.RequestStartTimePolicy_impl( v); } case org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE.value: { org.omg.TimeBase.UtcT v = org.omg.TimeBase.UtcTHelper .extract(any); return new org.apache.yoko.orb.Messaging.RequestEndTimePolicy_impl( v); } case org.omg.Messaging.REPLY_START_TIME_POLICY_TYPE.value: { org.omg.TimeBase.UtcT v = org.omg.TimeBase.UtcTHelper .extract(any); return new org.apache.yoko.orb.Messaging.ReplyStartTimePolicy_impl( v); } case org.omg.Messaging.REPLY_END_TIME_POLICY_TYPE.value: { org.omg.TimeBase.UtcT v = org.omg.TimeBase.UtcTHelper .extract(any); return new org.apache.yoko.orb.Messaging.ReplyEndTimePolicy_impl( v); } case org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value: { long v = any.extract_long(); return new org.apache.yoko.orb.Messaging.RelativeRequestTimeoutPolicy_impl( v); } case org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE.value: { long v = any.extract_long(); return new org.apache.yoko.orb.Messaging.RelativeRoundtripTimeoutPolicy_impl( v); } case org.omg.Messaging.REBIND_POLICY_TYPE.value: { short v = any.extract_short(); return new org.apache.yoko.orb.Messaging.RebindPolicy_impl(v); } case org.omg.Messaging.SYNC_SCOPE_POLICY_TYPE.value: { short v = any.extract_short(); return new org.apache.yoko.orb.Messaging.SyncScopePolicy_impl(v); } case org.apache.yoko.orb.OB.INTERCEPTOR_POLICY_ID.value: { boolean v = any.extract_boolean(); return new org.apache.yoko.orb.OB.InterceptorPolicy_impl(v); } case org.apache.yoko.orb.OB.CONNECT_TIMEOUT_POLICY_ID.value: { int t = any.extract_ulong(); return new org.apache.yoko.orb.OB.ConnectTimeoutPolicy_impl(t); } case org.apache.yoko.orb.OB.REQUEST_TIMEOUT_POLICY_ID.value: { int t = any.extract_ulong(); return new org.apache.yoko.orb.OB.RequestTimeoutPolicy_impl(t); } case org.apache.yoko.orb.OB.LOCATE_REQUEST_POLICY_ID.value: { boolean b = any.extract_boolean(); return new org.apache.yoko.orb.OB.LocateRequestPolicy_impl(b); } case org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE.value: { short v = org.omg.BiDirPolicy.BidirectionalPolicyValueHelper .extract(any); return new org.apache.yoko.orb.BiDirPolicy.BidirectionalPolicy_impl( v); } case org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE.value: { org.omg.Messaging.PriorityRange v = org.omg.Messaging.PriorityRangeHelper .extract(any); if (v.min > v.max) throw new org.omg.CORBA.PolicyError( org.omg.CORBA.BAD_POLICY_VALUE.value); return new org.apache.yoko.orb.Messaging.RequestPriorityPolicy_impl( v); } case org.omg.Messaging.REPLY_PRIORITY_POLICY_TYPE.value: { org.omg.Messaging.PriorityRange v = org.omg.Messaging.PriorityRangeHelper .extract(any); if (v.min > v.max) throw new org.omg.CORBA.PolicyError( org.omg.CORBA.BAD_POLICY_VALUE.value); return new org.apache.yoko.orb.Messaging.ReplyPriorityPolicy_impl( v); } case org.omg.Messaging.ROUTING_POLICY_TYPE.value: { org.omg.Messaging.RoutingTypeRange v = org.omg.Messaging.RoutingTypeRangeHelper .extract(any); if (v.min > v.max) throw new org.omg.CORBA.PolicyError( org.omg.CORBA.BAD_POLICY_VALUE.value); return new org.apache.yoko.orb.Messaging.RoutingPolicy_impl(v); } case org.omg.Messaging.MAX_HOPS_POLICY_TYPE.value: { short v = any.extract_ushort(); return new org.apache.yoko.orb.Messaging.MaxHopsPolicy_impl(v); } case org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE.value: { short v = org.omg.Messaging.OrderingHelper.extract(any); if (v < org.omg.Messaging.ORDER_ANY.value || v > org.omg.Messaging.ORDER_DEADLINE.value) throw new org.omg.CORBA.PolicyError( org.omg.CORBA.BAD_POLICY_VALUE.value); return new org.apache.yoko.orb.Messaging.QueueOrderPolicy_impl( v); } } // end of switch } catch (org.omg.CORBA.BAD_OPERATION ex) { // // Any extraction failure // throw new org.omg.CORBA.PolicyError( org.omg.CORBA.BAD_POLICY_TYPE.value); } throw new org.omg.CORBA.PolicyError(org.omg.CORBA.BAD_POLICY.value); } }
6,762
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ORBSingleton.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; // This class must be public public class ORBSingleton extends org.apache.yoko.orb.OBCORBA.ORBSingleton_impl { // // This class exists solely for backward-compatibility and ease-of-use // }
6,763
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/ContextList.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; final public class ContextList extends org.omg.CORBA.ContextList { private java.util.Vector stringVec_ = new java.util.Vector(); // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public int count() { return stringVec_.size(); } public void add(String ctx) { stringVec_.addElement(ctx); } public String item(int index) throws org.omg.CORBA.Bounds { try { return (String) stringVec_.elementAt(index); } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.Bounds(); } } public void remove(int index) throws org.omg.CORBA.Bounds { try { stringVec_.removeElementAt(index); } catch (ArrayIndexOutOfBoundsException ex) { throw new org.omg.CORBA.Bounds(); } } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ContextList() { } }
6,764
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/CORBA/Request.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.CORBA; import java.util.logging.Level; import org.apache.yoko.orb.OB.Logger; // // This class must be public - see org.apache.yoko.orb.OB.MutliRequestSender // final public class Request extends org.omg.CORBA.Request { private org.omg.CORBA.Object target_; private String operation_; private org.omg.CORBA.NVList arguments_; private org.omg.CORBA.NamedValue result_; private org.omg.CORBA.Environment environment_; private org.omg.CORBA.ExceptionList exceptions_; private org.omg.CORBA.ContextList contexts_; private org.omg.CORBA.Context ctx_; private Delegate delegate_; private org.apache.yoko.orb.OB.DowncallStub downcallStub_; private org.apache.yoko.orb.OB.Downcall downcall_; private static final int RequestStateUnsent = 0; private static final int RequestStatePending = 1; private static final int RequestStateSent = 2; private static final int RequestStateReceiving = 3; private static final int RequestStateReceived = 4; private static final int RequestStateDone = 5; private int state_; private boolean pollable_; // Can this request be polled? private boolean polling_; // Is poll_response in progress? private java.lang.Object stateMutex_ = new java.lang.Object(); private boolean raiseDIIExceptions_; // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ private void marshal() throws org.apache.yoko.orb.OB.LocationForward, org.apache.yoko.orb.OB.FailureException { org.apache.yoko.orb.OB.Assert._OB_assert(downcallStub_ != null); org.apache.yoko.orb.OB.Assert._OB_assert(downcall_ != null); OutputStream out = downcallStub_.preMarshal(downcall_); try { java.util.Vector ctxVec = new java.util.Vector(); if (ctx_ != null) { for (int i = 0; i < contexts_.count(); i++) { String item = contexts_.item(i); ((Context) ctx_)._OB_getValues("", 0, item, ctxVec); } } for (int i = 0; i < arguments_.count(); i++) { org.omg.CORBA.NamedValue nv = arguments_.item(i); // Note: Don't use != ARG_OUT here, because flags can // also have values other than ARG_IN, ARG_OUT, or // ARG_INOUT if (nv.flags() == org.omg.CORBA.ARG_IN.value || nv.flags() == org.omg.CORBA.ARG_INOUT.value) nv.value().write_value(out); } if (ctx_ != null) { int len = ctxVec.size(); out.write_ulong(len); for (int i = 0; i < len; i++) out.write_string((String) ctxVec.elementAt(i)); } } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.SystemException ex) { downcallStub_.marshalEx(downcall_, ex); } downcallStub_.postMarshal(downcall_); } private void unmarshal() throws org.apache.yoko.orb.OB.LocationForward, org.apache.yoko.orb.OB.FailureException { org.apache.yoko.orb.OB.Assert._OB_assert(downcallStub_ != null); org.apache.yoko.orb.OB.Assert._OB_assert(downcall_ != null); org.omg.CORBA.BooleanHolder uex = new org.omg.CORBA.BooleanHolder(); InputStream in = downcallStub_.preUnmarshal(downcall_, uex); if (in == null) { org.apache.yoko.orb.OB.Assert._OB_assert(!uex.value); downcallStub_.postUnmarshal(downcall_); return; } if (uex.value) { String id = null; try { id = downcallStub_.unmarshalExceptionId(downcall_); for (int i = 0; i < exceptions_.count(); i++) { org.omg.CORBA.TypeCode tc = exceptions_.item(i); if (tc.id().equals(id)) { org.omg.CORBA.Any any = new Any(delegate_ ._OB_ORBInstance()); any.read_value(in, tc); org.omg.CORBA.UnknownUserException ex = new org.omg.CORBA.UnknownUserException( any); downcallStub_.setUserException(downcall_, ex, id); // // Downcall does not raise UserExceptions in Java, // so we need to set this explicitly // environment_.exception(ex); break; } } } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.SystemException ex) { downcallStub_.unmarshalEx(downcall_, ex); } downcallStub_.postUnmarshal(downcall_); } else { try { org.omg.CORBA.Any any = result_.value(); any.read_value(in, any.type()); try { for (int i = 0; i < arguments_.count(); i++) { org.omg.CORBA.NamedValue nv = arguments_.item(i); // Note: Don't use != ARG_IN here, because flags can // also have values other than ARG_IN, ARG_OUT, or // ARG_INOUT if (nv.flags() == org.omg.CORBA.ARG_OUT.value || nv.flags() == org.omg.CORBA.ARG_INOUT.value) { any = nv.value(); any.read_value(in, any.type()); } } } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } catch (org.omg.CORBA.SystemException ex) { downcallStub_.unmarshalEx(downcall_, ex); } downcallStub_.postUnmarshal(downcall_); } } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.CORBA.Object target() { return target_; } public String operation() { return operation_; } public org.omg.CORBA.NVList arguments() { return arguments_; } public org.omg.CORBA.NamedValue result() { return result_; } public org.omg.CORBA.Environment env() { return environment_; } public org.omg.CORBA.ExceptionList exceptions() { return exceptions_; } public org.omg.CORBA.ContextList contexts() { return contexts_; } public org.omg.CORBA.Context ctx() { return ctx_; } public void ctx(org.omg.CORBA.Context c) { ctx_ = c; } public org.omg.CORBA.Any add_in_arg() { return (arguments_.add(org.omg.CORBA.ARG_IN.value)).value(); } public org.omg.CORBA.Any add_named_in_arg(String name) { return (arguments_.add_item(name, org.omg.CORBA.ARG_IN.value)).value(); } public org.omg.CORBA.Any add_inout_arg() { return (arguments_.add(org.omg.CORBA.ARG_INOUT.value)).value(); } public org.omg.CORBA.Any add_named_inout_arg(String name) { return (arguments_.add_item(name, org.omg.CORBA.ARG_INOUT.value)) .value(); } public org.omg.CORBA.Any add_out_arg() { return (arguments_.add(org.omg.CORBA.ARG_OUT.value)).value(); } public org.omg.CORBA.Any add_named_out_arg(String name) { return (arguments_.add_item(name, org.omg.CORBA.ARG_OUT.value)).value(); } public void set_return_type(org.omg.CORBA.TypeCode tc) { result_.value().type(tc); } public org.omg.CORBA.Any return_value() { return result_.value(); } public void invoke() { synchronized (stateMutex_) { if (state_ == RequestStateDone) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorRequestAlreadySent), org.apache.yoko.orb.OB.MinorCodes.MinorRequestAlreadySent, org.omg.CORBA.CompletionStatus.COMPLETED_NO); else if (state_ != RequestStateUnsent) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorDuplicateSend), org.apache.yoko.orb.OB.MinorCodes.MinorDuplicateSend, org.omg.CORBA.CompletionStatus.COMPLETED_NO); state_ = RequestStatePending; } org.apache.yoko.orb.OB.Assert._OB_assert(downcallStub_ == null); org.apache.yoko.orb.OB.Assert._OB_assert(downcall_ == null); try { RetryInfo info = new RetryInfo(); while (true) { try { downcallStub_ = delegate_._OB_getDowncallStub(target_); while (true) { downcall_ = downcallStub_.createPIDIIDowncall( operation_, true, arguments_, result_, exceptions_); try { marshal(); downcallStub_.request(downcall_); unmarshal(); synchronized (stateMutex_) { state_ = RequestStateDone; } return; } catch (org.apache.yoko.orb.OB.FailureException ex) { downcallStub_.handleFailureException(downcall_, ex); } } // while(true) } catch (Exception ex) { delegate_._OB_handleException(target_, ex, info, false); } } // while(true) } catch (org.omg.CORBA.SystemException ex) { environment_.exception(ex); synchronized (stateMutex_) { state_ = RequestStateDone; } if (raiseDIIExceptions_) throw ex; return; } } public void send_oneway() { synchronized (stateMutex_) { if (state_ == RequestStateDone) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorRequestAlreadySent), org.apache.yoko.orb.OB.MinorCodes.MinorRequestAlreadySent, org.omg.CORBA.CompletionStatus.COMPLETED_NO); else if (state_ != RequestStateUnsent) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorDuplicateSend), org.apache.yoko.orb.OB.MinorCodes.MinorDuplicateSend, org.omg.CORBA.CompletionStatus.COMPLETED_NO); state_ = RequestStatePending; } org.apache.yoko.orb.OB.Assert._OB_assert(downcallStub_ == null); org.apache.yoko.orb.OB.Assert._OB_assert(downcall_ == null); try { RetryInfo info = new RetryInfo(); while (true) { try { downcallStub_ = delegate_._OB_getDowncallStub(target_); while (true) { downcall_ = downcallStub_.createPIDIIDowncall( operation_, false, arguments_, result_, exceptions_); try { marshal(); downcallStub_.oneway(downcall_); unmarshal(); synchronized (stateMutex_) { state_ = RequestStateDone; } return; } catch (org.apache.yoko.orb.OB.FailureException ex) { downcallStub_.handleFailureException(downcall_, ex); } } // while(true) } catch (Exception ex) { delegate_._OB_handleException(target_, ex, info, false); } } // while(true) } catch (org.omg.CORBA.SystemException ex) { Logger logger = delegate_._OB_ORBInstance().getLogger(); logger.log(java.util.logging.Level.FINE, "Exception sending request", ex); environment_.exception(ex); synchronized (stateMutex_) { state_ = RequestStateDone; } if (raiseDIIExceptions_) throw ex; return; } } public void send_deferred() { synchronized (stateMutex_) { if (state_ == RequestStateDone) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorRequestAlreadySent), org.apache.yoko.orb.OB.MinorCodes.MinorRequestAlreadySent, org.omg.CORBA.CompletionStatus.COMPLETED_NO); else if (state_ != RequestStateUnsent) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorDuplicateSend), org.apache.yoko.orb.OB.MinorCodes.MinorDuplicateSend, org.omg.CORBA.CompletionStatus.COMPLETED_NO); state_ = RequestStatePending; pollable_ = true; } org.apache.yoko.orb.OB.Assert._OB_assert(downcallStub_ == null); org.apache.yoko.orb.OB.Assert._OB_assert(downcall_ == null); org.apache.yoko.orb.OB.ORBInstance orbInstance = delegate_ ._OB_ORBInstance(); org.apache.yoko.orb.OB.MultiRequestSender multi = orbInstance .getMultiRequestSender(); try { RetryInfo info = new RetryInfo(); while (true) { try { downcallStub_ = delegate_._OB_getDowncallStub(target_); while (true) { downcall_ = downcallStub_.createPIDIIDowncall( operation_, true, arguments_, result_, exceptions_); try { marshal(); downcallStub_.deferred(downcall_); synchronized (stateMutex_) { multi.addDeferredRequest(this); state_ = RequestStateSent; } return; } catch (org.apache.yoko.orb.OB.FailureException ex) { downcallStub_.handleFailureException(downcall_, ex); } } // while(true) } catch (Exception ex) { delegate_._OB_handleException(target_, ex, info, false); } } // while(true) } catch (org.omg.CORBA.SystemException ex) { Logger logger = delegate_._OB_ORBInstance().getLogger(); logger.log(java.util.logging.Level.FINE, "Exception sending deferred request", ex); environment_.exception(ex); synchronized (stateMutex_) { multi.addDeferredRequest(this); state_ = RequestStateReceived; } if (raiseDIIExceptions_) throw ex; return; } } public void get_response() { org.apache.yoko.orb.OB.ORBInstance orbInstance = delegate_ ._OB_ORBInstance(); org.apache.yoko.orb.OB.MultiRequestSender multi = orbInstance .getMultiRequestSender(); synchronized (stateMutex_) { if (!pollable_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorSynchronousRequest), org.apache.yoko.orb.OB.MinorCodes.MinorSynchronousRequest, org.omg.CORBA.CompletionStatus.COMPLETED_NO); switch (state_) { case RequestStateUnsent: case RequestStatePending: throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorRequestNotSent), org.apache.yoko.orb.OB.MinorCodes.MinorRequestNotSent, org.omg.CORBA.CompletionStatus.COMPLETED_NO); case RequestStateSent: break; case RequestStateReceiving: case RequestStateDone: throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorResponseAlreadyReceived), org.apache.yoko.orb.OB.MinorCodes.MinorResponseAlreadyReceived, org.omg.CORBA.CompletionStatus.COMPLETED_NO); case RequestStateReceived: multi.removeDeferredRequest(this); state_ = RequestStateDone; return; } // // Allow thread calling poll_response to complete // while (polling_) { try { stateMutex_.wait(); } catch (InterruptedException ex) { } } if (state_ == RequestStateReceived) { multi.removeDeferredRequest(this); state_ = RequestStateDone; return; } else { org.apache.yoko.orb.OB.Assert ._OB_assert(state_ == RequestStateSent); multi.removeDeferredRequest(this); state_ = RequestStateReceiving; } } org.apache.yoko.orb.OB.Assert._OB_assert(downcallStub_ != null); org.apache.yoko.orb.OB.Assert._OB_assert(downcall_ != null); boolean send = false; try { RetryInfo info = new RetryInfo(); while (true) { try { if (send) downcallStub_ = delegate_._OB_getDowncallStub(target_); while (true) { if (send) { downcall_ = downcallStub_.createPIDIIDowncall( operation_, true, arguments_, result_, exceptions_); } try { if (send) { marshal(); downcallStub_.deferred(downcall_); send = false; } downcallStub_.response(downcall_); unmarshal(); synchronized (stateMutex_) { state_ = RequestStateDone; } return; } catch (org.apache.yoko.orb.OB.FailureException ex) { downcallStub_.handleFailureException(downcall_, ex); send = true; } } // while(true) } catch (Exception ex) { delegate_._OB_handleException(target_, ex, info, false); send = true; } } // while(true) } catch (org.omg.CORBA.SystemException ex) { Logger logger = delegate_._OB_ORBInstance().getLogger(); logger.log(java.util.logging.Level.FINE, "Exception getting request response", ex); environment_.exception(ex); synchronized (stateMutex_) { state_ = RequestStateDone; } if (raiseDIIExceptions_) throw ex; return; } } public boolean poll_response() { synchronized (stateMutex_) { if (!pollable_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorSynchronousRequest), org.apache.yoko.orb.OB.MinorCodes.MinorSynchronousRequest, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (polling_) return false; // poll_response in progress switch (state_) { case RequestStateUnsent: case RequestStatePending: throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorRequestNotSent), org.apache.yoko.orb.OB.MinorCodes.MinorRequestNotSent, org.omg.CORBA.CompletionStatus.COMPLETED_NO); case RequestStateSent: break; case RequestStateReceiving: // get_response in progress return false; case RequestStateReceived: return true; case RequestStateDone: throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorResponseAlreadyReceived), org.apache.yoko.orb.OB.MinorCodes.MinorResponseAlreadyReceived, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } polling_ = true; } org.apache.yoko.orb.OB.Assert._OB_assert(downcallStub_ != null); org.apache.yoko.orb.OB.Assert._OB_assert(downcall_ != null); boolean send = false; try { RetryInfo info = new RetryInfo(); while (true) { try { if (send) downcallStub_ = delegate_._OB_getDowncallStub(target_); while (true) { if (send) { downcall_ = downcallStub_.createPIDIIDowncall( operation_, true, arguments_, result_, exceptions_); } try { if (send) { marshal(); downcallStub_.deferred(downcall_); send = false; } if (downcallStub_.poll(downcall_)) { unmarshal(); synchronized (stateMutex_) { state_ = RequestStateReceived; polling_ = false; stateMutex_.notify(); } return true; } else { synchronized (stateMutex_) { polling_ = false; stateMutex_.notify(); } return false; } } catch (org.apache.yoko.orb.OB.FailureException ex) { downcallStub_.handleFailureException(downcall_, ex); send = true; } } // while(true) } catch (Exception ex) { delegate_._OB_handleException(target_, ex, info, false); send = true; } } // while(true) } catch (org.omg.CORBA.SystemException ex) { Logger logger = delegate_._OB_ORBInstance().getLogger(); logger.log(java.util.logging.Level.FINE, "Exception polling request response", ex); environment_.exception(ex); synchronized (stateMutex_) { state_ = RequestStateReceived; polling_ = false; stateMutex_.notify(); } if (raiseDIIExceptions_) throw ex; return true; } } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ Request(org.omg.CORBA.Object target, String operation, org.omg.CORBA.NVList arguments, org.omg.CORBA.NamedValue result, org.omg.CORBA.ExceptionList exceptions, org.omg.CORBA.ContextList contexts) { delegate_ = (Delegate) (((org.omg.CORBA.portable.ObjectImpl) target) ._get_delegate()); target_ = target; operation_ = operation; arguments_ = arguments; result_ = result; environment_ = new Environment(); exceptions_ = exceptions; contexts_ = contexts; state_ = RequestStateUnsent; pollable_ = false; polling_ = false; ORB orb = (ORB) delegate_.orb(null); raiseDIIExceptions_ = orb._OB_raiseDIIExceptions(); } Request(org.omg.CORBA.Object target, String operation, org.omg.CORBA.NVList arguments, org.omg.CORBA.NamedValue result) { delegate_ = (Delegate) (((org.omg.CORBA.portable.ObjectImpl) target) ._get_delegate()); target_ = target; operation_ = operation; arguments_ = arguments; result_ = result; environment_ = new Environment(); exceptions_ = new ExceptionList(); contexts_ = new ContextList(); state_ = RequestStateUnsent; pollable_ = false; polling_ = false; ORB orb = (ORB) delegate_.orb(null); raiseDIIExceptions_ = orb._OB_raiseDIIExceptions(); } Request(org.omg.CORBA.Object target, String operation) { delegate_ = (Delegate) (((org.omg.CORBA.portable.ObjectImpl) target) ._get_delegate()); target_ = target; operation_ = operation; arguments_ = new NVList(delegate_.orb(target_)); result_ = new NamedValue("", new Any(delegate_._OB_ORBInstance()), org.omg.CORBA.ARG_OUT.value); environment_ = new Environment(); exceptions_ = new ExceptionList(); contexts_ = new ContextList(); state_ = RequestStateUnsent; pollable_ = false; polling_ = false; ORB orb = (ORB) delegate_.orb(null); raiseDIIExceptions_ = orb._OB_raiseDIIExceptions(); } protected void finalize() throws Throwable { if (state_ == RequestStateSent) { // // TODO: This is a memory leak, as a request has been // sent, but the response has never been picked // up. The correct thing would be to tell the Downcall // object to cancel the request. But we don't have // this ability yet. // } // // Find out whether this was a deferred request for which // get_response() hasn't been called yet. // org.apache.yoko.orb.OB.ORBInstance orbInstance = delegate_ ._OB_ORBInstance(); org.apache.yoko.orb.OB.MultiRequestSender multi = orbInstance .getMultiRequestSender(); if (multi != null) // It might be possible that the // MultiRequestSender is already destroyed { // // Remove this request from the list of the outstanding // deferred requests // multi.removeDeferredRequest(this); } super.finalize(); } public boolean _OB_completed() { synchronized (stateMutex_) { return state_ == RequestStateReceived; } } }
6,765
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ArgumentStrategyNull.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; final class ArgumentStrategyNull extends ArgumentStrategy { ArgumentStrategyNull(org.omg.CORBA.ORB orb) { super(orb); } // // Get the arguments // org.omg.Dynamic.Parameter[] arguments() { if (!argsAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall) + ": arguments unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); throw new org.omg.CORBA.NO_RESOURCES( org.apache.yoko.orb.OB.MinorCodes .describeNoResources(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidBinding) + ": arguments unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidBinding, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } // // Get the exceptions // org.omg.CORBA.TypeCode[] exceptions() { if (!exceptAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall) + ": exceptions unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); throw new org.omg.CORBA.NO_RESOURCES( org.apache.yoko.orb.OB.MinorCodes .describeNoResources(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidBinding) + ": exceptions unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidBinding, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } // // Get the result // org.omg.CORBA.Any result() { if (!resultAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall) + ": result unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); throw new org.omg.CORBA.NO_RESOURCES( org.apache.yoko.orb.OB.MinorCodes .describeNoResources(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidBinding) + ": result unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidBinding, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } // // Set the result (server side only) // void setResult(org.omg.CORBA.Any any) { org.apache.yoko.orb.OB.Assert._OB_assert(false); } }
6,766
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/Current_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // // Implementation Notes: // // The Current implementation needs to have a stack of slot // information. This is to deal with collocated calls that occur in // the same thread as the client. In this case the server current // should not overwrite the content of the client side current. // package org.apache.yoko.orb.PortableInterceptor; import java.util.logging.Level; import java.util.logging.Logger; final public class Current_impl extends org.omg.CORBA.LocalObject implements org.omg.PortableInterceptor.Current { // the real logger backing instance. We use the interface class as the locator static final Logger logger = Logger.getLogger(Current_impl.class.getName()); private class SlotData { org.omg.CORBA.Any[] slots; SlotData next; SlotData(org.omg.CORBA.Any[] s) { slots = s; } SlotData() { slots = new org.omg.CORBA.Any[0]; } } private class SlotDataHolder { SlotData head; } // // The WeakHashMap is not thread-safe so we need to utilize one of // these thread-safe wrappers // private java.util.Map stateKey_ = java.util.Collections .synchronizedMap(new java.util.WeakHashMap()); private org.omg.CORBA.ORB orb_; // Java only private int maxSlots_; // ------------------------------------------------------------------ // Private member implementations // ------------------------------------------------------------------ private SlotDataHolder establishTSD(boolean partial) { Thread t = Thread.currentThread(); SlotDataHolder holder_ = (SlotDataHolder) stateKey_.get(t); // // If the data isn't already allocated then allocate a new // SlotDataHolder and a new set of slots // if (holder_ == null) { holder_ = new SlotDataHolder(); stateKey_.put(t, holder_); org.omg.CORBA.Any[] slots = null; // // This is an optimization. If this is a partial allocation // then it's not necessary to allocate data for the actual // slots. // if (!partial) { slots = new org.omg.CORBA.Any[maxSlots_]; } holder_.head = new SlotData(slots); holder_.head.next = null; } return holder_; } // ------------------------------------------------------------------ // Public member implementations // ------------------------------------------------------------------ public org.omg.CORBA.Any get_slot(int id) throws org.omg.PortableInterceptor.InvalidSlot { if (id >= maxSlots_) { throw new org.omg.PortableInterceptor.InvalidSlot(); } logger.fine("getting slot " + id); SlotDataHolder holder = establishTSD(false); org.omg.CORBA.Any result; org.omg.CORBA.Any slot = holder.head.slots[id]; if (slot == null) { result = orb_.create_any(); } else { result = new org.apache.yoko.orb.CORBA.Any(slot); } return result; } public void set_slot(int id, org.omg.CORBA.Any any) throws org.omg.PortableInterceptor.InvalidSlot { if (id >= maxSlots_) { throw new org.omg.PortableInterceptor.InvalidSlot(); } logger.fine("setting slot " + id); SlotDataHolder holder = establishTSD(false); holder.head.slots[id] = new org.apache.yoko.orb.CORBA.Any(any); } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public Current_impl(org.omg.CORBA.ORB orb) { orb_ = orb; } org.omg.CORBA.Any[] _OB_currentSlotData() { SlotDataHolder holder = establishTSD(false); org.omg.CORBA.Any[] data = new org.omg.CORBA.Any[holder.head.slots.length]; for (int i = 0; i < holder.head.slots.length; i++) { org.omg.CORBA.Any slot = holder.head.slots[i]; if (slot != null) { data[i] = new org.apache.yoko.orb.CORBA.Any(slot); } } return data; } // // On the client side a completely new set of slots are needed // during the actual interceptor call, this new set is managed by // the client request info. // // On the server side the set of slots are shared between the // interceptor and the server side PICurrent // void _OB_pushSlotData(org.omg.CORBA.Any[] slots) { logger.fine("pushing slot data"); SlotDataHolder holder = establishTSD(false); SlotData newSlots = new SlotData(slots); newSlots.next = holder.head; holder.head = newSlots; } void _OB_popSlotData() { logger.fine("popping slot data"); SlotDataHolder holder = establishTSD(false); holder.head = holder.head.next; org.apache.yoko.orb.OB.Assert._OB_assert(holder.head != null); } org.omg.CORBA.Any[] _OB_newSlotTable() { return new org.omg.CORBA.Any[maxSlots_]; } public void _OB_setMaxSlots(int max) { maxSlots_ = max; } }
6,767
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/POAPolicyFactory_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; public final class POAPolicyFactory_impl extends org.omg.CORBA.LocalObject implements org.omg.PortableInterceptor.PolicyFactory { public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any val) throws org.omg.CORBA.PolicyError { try { if (type == org.omg.PortableServer.THREAD_POLICY_ID.value) { org.omg.PortableServer.ThreadPolicyValue v = org.omg.PortableServer.ThreadPolicyValueHelper .extract(val); return new org.apache.yoko.orb.PortableServer.ThreadPolicy_impl( v); } if (type == org.omg.PortableServer.LIFESPAN_POLICY_ID.value) { org.omg.PortableServer.LifespanPolicyValue v = org.omg.PortableServer.LifespanPolicyValueHelper .extract(val); return new org.apache.yoko.orb.PortableServer.LifespanPolicy_impl( v); } if (type == org.omg.PortableServer.ID_UNIQUENESS_POLICY_ID.value) { org.omg.PortableServer.IdUniquenessPolicyValue v = org.omg.PortableServer.IdUniquenessPolicyValueHelper .extract(val); return new org.apache.yoko.orb.PortableServer.IdUniquenessPolicy_impl( v); } if (type == org.omg.PortableServer.ID_ASSIGNMENT_POLICY_ID.value) { org.omg.PortableServer.IdAssignmentPolicyValue v = org.omg.PortableServer.IdAssignmentPolicyValueHelper .extract(val); return new org.apache.yoko.orb.PortableServer.IdAssignmentPolicy_impl( v); } if (type == org.omg.PortableServer.IMPLICIT_ACTIVATION_POLICY_ID.value) { org.omg.PortableServer.ImplicitActivationPolicyValue v = org.omg.PortableServer.ImplicitActivationPolicyValueHelper .extract(val); return new org.apache.yoko.orb.PortableServer.ImplicitActivationPolicy_impl( v); } if (type == org.omg.PortableServer.SERVANT_RETENTION_POLICY_ID.value) { org.omg.PortableServer.ServantRetentionPolicyValue v = org.omg.PortableServer.ServantRetentionPolicyValueHelper .extract(val); return new org.apache.yoko.orb.PortableServer.ServantRetentionPolicy_impl( v); } if (type == org.omg.PortableServer.REQUEST_PROCESSING_POLICY_ID.value) { org.omg.PortableServer.RequestProcessingPolicyValue v = org.omg.PortableServer.RequestProcessingPolicyValueHelper .extract(val); return new org.apache.yoko.orb.PortableServer.RequestProcessingPolicy_impl( v); } if (type == org.apache.yoko.orb.OBPortableServer.SYNCHRONIZATION_POLICY_ID.value) { org.apache.yoko.orb.OBPortableServer.SynchronizationPolicyValue v = org.apache.yoko.orb.OBPortableServer.SynchronizationPolicyValueHelper .extract(val); return new org.apache.yoko.orb.OBPortableServer.SynchronizationPolicy_impl( v); } if (type == org.apache.yoko.orb.OBPortableServer.INTERCEPTOR_CALL_POLICY_ID.value) { boolean v = val.extract_boolean(); return new org.apache.yoko.orb.OBPortableServer.InterceptorCallPolicy_impl( v); } /* * We can't implement this yet since locality constrained objects * cannot be placed in CORBA::Any yet * * if(type == * org.apache.yoko.orb.PortableServer.OB_DISPATCH_STRATEGY_POLICY_ID.value) { * org.apache.yoko.orb.PortableServer.OBDispatchStrategy v = * org.apache.yoko.orb.PortableServer.OBDispatchStrategyHelper. * extract(val); return new OBDispatchStrategyPolicy_impl(v); } */ throw new org.omg.CORBA.PolicyError(org.omg.CORBA.BAD_POLICY.value); } catch (org.omg.CORBA.BAD_OPERATION ex) { // // Any extraction failed // throw new org.omg.CORBA.PolicyError( org.omg.CORBA.BAD_POLICY_TYPE.value); } } }
6,768
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ServerRequestInfo_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; import org.apache.yoko.util.cmsf.CmsfThreadLocal; import org.apache.yoko.util.cmsf.CmsfThreadLocal.CmsfOverride; import org.apache.yoko.util.yasf.YasfThreadLocal; import org.apache.yoko.util.yasf.YasfThreadLocal.YasfOverride; final public class ServerRequestInfo_impl extends RequestInfo_impl implements ServerRequestInfoExt { // // Sequence of ServerRequestInterceptors to call on reply // java.util.Vector interceptors_ = new java.util.Vector(); // // The adapter ID // private byte[] adapterId_; // // The object-id // private byte[] objectId_; // // The servant // private org.omg.PortableServer.Servant servant_; // // The POA // private org.omg.PortableServer.POA poa_; // // The adapter ORT // private org.omg.PortableInterceptor.ObjectReferenceTemplate adapterTemplate_; // // The adapter name // private String[] adapterName_; // // The information about the transport servicing this request // private org.apache.yoko.orb.OCI.TransportInfo transportInfo_; // ------------------------------------------------------------------ // Standard IDL to Java mapping // ------------------------------------------------------------------ // // Return the raised exception. // // Server side: // // receive_request_service_contexts: no receive_request: no // send_reply: no send_exception: yes send_other: no // public org.omg.CORBA.Any sending_exception() { // // If status is not SYSTEM_EXCEPTION or USER_EXCEPTION then this // is a BAD_INV_ORDER exception // if (status_ != org.omg.PortableInterceptor.SYSTEM_EXCEPTION.value && status_ != org.omg.PortableInterceptor.USER_EXCEPTION.value) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // If the application code hasn't provided the exception // then we insert an UNKNOWN // // (Java only) // if (receivedException_ == null) { org.omg.CORBA.Any any = orb_.create_any(); org.apache.yoko.orb.OB.Util .insertException( any, new org.omg.CORBA.UNKNOWN( org.apache.yoko.orb.OB.MinorCodes .describeUnknown(org.apache.yoko.orb.OB.MinorCodes.MinorUnknownUserException) + ": exception unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorUnknownUserException, org.omg.CORBA.CompletionStatus.COMPLETED_YES)); return any; } // // UnknownUserException? Extract the contained UserException. // org.omg.CORBA.UnknownUserException unk = null; try { unk = (org.omg.CORBA.UnknownUserException) receivedException_; } catch (ClassCastException ex) { } if (unk != null) return unk.except; org.omg.CORBA.Any any = orb_.create_any(); org.apache.yoko.orb.OB.Util.insertException(any, receivedException_); return any; } // // Return the object-id of the destination of this request. // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public byte[] object_id() { if (status_ == NO_REPLY_SC) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); byte[] data = new byte[objectId_.length]; System.arraycopy(objectId_, 0, data, 0, objectId_.length); return data; } // // Return the adapter_id of the destination of this request. // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public byte[] adapter_id() { if (status_ == NO_REPLY_SC) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); byte[] result = new byte[adapterId_.length]; System.arraycopy(adapterId_, 0, result, 0, adapterId_.length); return result; } // // Return the adapter_id of the destination of this request. // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: no send_exception: no send_other: no // public String target_most_derived_interface() { if (status_ == NO_REPLY_SC || servant_ == null) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); org.apache.yoko.orb.OB.Assert._OB_assert(poa_ != null); return servant_._all_interfaces(poa_, objectId_)[0]; } // // Return the server_id of the destination of this request. // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public String server_id() { if (status_ == NO_REPLY_SC) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return adapterTemplate_.server_id(); } // // Return the orb_id of the destination of this request. // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public String orb_id() { if (status_ == NO_REPLY_SC) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return adapterTemplate_.orb_id(); } // // Return the adapter_name of the destination of this request. // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public String[] adapter_name() { if (status_ == NO_REPLY_SC) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); return adapterTemplate_.adapter_name(); } // // Retrieve the policy with the provided type in effect for this // object-adapter. // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public org.omg.CORBA.Policy get_server_policy(int type) { for (int i = 0; i < policies_.length; i++) { if (policies_[i].policy_type() == type) { return policies_[i]; } } // if the target policy was not in the current policy list, check to see // if the type has even been registered. If it is valid, return null // to indicate we ain't got one. if (orbInstance_.getPolicyFactoryManager().isPolicyRegistered(type)) { return null; } throw new org.omg.CORBA.INV_POLICY( org.apache.yoko.orb.OB.MinorCodes .describeInvPolicy(org.apache.yoko.orb.OB.MinorCodes.MinorNoPolicyFactory) + ": " + type, org.apache.yoko.orb.OB.MinorCodes.MinorNoPolicyFactory, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } // // Set the slot in the slot table for the request thread-level data. // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public void set_slot(int id, org.omg.CORBA.Any data) throws org.omg.PortableInterceptor.InvalidSlot { if (id >= slots_.length) { throw new org.omg.PortableInterceptor.InvalidSlot(); } logger.fine("setting slot " + id + " for operation " + op_); slots_[id] = new org.apache.yoko.orb.CORBA.Any(data); } // // Determine if the servant has the given repository id. // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: no send_exception: no send_other: no // public boolean target_is_a(String id) { if (status_ == NO_REPLY_SC || servant_ == null) { throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return servant_._is_a(id); } // // Add a service context for the reply. // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public void add_reply_service_context(org.omg.IOP.ServiceContext sc, boolean addReplace) { addServiceContext(replySCL_, sc, addReplace); } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ServerRequestInfo_impl( org.omg.CORBA.ORB orb, int id, String op, boolean responseExpected, org.omg.CORBA.Policy[] policies, byte[] adapterId, byte[] objectId, org.omg.PortableInterceptor.ObjectReferenceTemplate adapterTemplate, java.util.Vector request, java.util.Vector reply, org.apache.yoko.orb.OB.ORBInstance orbInstance, Current_impl current, org.apache.yoko.orb.OCI.TransportInfo transportInfo) { super(orb, id, op, responseExpected, request, reply, orbInstance, policies, current); adapterId_ = adapterId; objectId_ = objectId; adapterTemplate_ = adapterTemplate; servant_ = null; poa_ = null; transportInfo_ = transportInfo; // // TODO: Dump NO_REPLY_SC // status_ = NO_REPLY_SC; // // Start of with a Null strategy. It's not necessary to deal with // arguments() and exceptions() being called during // receive_request_service_contexts since this cannot occur. // argStrategy_ = new ArgumentStrategyNull(orb_); // // On the server side the slots_ are initialized with the // correct number of entries // slots_ = current_._OB_newSlotTable(); } public void _OB_requestServiceContext(java.util.Vector interceptors) throws org.apache.yoko.orb.OB.LocationForward { // // Arguments, result and exceptions not available // argStrategy_.setResultAvail(false); argStrategy_.setArgsAvail(false); argStrategy_.setExceptAvail(false); try (CmsfOverride cmsfo = CmsfThreadLocal.override(); YasfOverride yasfo = YasfThreadLocal.override()) { java.util.Enumeration e = interceptors.elements(); while (e.hasMoreElements()) { org.omg.PortableInterceptor.ServerRequestInterceptor i = (org.omg.PortableInterceptor.ServerRequestInterceptor) e .nextElement(); i.receive_request_service_contexts(this); interceptors_.addElement(i); } popCurrent_ = true; current_._OB_pushSlotData(slots_); } catch (org.omg.PortableInterceptor.ForwardRequest ex) { org.apache.yoko.orb.CORBA.Delegate p = (org.apache.yoko.orb.CORBA.Delegate) (((org.omg.CORBA.portable.ObjectImpl) ex.forward) ._get_delegate()); throw new org.apache.yoko.orb.OB.LocationForward(p._OB_IOR(), false); } } public void _OB_request() throws org.apache.yoko.orb.OB.LocationForward { // // Arguments, exceptions are now available. Result isn't. // argStrategy_.setArgsAvail(true); argStrategy_.setExceptAvail(true); status_ = NO_REPLY; try (CmsfOverride cmsfo = CmsfThreadLocal.override(); YasfOverride yasfo = YasfThreadLocal.override()) { java.util.Enumeration e = interceptors_.elements(); while (e.hasMoreElements()) { ((org.omg.PortableInterceptor.ServerRequestInterceptor) (e .nextElement())).receive_request(this); } } catch (org.omg.PortableInterceptor.ForwardRequest ex) { org.apache.yoko.orb.CORBA.Delegate p = (org.apache.yoko.orb.CORBA.Delegate) (((org.omg.CORBA.portable.ObjectImpl) ex.forward) ._get_delegate()); throw new org.apache.yoko.orb.OB.LocationForward(p._OB_IOR(), false); } } public void _OB_sendReply() { org.apache.yoko.orb.OB.Assert ._OB_assert(status_ == org.omg.PortableInterceptor.SUCCESSFUL.value); // // The result is available // argStrategy_.setResultAvail(true); // // The servant is no longer available // servant_ = null; try (CmsfOverride cmsfo = CmsfThreadLocal.override(); YasfOverride yasfo = YasfThreadLocal.override()) { int curr = interceptors_.size() - 1; while (!interceptors_.isEmpty()) { org.omg.PortableInterceptor.ServerRequestInterceptor i = (org.omg.PortableInterceptor.ServerRequestInterceptor) interceptors_ .elementAt(curr); interceptors_.removeElementAt(curr); --curr; i.send_reply(this); } } // // If a set of slots was provided to the Current implementation // then the slots have to be popped // if (popCurrent_) { popCurrent_ = false; current_._OB_popSlotData(); } } public void _OB_sendException() throws org.apache.yoko.orb.OB.LocationForward { // // Arguments, result not available // argStrategy_.setResultAvail(false); argStrategy_.setArgsAvail(false); // // The servant is no longer available // servant_ = null; try (CmsfOverride cmsfo = CmsfThreadLocal.override(); YasfOverride yasfo = YasfThreadLocal.override()) { org.apache.yoko.orb.OB.Assert ._OB_assert(status_ == org.omg.PortableInterceptor.SYSTEM_EXCEPTION.value || status_ == org.omg.PortableInterceptor.USER_EXCEPTION.value); int curr = interceptors_.size() - 1; while (!interceptors_.isEmpty()) { org.omg.PortableInterceptor.ServerRequestInterceptor i = (org.omg.PortableInterceptor.ServerRequestInterceptor) interceptors_ .elementAt(curr); interceptors_.removeElementAt(curr); --curr; i.send_exception(this); } // // If a set of slots was provided to the Current implementation // then the slots have to be popped // if (popCurrent_) { popCurrent_ = false; current_._OB_popSlotData(); } } catch (org.omg.PortableInterceptor.ForwardRequest ex) { org.apache.yoko.orb.CORBA.Delegate p = (org.apache.yoko.orb.CORBA.Delegate) (((org.omg.CORBA.portable.ObjectImpl) ex.forward) ._get_delegate()); throw new org.apache.yoko.orb.OB.LocationForward(p._OB_IOR(), false); } } public void _OB_sendOther() throws org.apache.yoko.orb.OB.LocationForward { // // Arguments, result not available // argStrategy_.setResultAvail(false); argStrategy_.setArgsAvail(false); // // The servant is no longer available // servant_ = null; try (CmsfOverride cmsfo = CmsfThreadLocal.override(); YasfOverride yasfo = YasfThreadLocal.override()) { org.apache.yoko.orb.OB.Assert ._OB_assert(status_ == org.omg.PortableInterceptor.LOCATION_FORWARD.value || status_ == org.omg.PortableInterceptor.TRANSPORT_RETRY.value); int curr = interceptors_.size() - 1; while (!interceptors_.isEmpty()) { org.omg.PortableInterceptor.ServerRequestInterceptor i = (org.omg.PortableInterceptor.ServerRequestInterceptor) interceptors_ .elementAt(curr); interceptors_.removeElementAt(curr); --curr; i.send_other(this); } // // If a set of slots was provided to the Current implementation // then the slots have to be popped // if (popCurrent_) { popCurrent_ = false; current_._OB_popSlotData(); } } catch (org.omg.PortableInterceptor.ForwardRequest ex) { org.apache.yoko.orb.CORBA.Delegate p = (org.apache.yoko.orb.CORBA.Delegate) (((org.omg.CORBA.portable.ObjectImpl) ex.forward) ._get_delegate()); throw new org.apache.yoko.orb.OB.LocationForward(p._OB_IOR(), false); } } public void _OB_servant(org.omg.PortableServer.Servant servant, org.omg.PortableServer.POA poa) { servant_ = servant; poa_ = poa; } // // Called when we are entering or leaving a thread, to allow // the Current to be managed properly // public void _OB_contextSwitch() { if (popCurrent_) { logger.fine("Popping the PICurrent because of a context switch"); popCurrent_ = false; current_._OB_popSlotData(); } else { logger.fine("Pushing the PICurrent because of a context switch"); popCurrent_ = true; current_._OB_pushSlotData(slots_); } } public void _OB_parameterDesc( org.apache.yoko.orb.OB.ParameterDesc[] argDesc, org.apache.yoko.orb.OB.ParameterDesc retDesc, org.omg.CORBA.TypeCode[] exceptionTC) { // // Update the argument strategy // argStrategy_ = new ArgumentStrategySII(orb_, argDesc, retDesc, exceptionTC); } public void _OB_arguments(org.omg.CORBA.NVList args) { // // Update the argument strategy // argStrategy_ = new ArgumentStrategyDII(orb_, args); // // Exceptions are never available // argStrategy_.setExceptNeverAvail(); } public void _OB_result(org.omg.CORBA.Any value) { // // Result is now available. Update the argument strategy. // org.apache.yoko.orb.OB.Assert._OB_assert(argStrategy_ != null); argStrategy_.setResult(value); } /** * Retrieve the TransportInfo object associated with this server * request. The TransportInfo object contains information about * the connection used for the request. * * @return The TransportInfo object created by the OCI layer. */ public org.apache.yoko.orb.OCI.TransportInfo getTransportInfo() { return transportInfo_; } }
6,769
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/IMRIORInterceptor_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; final public class IMRIORInterceptor_impl extends org.omg.CORBA.LocalObject implements org.omg.PortableInterceptor.IORInterceptor_3_0 { private java.util.Hashtable poas_; private org.apache.yoko.orb.OB.Logger logger_; private org.apache.yoko.orb.IMR.ActiveState as_; private String serverInstance_; private boolean running_; // ------------------------------------------------------------------ // Private Member Functions // ------------------------------------------------------------------ private org.apache.yoko.orb.IMR.POAStatus convertState(short state) { org.apache.yoko.orb.IMR.POAStatus status = org.apache.yoko.orb.IMR.POAStatus.NON_EXISTENT; switch (state) { case org.omg.PortableInterceptor.INACTIVE.value: status = org.apache.yoko.orb.IMR.POAStatus.INACTIVE; break; case org.omg.PortableInterceptor.ACTIVE.value: status = org.apache.yoko.orb.IMR.POAStatus.ACTIVE; break; case org.omg.PortableInterceptor.HOLDING.value: status = org.apache.yoko.orb.IMR.POAStatus.HOLDING; break; case org.omg.PortableInterceptor.DISCARDING.value: status = org.apache.yoko.orb.IMR.POAStatus.DISCARDING; break; } return status; } // ------------------------------------------------------------------ // Public Member Functions // ------------------------------------------------------------------ public IMRIORInterceptor_impl(org.apache.yoko.orb.OB.Logger logger, org.apache.yoko.orb.IMR.ActiveState as, String serverInstance) { logger_ = logger; as_ = as; serverInstance_ = serverInstance; running_ = false; poas_ = new java.util.Hashtable(); } // ------------------------------------------------------------------ // IDL to Java Mapping // ------------------------------------------------------------------ public String name() { return new String("IMRInterceptor"); } public void destroy() { } public void establish_components(org.omg.PortableInterceptor.IORInfo info) { } public void components_established(org.omg.PortableInterceptor.IORInfo info) { // // This method does nothing if this is not a persistent POA // try { org.omg.CORBA.Policy p = info .get_effective_policy(org.omg.PortableServer.LIFESPAN_POLICY_ID.value); org.omg.PortableServer.LifespanPolicy policy = org.omg.PortableServer.LifespanPolicyHelper .narrow(p); if (policy.value() != org.omg.PortableServer.LifespanPolicyValue.PERSISTENT) return; } catch (org.omg.CORBA.INV_POLICY e) { // // Default Lifespan policy is TRANSIENT // return; } // // Get the primary object-reference template // org.omg.PortableInterceptor.ObjectReferenceTemplate primary = info .adapter_template(); try { short state = info.state(); org.apache.yoko.orb.IMR.POAStatus status = convertState(state); org.omg.PortableInterceptor.ObjectReferenceTemplate secondary = as_ .poa_create(status, primary); info.current_factory(secondary); } catch (org.apache.yoko.orb.IMR._NoSuchPOA e) { String msg = "IMR: POA not registered: "; for (int i = 0; i < e.poa.length; i++) { msg += e.poa[i]; if (i != e.poa.length - 1) msg += "/"; } logger_.error(msg, e); throw new org.omg.CORBA.INITIALIZE(); } catch (org.omg.CORBA.SystemException ex) { String msg = "IMR: Cannot contact: " + ex.getMessage(); logger_.error(msg, ex); throw new org.omg.CORBA.INITIALIZE(); // TODO: - some exception } // // Update the poa hash table // String id = info.manager_id(); String[] name = primary.adapter_name(); java.util.Vector poas = (java.util.Vector) poas_.get(new Integer(id)); if (poas != null) { // // Add poa to exiting entry // poas.addElement(name); // XXX Do I have to reput } else { // // Add a new entry for this adapter manager // poas = new java.util.Vector(); poas.addElement(name); poas_.put(new Integer(id), poas); } } public void adapter_state_changed( org.omg.PortableInterceptor.ObjectReferenceTemplate[] templates, short state) { // // Only update the IMR from this point if the POAs have // been destroyed. // if (state != org.omg.PortableInterceptor.NON_EXISTENT.value) return; java.util.Vector poanames = new java.util.Vector(); for (int i = 0; i < templates.length; ++i) { try { org.apache.yoko.orb.OBPortableInterceptor.PersistentORT_impl persistentORT = (org.apache.yoko.orb.OBPortableInterceptor.PersistentORT_impl) templates[i]; } catch (ClassCastException ex) { // // If not a Persistent ORT continue // continue; } String[] adpaterName = templates[i].adapter_name(); // // Add the POA to the list of POAs to send to the // IMR for the status update // poanames.addElement(adpaterName); // // Find the POA in the POAManager -> POAs map and // remove it. // java.util.Enumeration e = poas_.elements(); while (e.hasMoreElements()) { java.util.Vector poas = (java.util.Vector) e.nextElement(); // // Find the poa being deleted // int j; for (j = 0; j < poas.size(); ++j) { String[] current = (String[]) poas.elementAt(j); if (current.length != adpaterName.length) continue; boolean found = true; for (int k = 0; k < adpaterName.length; ++k) { if (!current[k].equals(adpaterName[k])) { found = false; break; } } if (found) break; } // // Shift back the remaining poas if match found // if (j != poas.size()) { poas.removeElementAt(j); break; } } } if (poanames.size() != 0) { try { String[][] poaArray = new String[poanames.size()][]; poanames.copyInto(poaArray); as_.poa_status_update(poaArray, org.apache.yoko.orb.IMR.POAStatus.NON_EXISTENT); } catch (org.omg.CORBA.SystemException ex) { String msg = "IMR: poa_destroy: " + ex.getMessage(); logger_.warning(msg, ex); } } } // // Update POA states for this adapter // public void adapter_manager_state_changed(String id, short state) { if (!running_) { // // Inform the IMR the server is now running if this // is the first call. // try { as_.set_status(serverInstance_, org.apache.yoko.orb.IMR.ServerStatus.RUNNING); } catch (org.omg.CORBA.OBJECT_NOT_EXIST ex) { logger_.error("IMR: Not registered", ex); throw new org.omg.CORBA.INITIALIZE(); } catch (org.omg.CORBA.SystemException ex) { logger_.error("IMR: Cannot contact", ex); throw new org.omg.CORBA.INITIALIZE(); } running_ = true; } // // Inform the IMR of the POA status update // java.util.Vector poas = (java.util.Vector) poas_.get(new Integer(id)); if (poas != null && poas.size() != 0) { try { String[][] poaArray = new String[poas.size()][]; poas.copyInto(poaArray); org.apache.yoko.orb.IMR.POAStatus status = convertState(state); as_.poa_status_update(poaArray, status); } catch (org.omg.CORBA.SystemException ex) { // // XXX ???? // } } } }
6,770
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ArgumentStrategySII.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; final class ArgumentStrategySII extends ArgumentStrategy { protected org.apache.yoko.orb.OB.ParameterDesc[] argDesc_; protected org.apache.yoko.orb.OB.ParameterDesc retDesc_; protected org.omg.CORBA.TypeCode[] exceptionTC_; // ------------------------------------------------------------------ // ArgumentStrategySII private and protected member implementations // ------------------------------------------------------------------ // // Fill the contents of the Any using a ParameterDesc descriptor // protected void fillAny(org.omg.CORBA.Any any, org.apache.yoko.orb.OB.ParameterDesc desc) { org.omg.CORBA.portable.OutputStream out = orb_.create_output_stream(); desc.param._write(out); any.read_value(out.create_input_stream(), desc.tc); } // ------------------------------------------------------------------ // ArgumentStrategySII package member implementations // ------------------------------------------------------------------ ArgumentStrategySII(org.omg.CORBA.ORB orb, org.apache.yoko.orb.OB.ParameterDesc[] argDesc, org.apache.yoko.orb.OB.ParameterDesc retDesc, org.omg.CORBA.TypeCode[] exceptionTC) { super(orb); argDesc_ = argDesc; retDesc_ = retDesc; exceptionTC_ = exceptionTC; } // // Get the arguments // org.omg.Dynamic.Parameter[] arguments() { if (!argsAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall) + ": arguments unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); int nargDesc = 0; if (argDesc_ != null) nargDesc = argDesc_.length; org.omg.Dynamic.Parameter[] pl = new org.omg.Dynamic.Parameter[nargDesc]; for (int i = 0; i < nargDesc; i++) { pl[i] = new org.omg.Dynamic.Parameter(); pl[i].argument = orb_.create_any(); switch (argDesc_[i].mode) { case 0: // in pl[i].mode = org.omg.CORBA.ParameterMode.PARAM_IN; fillAny(pl[i].argument, argDesc_[i]); break; case 1: // out pl[i].mode = org.omg.CORBA.ParameterMode.PARAM_OUT; // // The value may only be copied if there is a successful // response // if (resultAvail_) fillAny(pl[i].argument, argDesc_[i]); break; case 2: // inout pl[i].mode = org.omg.CORBA.ParameterMode.PARAM_INOUT; fillAny(pl[i].argument, argDesc_[i]); break; default: org.apache.yoko.orb.OB.Assert._OB_assert(false); } } return pl; } // // Get the exceptions // org.omg.CORBA.TypeCode[] exceptions() { if (!exceptAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall) + ": exceptions unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); int nexceptionTC = 0; if (exceptionTC_ != null) nexceptionTC = exceptionTC_.length; org.omg.CORBA.TypeCode[] e = new org.omg.CORBA.TypeCode[nexceptionTC]; if (nexceptionTC > 0) System.arraycopy(exceptionTC_, 0, e, 0, nexceptionTC); return e; } // // Get the result // org.omg.CORBA.Any result() { if (!resultAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall) + ": result unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); org.omg.CORBA.Any any = orb_.create_any(); if (retDesc_ != null) fillAny(any, retDesc_); else any.type(orb_.get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); return any; } // // Set the result (server side only) // void setResult(org.omg.CORBA.Any any) { org.apache.yoko.orb.OB.Assert._OB_assert(false); } }
6,771
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ClientRequestInfo_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; import org.apache.yoko.util.cmsf.CmsfThreadLocal; import org.apache.yoko.util.cmsf.CmsfThreadLocal.CmsfOverride; import org.apache.yoko.util.yasf.YasfThreadLocal; import org.apache.yoko.util.yasf.YasfThreadLocal.YasfOverride; final public class ClientRequestInfo_impl extends RequestInfo_impl implements org.omg.PortableInterceptor.ClientRequestInfo { // // Sequence of ClientRequestInterceptors to call on reply // private java.util.Vector interceptors_ = new java.util.Vector(); // // The effective IOR // private org.omg.IOP.IOR IOR_; // // The original IOR // private org.omg.IOP.IOR origIOR_; // // The ProfileInfo // private org.apache.yoko.orb.OCI.ProfileInfo profileInfo_; // // Slot data for the request PICurrent // protected org.omg.CORBA.Any[] currentSlots_; // ------------------------------------------------------------------ // Standard IDL to Java mapping // ------------------------------------------------------------------ // // Returns the target object on which the current request was invoked. // // Client side: // // send_request: yes send_poll: yes receive_reply: yes // receive_exception: yes receive_other: yes // public org.omg.CORBA.Object target() { org.apache.yoko.orb.OB.ObjectFactory factory = orbInstance_ .getObjectFactory(); return factory.createObject(origIOR_); } // // Returns the actual target object on which the current request was // invoked. // // Client side: // // send_request: yes send_poll: yes receive_reply: yes // receive_exception: yes receive_other: yes // public org.omg.CORBA.Object effective_target() { org.apache.yoko.orb.OB.ObjectFactory factory = orbInstance_ .getObjectFactory(); return factory.createObject(IOR_); } // // Returns the profile that will be used to send this request. // // Client side: // // send_request: yes send_poll: yes receive_reply: yes // receive_exception: yes receive_other: yes // public org.omg.IOP.TaggedProfile effective_profile() { for (int i = 0; i < IOR_.profiles.length; i++) if (IOR_.profiles[i].tag == profileInfo_.id) { org.omg.IOP.TaggedProfile result = new org.omg.IOP.TaggedProfile(); result.tag = IOR_.profiles[i].tag; result.profile_data = new byte[IOR_.profiles[i].profile_data.length]; System.arraycopy(IOR_.profiles[i].profile_data, 0, result.profile_data, 0, IOR_.profiles[i].profile_data.length); return result; } // // This shouldn't happen // org.apache.yoko.orb.OB.Assert._OB_assert(false); return null; } // // If the result of the invocation is an exception this is the result. // // Client side: // // send_request: no send_poll: no receive_reply: no // receive_exception: yes receive_other: no // public org.omg.CORBA.Any received_exception() { // // If status is not SYSTEM_EXCEPTION or USER_EXCEPTION then this // is a BAD_INV_ORDER exception // if (status_ != org.omg.PortableInterceptor.SYSTEM_EXCEPTION.value && status_ != org.omg.PortableInterceptor.USER_EXCEPTION.value) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // UnknownUserException? Extract the contained UserException. // org.omg.CORBA.UnknownUserException unk = null; try { unk = (org.omg.CORBA.UnknownUserException) receivedException_; } catch (ClassCastException ex) { } if (unk != null) return unk.except; org.omg.CORBA.Any any = orb_.create_any(); org.apache.yoko.orb.OB.Util.insertException(any, receivedException_); return any; } // // If the result of the invocation is an exception this the // respository id of the exception // // Client side: // // send_request: no send_poll: no receive_reply: no // receive_exception: yes receive_other: no // public String received_exception_id() { // // If status is not SYSTEM_EXCEPTION or USER_EXCEPTION then this // is a BAD_INV_ORDER exception // if (status_ != org.omg.PortableInterceptor.SYSTEM_EXCEPTION.value && status_ != org.omg.PortableInterceptor.USER_EXCEPTION.value) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (receivedId_ == null) receivedId_ = org.apache.yoko.orb.OB.Util .getExceptionId(receivedException_); return receivedId_; } // // Return the TaggedComponent with the given ID in the effective // profile. // // Client side: // // send_request: yes send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // public org.omg.IOP.TaggedComponent get_effective_component(int id) { for (int i = 0; i < profileInfo_.components.length; i++) if (profileInfo_.components[i].tag == id) { org.omg.IOP.TaggedComponent result = new org.omg.IOP.TaggedComponent(); result.tag = profileInfo_.components[i].tag; result.component_data = new byte[profileInfo_.components[i].component_data.length]; System.arraycopy(profileInfo_.components[i].component_data, 0, result.component_data, 0, profileInfo_.components[i].component_data.length); return result; } throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidComponentId) + ": " + id, org.apache.yoko.orb.OB.MinorCodes.MinorInvalidComponentId, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } // // Return all TaggedComponents with the given ID in all profiles. // // Client side: // // send_request: yes send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // public org.omg.IOP.TaggedComponent[] get_effective_components(int id) { throw new org.omg.CORBA.NO_IMPLEMENT(); // TODO: implement this } // // Returns the policy of the given type in effect for this request. // // Client side: // // send_request: yes send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // public org.omg.CORBA.Policy get_request_policy(int type) { for (int i = 0; i < policies_.length; i++) { if (policies_[i].policy_type() == type) { return policies_[i]; } } // if the target policy was not in the current policy list, check to see // if the type has even been registered. If it is valid, return null // to indicate we ain't got one. if (orbInstance_.getPolicyFactoryManager().isPolicyRegistered(type)) { return null; } throw new org.omg.CORBA.INV_POLICY( org.apache.yoko.orb.OB.MinorCodes .describeInvPolicy(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPolicyType), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPolicyType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } // // Add a service context for this request. // // Client side: // // send_request: yes send_poll: no receive_reply: no // receive_exception: no receive_other: no // public void add_request_service_context(org.omg.IOP.ServiceContext sc, boolean addReplace) { // // This isn't valid in any call other than send_request (note that // send_poll isn't currently implemented) // if (status_ >= 0) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); addServiceContext(requestSCL_, sc, addReplace); } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ // // No arguments // public ClientRequestInfo_impl(org.omg.CORBA.ORB orb, int id, String op, boolean responseExpected, org.omg.IOP.IOR IOR, org.omg.IOP.IOR origIOR, org.apache.yoko.orb.OCI.ProfileInfo profileInfo, org.omg.CORBA.Policy[] policies, java.util.Vector requestSCL, java.util.Vector replySCL, org.apache.yoko.orb.OB.ORBInstance orbInstance, Current_impl current) { super(orb, id, op, responseExpected, requestSCL, replySCL, orbInstance, policies, current); IOR_ = IOR; origIOR_ = origIOR; profileInfo_ = profileInfo; argStrategy_ = new ArgumentStrategyNull(orb); status_ = NO_REPLY; currentSlots_ = current_._OB_newSlotTable(); } // // DII style arguments // public ClientRequestInfo_impl(org.omg.CORBA.ORB orb, int id, String op, boolean responseExpected, org.omg.IOP.IOR IOR, org.omg.IOP.IOR origIOR, org.apache.yoko.orb.OCI.ProfileInfo profileInfo, org.omg.CORBA.Policy[] policies, java.util.Vector requestSCL, java.util.Vector replySCL, org.apache.yoko.orb.OB.ORBInstance orbInstance, Current_impl current, org.omg.CORBA.NVList args, org.omg.CORBA.NamedValue result, org.omg.CORBA.ExceptionList exceptions) { super(orb, id, op, responseExpected, requestSCL, replySCL, orbInstance, policies, current); IOR_ = IOR; origIOR_ = origIOR; profileInfo_ = profileInfo; argStrategy_ = new ArgumentStrategyDII(orb, args, result, exceptions); status_ = NO_REPLY; currentSlots_ = current_._OB_newSlotTable(); } // // SII style arguments // public ClientRequestInfo_impl(org.omg.CORBA.ORB orb, int id, String op, boolean responseExpected, org.omg.IOP.IOR IOR, org.omg.IOP.IOR origIOR, org.apache.yoko.orb.OCI.ProfileInfo profileInfo, org.omg.CORBA.Policy[] policies, java.util.Vector requestSCL, java.util.Vector replySCL, org.apache.yoko.orb.OB.ORBInstance orbInstance, Current_impl current, org.apache.yoko.orb.OB.ParameterDesc[] argDesc, org.apache.yoko.orb.OB.ParameterDesc retDesc, org.omg.CORBA.TypeCode[] exceptionTC) { super(orb, id, op, responseExpected, requestSCL, replySCL, orbInstance, policies, current); IOR_ = IOR; origIOR_ = origIOR; profileInfo_ = profileInfo; argStrategy_ = new ArgumentStrategySII(orb, argDesc, retDesc, exceptionTC); status_ = NO_REPLY; currentSlots_ = current_._OB_newSlotTable(); } public void _OB_request(java.util.Vector interceptors) throws org.apache.yoko.orb.OB.LocationForward { // // The PICurrent needs a new set of slot data // slots_ = current_._OB_currentSlotData(); popCurrent_ = true; current_._OB_pushSlotData(currentSlots_); // // The result not available, arguments and exceptions are // available // argStrategy_.setResultAvail(false); argStrategy_.setArgsAvail(true); argStrategy_.setExceptAvail(true); try (CmsfOverride cmsfo = CmsfThreadLocal.override(); YasfOverride yasfo = YasfThreadLocal.override()) { java.util.Enumeration e = interceptors.elements(); while (e.hasMoreElements()) { org.omg.PortableInterceptor.ClientRequestInterceptor interceptor = (org.omg.PortableInterceptor.ClientRequestInterceptor) e .nextElement(); try { interceptor.send_request(this); interceptors_.addElement(interceptor); } catch (org.omg.CORBA.SystemException ex) { status_ = org.omg.PortableInterceptor.SYSTEM_EXCEPTION.value; receivedException_ = ex; _OB_reply(); } catch (org.omg.PortableInterceptor.ForwardRequest ex) { status_ = org.omg.PortableInterceptor.LOCATION_FORWARD.value; org.apache.yoko.orb.CORBA.Delegate p = (org.apache.yoko.orb.CORBA.Delegate) (((org.omg.CORBA.portable.ObjectImpl) ex.forward) ._get_delegate()); forwardReference_ = p._OB_IOR(); _OB_reply(); } } } if (popCurrent_) { popCurrent_ = false; current_._OB_popSlotData(); } } public void _OB_reply() throws org.apache.yoko.orb.OB.LocationForward { if (!popCurrent_) { popCurrent_ = true; current_._OB_pushSlotData(currentSlots_); } try (CmsfOverride cmsfo = CmsfThreadLocal.override(); YasfOverride yasfo = YasfThreadLocal.override()) { int curr = interceptors_.size() - 1; while (!interceptors_.isEmpty()) { try { org.omg.PortableInterceptor.ClientRequestInterceptor i = (org.omg.PortableInterceptor.ClientRequestInterceptor) interceptors_ .elementAt(curr); if (status_ == org.omg.PortableInterceptor.SUCCESSFUL.value) { // // The result, arguments are available // argStrategy_.setResultAvail(true); i.receive_reply(this); } else if (status_ == org.omg.PortableInterceptor.SYSTEM_EXCEPTION.value || status_ == org.omg.PortableInterceptor.USER_EXCEPTION.value) { // // The result, arguments not available // argStrategy_.setResultAvail(false); argStrategy_.setArgsAvail(false); i.receive_exception(this); } else { // // The result, arguments not available // argStrategy_.setResultAvail(false); argStrategy_.setArgsAvail(false); i.receive_other(this); } } catch (org.omg.CORBA.SystemException ex) { status_ = org.omg.PortableInterceptor.SYSTEM_EXCEPTION.value; receivedException_ = ex; receivedId_ = null; } catch (org.omg.PortableInterceptor.ForwardRequest ex) { status_ = org.omg.PortableInterceptor.LOCATION_FORWARD.value; org.apache.yoko.orb.CORBA.Delegate p = (org.apache.yoko.orb.CORBA.Delegate) (((org.omg.CORBA.portable.ObjectImpl) ex.forward) ._get_delegate()); forwardReference_ = p._OB_IOR(); } interceptors_.removeElementAt(curr); --curr; } } // // If a set of slots was provided to the // PortableInterceptor::Current implementation then the slots have // to be popped // if (popCurrent_) { popCurrent_ = false; current_._OB_popSlotData(); } // // Raise the appropriate exception, if necessary. Can't use a // switch statement -- the values are not integer constants // if (status_ == org.omg.PortableInterceptor.SYSTEM_EXCEPTION.value) throw (org.omg.CORBA.SystemException) receivedException_; if (status_ == org.omg.PortableInterceptor.LOCATION_FORWARD.value) throw new org.apache.yoko.orb.OB.LocationForward(forwardReference_, false); } }
6,772
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ServerRequestInfoExt.java
/** * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @version $Rev: 491396 $ $Date: 2006-12-30 22:06:13 -0800 (Sat, 30 Dec 2006) $ */ package org.apache.yoko.orb.PortableInterceptor; import org.omg.PortableInterceptor.ServerRequestInfo; public interface ServerRequestInfoExt extends org.omg.PortableInterceptor.ServerRequestInfo { public org.apache.yoko.orb.OCI.TransportInfo getTransportInfo(); }
6,773
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/RequestInfo_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; import java.util.logging.Level; import java.util.logging.Logger; public class RequestInfo_impl extends org.omg.CORBA.LocalObject implements org.omg.PortableInterceptor.RequestInfo { // the real logger backing instance. We use the interface class as the locator static final Logger logger = Logger.getLogger(RequestInfo_impl.class.getName()); // // The ORB (Java only) // protected org.omg.CORBA.ORB orb_; // // The Request ID // protected int id_; // // The operation name // protected String op_; // // Is this method oneway? // protected boolean responseExpected_; // // ORBacus proprietary status flags // protected final static short NO_REPLY_SC = -2; protected final static short NO_REPLY = -1; // // The reply status // protected short status_; // // The forward reference (if status_ == LOCATION_FORWARD[_PERM] // protected org.omg.IOP.IOR forwardReference_; // // The ORB instance // protected org.apache.yoko.orb.OB.ORBInstance orbInstance_; // // The policies // protected org.omg.CORBA.Policy[] policies_; // // The argument strategy // protected ArgumentStrategy argStrategy_; // // The Request and Reply service context lists // protected java.util.Vector requestSCL_; protected java.util.Vector replySCL_; // // ReceivedException (status_ == [SYSTEM|USER]_EXCEPTION) // protected Exception receivedException_; protected String receivedId_; // // Slot data for the request // protected org.omg.CORBA.Any[] slots_; // // A pointer to the PortableInterceptor::Current implementation // protected Current_impl current_; // // Does the slot data need to be popped in the current // implementation? // protected boolean popCurrent_; // ------------------------------------------------------------------ // Private member implementations // ------------------------------------------------------------------ private org.omg.IOP.ServiceContext copyServiceContext( org.omg.IOP.ServiceContext sc) { org.omg.IOP.ServiceContext result = new org.omg.IOP.ServiceContext(); result.context_id = sc.context_id; result.context_data = new byte[sc.context_data.length]; System.arraycopy(sc.context_data, 0, result.context_data, 0, sc.context_data.length); return result; } // ------------------------------------------------------------------ // Protected member implementations // ------------------------------------------------------------------ protected org.omg.IOP.ServiceContext getServiceContext(java.util.Vector l, int id) { for (int i = 0; i < l.size(); i++) { org.omg.IOP.ServiceContext sc = (org.omg.IOP.ServiceContext) l.elementAt(i); if (sc.context_id == id) { return copyServiceContext(sc); } } throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidServiceContextId) + ": " + id, org.apache.yoko.orb.OB.MinorCodes.MinorInvalidServiceContextId, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } protected void addServiceContext(java.util.Vector l, org.omg.IOP.ServiceContext sc, boolean addReplace) { // // It would be possible to use a hashtable internally for this // instead of a sequence. However, the additional overhead isn't // worth the effort. // for (int i = 0; i < l.size(); i++) { org.omg.IOP.ServiceContext c = (org.omg.IOP.ServiceContext) l.elementAt(i); if (c.context_id == sc.context_id) { if (!addReplace) { throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorServiceContextExists) + ": " + sc.context_id, org.apache.yoko.orb.OB.MinorCodes.MinorServiceContextExists, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } l.setElementAt(copyServiceContext(sc), i); return; } } l.addElement(copyServiceContext(sc)); } // ------------------------------------------------------------------ // Standard IDL to Java mapping // ------------------------------------------------------------------ // // The ID uniquely identifies an active request/reply sequence. // // Client side: // // send_request: yes send_poll: yes receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public int request_id() { return id_; } // // The operation being invoked. // // Client side: // // send_request: yes send_poll: yes receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public String operation() { return op_; } // // A Dynamic::ParameterList containing the arguments on the operation // being invoked. // // Client side: // // send_request: yes send_poll: no receive_reply: yes // receive_exception: no receive_other: no // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: no send_other: no // // TODO: verify server side against final document // public org.omg.Dynamic.Parameter[] arguments() { return argStrategy_.arguments(); } // // A Dynamic::ExceptionList containing the exceptions that this invocation // may raise. // // Client side: // // send_request: yes send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: no send_other: no // // TODO: verify server side against final document // public org.omg.CORBA.TypeCode[] exceptions() { return argStrategy_.exceptions(); } // // A Dynamic::ContextList describing the contexts that may be passed // on this invocation. // // Client side: // // send_request: yes send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: no send_other: no // // TODO: verify server side against final document // public String[] contexts() { throw new org.omg.CORBA.NO_IMPLEMENT(); // TODO: Implement } // // A Dynamic::Context describing the contexts being send on the // request. // // Client side: // // send_request: yes send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: no receive_request: yes // send_reply: yes send_exception: no send_other: no // // TODO: verify server side against final document // public String[] operation_context() { throw new org.omg.CORBA.NO_IMPLEMENT(); // TODO: Implement } // // The result of the method invocation. tk_void if the result type is // void // // Client side: // // send_request: no send_poll: no receive_reply: yes // receive_exception: no receive_other: no // // Server side: // // receive_request_service_contexts: no receive_request: no // send_reply: yes send_exception: no send_other: no // public org.omg.CORBA.Any result() { return argStrategy_.result(); } // // Indicates whether there is a response expected for this request. // // Client side: // // send_request: yes send_poll: yes receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public boolean response_expected() { return responseExpected_; } // // Indicates whether there is a response expected for this request. // // Client side: // // send_request: yes send_poll: yes receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public short sync_scope() { throw new org.omg.CORBA.NO_IMPLEMENT(); // TODO: Implement } // // Describes the state of the result of the request. // // Client side: // // send_request: no send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: no receive_request: no // send_reply: yes send_exception: yes send_other: yes // public short reply_status() { // // This cannot be called in send_poll, send_request or // receive_request_service_context, receive_request // if (status_ < 0) { throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return status_; } // // Contains the result of a location forward. // // Client side: // // send_request: no send_poll: no receive_reply: no // receive_exception: no receive_other: yes // // Server side: // // receive_request_service_contexts: no receive_request: no // send_reply: no send_exception: no send_other: yes // public org.omg.CORBA.Object forward_reference() { // // This can only be called if the status is location forward // or location forward perm // if (status_ != org.omg.PortableInterceptor.LOCATION_FORWARD.value) { throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } org.apache.yoko.orb.OB.Assert._OB_assert(forwardReference_ != null); return orbInstance_.getObjectFactory().createObject(forwardReference_); } // // Get the data from the slot table with the provided id. // // Client side: // // send_request: yes send_poll: yes receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public org.omg.CORBA.Any get_slot(int id) throws org.omg.PortableInterceptor.InvalidSlot { if (id >= slots_.length) { throw new org.omg.PortableInterceptor.InvalidSlot(); } logger.fine("getting slot " + id + " for operation " + op_); org.omg.CORBA.Any result = orb_.create_any(); if (slots_[id] != null) { result.read_value(slots_[id].create_input_stream(), slots_[id].type()); } return result; } // // Return a copy of the service context with the given id. // // Client side: // // send_request: yes send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: yes receive_request: yes // send_reply: yes send_exception: yes send_other: yes // public org.omg.IOP.ServiceContext get_request_service_context(int id) { return getServiceContext(requestSCL_, id); } // // Return a copy of the service context with the given id. // // Client side: // // send_request: no send_poll: no receive_reply: yes // receive_exception: yes receive_other: yes // // Server side: // // receive_request_service_contexts: no receive_request: no // send_reply: yes send_exception: yes send_other: yes // public org.omg.IOP.ServiceContext get_reply_service_context(int id) { if (status_ < 0) { throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return getServiceContext(replySCL_, id); } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ // // No argument information available // protected RequestInfo_impl(org.omg.CORBA.ORB orb, int id, String op, boolean responseExpected, java.util.Vector requestSCL, java.util.Vector replySCL, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.Policy[] policies, Current_impl current) { orb_ = orb; // Java only id_ = id; op_ = op; responseExpected_ = responseExpected; orbInstance_ = orbInstance; policies_ = policies; requestSCL_ = requestSCL; replySCL_ = replySCL; current_ = current; } public void _OB_setReplyStatus(short status) { status_ = status; } public void _OB_setForwardReference(org.omg.IOP.IOR ior) { org.apache.yoko.orb.OB.Assert ._OB_assert(status_ == org.omg.PortableInterceptor.LOCATION_FORWARD.value); forwardReference_ = ior; } public void _OB_setReceivedException(Exception ex, String id) { // // id may be null // // TODO: // org.apache.yoko.orb.OB.Assert._OB_assert(receivedException_ == null); receivedException_ = ex; receivedId_ = id; } }
6,774
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ArgumentStrategy.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; abstract class ArgumentStrategy { protected org.omg.CORBA.ORB orb_; // Java only // // Are arguments available? // protected boolean argsAvail_; // // Is the result available? // protected boolean resultAvail_; // // Are exceptions available? // protected boolean exceptAvail_; // // Are exceptions never available? // protected boolean exceptNeverAvail_; ArgumentStrategy(org.omg.CORBA.ORB orb) { orb_ = orb; argsAvail_ = false; resultAvail_ = false; exceptAvail_ = false; exceptNeverAvail_ = false; } // // Get the arguments // abstract org.omg.Dynamic.Parameter[] arguments(); // // Get the exceptions // abstract org.omg.CORBA.TypeCode[] exceptions(); // // Get the result // abstract org.omg.CORBA.Any result(); // // Set the result (server side only) // abstract void setResult(org.omg.CORBA.Any any); // // Are the args available? // void setArgsAvail(boolean v) { argsAvail_ = v; } // // Are the exceptions available? // void setExceptAvail(boolean v) { exceptAvail_ = v; } // // Exceptions are never available // void setExceptNeverAvail() { exceptNeverAvail_ = true; } // // Is the result available? // void setResultAvail(boolean v) { resultAvail_ = v; } }
6,775
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/IORInfo_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; import org.apache.yoko.orb.OBPortableServer.POAPolicies; final public class IORInfo_impl extends org.omg.CORBA.LocalObject implements org.omg.PortableInterceptor.IORInfo { private org.apache.yoko.orb.OCI.Acceptor[] acceptors_; private java.util.Hashtable table_; private java.util.Vector all_; private org.omg.CORBA.Policy[] policies_; private org.apache.yoko.orb.OBPortableServer.POAPolicies poaPolicies_; private org.omg.PortableInterceptor.ObjectReferenceTemplate adapterTemplate_; private org.omg.PortableInterceptor.ObjectReferenceFactory currentFactory_; private String id_; private short state_; // // The ORB instance // protected org.apache.yoko.orb.OB.ORBInstance orbInstance_; public IORInfo_impl(org.apache.yoko.orb.OB.ORBInstance orbInstance, org.apache.yoko.orb.OCI.Acceptor[] acceptors, org.omg.CORBA.Policy[] policies, POAPolicies poaPolicies, String id, short state) { table_ = new java.util.Hashtable(); all_ = new java.util.Vector(); orbInstance_ = orbInstance; acceptors_ = acceptors; policies_ = policies; poaPolicies_ = poaPolicies; id_ = id; state_ = state; // // Add an entry to the component table for each acceptor // for (int i = 0; i < acceptors.length; ++i) table_.put(new Integer(acceptors[i].tag()), new java.util.Vector()); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.CORBA.Policy get_effective_policy(int type) { for (int i = 0; i < policies_.length; i++) { if (policies_[i].policy_type() == type) { return policies_[i]; } } // if the target policy was not in the current policy list, check to see // if the type has even been registered. If it is valid, return null // to indicate we ain't got one. if (orbInstance_.getPolicyFactoryManager().isPolicyRegistered(type)) { return null; } throw new org.omg.CORBA.INV_POLICY( org.apache.yoko.orb.OB.MinorCodes .describeInvPolicy(org.apache.yoko.orb.OB.MinorCodes.MinorNoPolicyFactory) + ": " + type, org.apache.yoko.orb.OB.MinorCodes.MinorNoPolicyFactory, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } public void add_ior_component(org.omg.IOP.TaggedComponent data) { all_.addElement(data); } public void add_ior_component_to_profile(org.omg.IOP.TaggedComponent data, int id) { java.util.Vector profile = (java.util.Vector) table_ .get(new Integer(id)); if (profile == null) throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidProfileId) + ": " + id, org.apache.yoko.orb.OB.MinorCodes.MinorInvalidProfileId, org.omg.CORBA.CompletionStatus.COMPLETED_NO); profile.addElement(data); } public org.omg.PortableInterceptor.ObjectReferenceTemplate adapter_template() { if (adapterTemplate_ == null) throw new org.omg.CORBA.BAD_INV_ORDER(); return adapterTemplate_; } public org.omg.PortableInterceptor.ObjectReferenceFactory current_factory() { return currentFactory_; } public void current_factory( org.omg.PortableInterceptor.ObjectReferenceFactory currentFactory) { currentFactory_ = currentFactory; } public String manager_id() { return id_; } public short state() { return state_; } public void _OB_adapterTemplate( org.omg.PortableInterceptor.ObjectReferenceTemplate adapterTemplate) { org.apache.yoko.orb.OB.Assert._OB_assert(adapterTemplate_ == null); adapterTemplate_ = adapterTemplate; } public void _OB_state(short state) { state_ = state; } public void _OB_addComponents(org.omg.IOP.IORHolder ior, org.omg.GIOP.Version version) { org.apache.yoko.orb.OCI.ProfileInfo profileInfo = new org.apache.yoko.orb.OCI.ProfileInfo(); profileInfo.major = version.major; profileInfo.minor = version.minor; profileInfo.key = "".getBytes(); for (int i = 0; i < acceptors_.length; ++i) { // // Collect the components to be supplied to add_profiles(). // We start with the generic components (allComponents_), and // may have to append components specific to this acceptor's // profile tag. // Integer ikey = new Integer(acceptors_[i].tag()); java.util.Vector components = (java.util.Vector) table_.get(ikey); if (!components.isEmpty()) { int len = all_.size() + components.size(); profileInfo.components = new org.omg.IOP.TaggedComponent[len]; int j; for (j = 0; j < all_.size(); j++) profileInfo.components[j] = (org.omg.IOP.TaggedComponent) all_ .elementAt(j); for (j = 0; j < components.size(); j++) profileInfo.components[all_.size() + j] = (org.omg.IOP.TaggedComponent) components .elementAt(j); } else { profileInfo.components = new org.omg.IOP.TaggedComponent[all_ .size()]; for (int j = 0; j < all_.size(); j++) profileInfo.components[j] = (org.omg.IOP.TaggedComponent) all_ .elementAt(j); } acceptors_[i].add_profiles(profileInfo, poaPolicies_, ior); } } }
6,776
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/PortableInterceptor/ArgumentStrategyDII.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.PortableInterceptor; final class ArgumentStrategyDII extends ArgumentStrategy { protected org.omg.CORBA.NVList args_; protected org.omg.CORBA.NamedValue result_; protected org.omg.CORBA.ExceptionList exceptions_; protected org.omg.CORBA.Any resultAny_; // ------------------------------------------------------------------ // ArgumentStrategyDII package member implementations // ------------------------------------------------------------------ ArgumentStrategyDII(org.omg.CORBA.ORB orb, org.omg.CORBA.NVList args, org.omg.CORBA.NamedValue result, org.omg.CORBA.ExceptionList exceptions) { super(orb); args_ = args; result_ = result; exceptions_ = exceptions; } ArgumentStrategyDII(org.omg.CORBA.ORB orb, org.omg.CORBA.NVList args) { super(orb); args_ = args; } // // Get the arguments // org.omg.Dynamic.Parameter[] arguments() { if (!argsAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall), org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); org.omg.Dynamic.Parameter[] pl; int count; if (args_ != null) count = args_.count(); else count = 0; pl = new org.omg.Dynamic.Parameter[count]; for (int i = 0; i < count; i++) { pl[i] = new org.omg.Dynamic.Parameter(); pl[i].argument = orb_.create_any(); org.omg.CORBA.NamedValue v = null; try { v = args_.item(i); } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } switch (v.flags()) { case org.omg.CORBA.ARG_IN.value: pl[i].mode = org.omg.CORBA.ParameterMode.PARAM_IN; pl[i].argument.read_value(v.value().create_input_stream(), v .value().type()); break; case org.omg.CORBA.ARG_OUT.value: pl[i].mode = org.omg.CORBA.ParameterMode.PARAM_OUT; // // The value may only be copied if there is a successful // response // if (resultAvail_) pl[i].argument.read_value(v.value().create_input_stream(), v.value().type()); break; case org.omg.CORBA.ARG_INOUT.value: pl[i].mode = org.omg.CORBA.ParameterMode.PARAM_INOUT; pl[i].argument.read_value(v.value().create_input_stream(), v .value().type()); break; default: org.apache.yoko.orb.OB.Assert._OB_assert(false); } } return pl; } // // Get the exceptions // org.omg.CORBA.TypeCode[] exceptions() { // // If exceptions are never available then this indicates a // NO_RESOURCES exception // if (exceptNeverAvail_) throw new org.omg.CORBA.NO_RESOURCES( org.apache.yoko.orb.OB.MinorCodes .describeNoResources(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidBinding) + ": exceptions unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidBinding, org.omg.CORBA.CompletionStatus.COMPLETED_NO); if (!exceptAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall) + ": exceptions unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); org.omg.CORBA.TypeCode[] e; int count; if (exceptions_ != null) count = exceptions_.count(); else count = 0; e = new org.omg.CORBA.TypeCode[count]; for (int i = 0; i < count; i++) { try { e[i] = exceptions_.item(i); } catch (org.omg.CORBA.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } return e; } // // Get the result // org.omg.CORBA.Any result() { if (!resultAvail_) throw new org.omg.CORBA.BAD_INV_ORDER( org.apache.yoko.orb.OB.MinorCodes .describeBadInvOrder(org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall) + ": result unavailable", org.apache.yoko.orb.OB.MinorCodes.MinorInvalidPICall, org.omg.CORBA.CompletionStatus.COMPLETED_NO); org.omg.CORBA.Any any = orb_.create_any(); if (resultAny_ != null) { any.read_value(resultAny_.create_input_stream(), resultAny_.type()); } else if (result_ == null) { any.type(orb_.get_primitive_tc(org.omg.CORBA.TCKind.tk_void)); } else { any.read_value(result_.value().create_input_stream(), result_ .value().type()); } return any; } // // Set the result (server side only) // void setResult(org.omg.CORBA.Any any) { resultAny_ = orb_.create_any(); resultAny_.read_value(any.create_input_stream(), any.type()); } }
6,777
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBCORBA/PollableSet_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBCORBA; public class PollableSet_impl extends org.omg.CORBA.LocalObject implements org.omg.CORBA.PollableSet { // // List of pollable objects in this set // protected java.util.LinkedList pollableList_ = new java.util.LinkedList(); // // Constructor // public PollableSet_impl() { } // // IDL:omg.org/CORBA/PollableSet/create_dii_pollable:1.0 // public org.omg.CORBA.DIIPollable create_dii_pollable() { throw new org.omg.CORBA.NO_IMPLEMENT(); } // // IDL:omg.org/CORBA/PollableSet/add_pollable:1.0 // public void add_pollable(org.omg.CORBA.Pollable potential) { org.apache.yoko.orb.OB.Assert._OB_assert(potential != null); pollableList_.addLast(potential); } // // IDL:omg.org/CORBA/PollableSet/get_ready_pollable:1.0 // public org.omg.CORBA.Pollable get_ready_pollable(int timeout) throws org.omg.CORBA.PollableSetPackage.NoPossiblePollable, org.omg.CORBA.SystemException { if (pollableList_.size() == 0) throw new org.omg.CORBA.PollableSetPackage.NoPossiblePollable(); // // try to return a pollable item in the timeout specified // while (true) { // // starting time of query // long start_time = System.currentTimeMillis(); // // are there any pollables ready? // java.util.ListIterator iter = pollableList_.listIterator(0); while (iter.hasNext()) { org.omg.CORBA.Pollable pollable = (org.omg.CORBA.Pollable) iter .next(); if (pollable.is_ready(0)) { iter.remove(); return pollable; } } // // none are ready yet so we need to block on the // OrbAsyncHandler until a new response is received or throw // a NO_RESPONSE if there is no timeout specified // if (timeout == 0) throw new org.omg.CORBA.NO_RESPONSE(); // // Yield for now to give another thread a timeslice // Thread.yield(); // // just return if timeout is INFINITE // if (timeout == -1) continue; // // the ending time of the query // long end_time = System.currentTimeMillis(); // // subtract difference in time from the timeout value // long diff_time = end_time - start_time; if (diff_time > timeout) timeout = 0; else timeout -= diff_time; // // check if all the time has now expired // if (timeout == 0) throw new org.omg.CORBA.TIMEOUT(); } } // // IDL:omg.org/CORBA/PollableSet/remove:1.0 // public void remove(org.omg.CORBA.Pollable potential) throws org.omg.CORBA.PollableSetPackage.UnknownPollable { org.apache.yoko.orb.OB.Assert._OB_assert(potential != null); // // iterate the list, looking for a match // java.util.ListIterator iter = pollableList_.listIterator(0); while (iter.hasNext()) { if (potential == iter.next()) { iter.remove(); return; } } // // never found the item // throw new org.omg.CORBA.PollableSetPackage.UnknownPollable(); } // // IDL:omg.org/CORBA/PollableSet/number_left:1.0 // public short number_left() { return (short) pollableList_.size(); } }
6,778
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBCORBA/ORBSingleton_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBCORBA; // This class must be public public class ORBSingleton_impl extends org.omg.CORBA_2_4.ORB { // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String[] list_initial_services() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Object resolve_initial_references(String name) throws org.omg.CORBA.ORBPackage.InvalidName { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void register_initial_reference(String name, org.omg.CORBA.Object obj) throws org.omg.CORBA.ORBPackage.InvalidName { throw new org.omg.CORBA.NO_IMPLEMENT(); } public String object_to_string(org.omg.CORBA.Object object) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Object string_to_object(String str) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.NVList create_list(int count) { throw new org.omg.CORBA.NO_IMPLEMENT(); } /** * @deprecated Deprecated by CORBA 2.3. */ public org.omg.CORBA.NVList create_operation_list( org.omg.CORBA.OperationDef oper) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.NVList create_operation_list(org.omg.CORBA.Object oper) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.NamedValue create_named_value(String name, org.omg.CORBA.Any value, int flags) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.ExceptionList create_exception_list() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.ContextList create_context_list() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Context get_default_context() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Environment create_environment() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void send_multiple_requests_oneway(org.omg.CORBA.Request[] requests) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void send_multiple_requests_deferred(org.omg.CORBA.Request[] requests) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public boolean poll_next_response() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Request get_next_response() throws org.omg.CORBA.WrongTransaction { throw new org.omg.CORBA.NO_IMPLEMENT(); } final public org.omg.CORBA.TypeCode create_struct_tc(String id, String name, org.omg.CORBA.StructMember[] members) { return org.apache.yoko.orb.OB.TypeCodeFactory.createStructTC(id, name, members); } final public org.omg.CORBA.TypeCode create_union_tc(String id, String name, org.omg.CORBA.TypeCode discriminator_type, org.omg.CORBA.UnionMember[] members) { return org.apache.yoko.orb.OB.TypeCodeFactory.createUnionTC(id, name, discriminator_type, members); } final public org.omg.CORBA.TypeCode create_enum_tc(String id, String name, String[] members) { return org.apache.yoko.orb.OB.TypeCodeFactory.createEnumTC(id, name, members); } final public org.omg.CORBA.TypeCode create_alias_tc(String id, String name, org.omg.CORBA.TypeCode original_type) { return org.apache.yoko.orb.OB.TypeCodeFactory.createAliasTC(id, name, original_type); } final public org.omg.CORBA.TypeCode create_exception_tc(String id, String name, org.omg.CORBA.StructMember[] members) { return org.apache.yoko.orb.OB.TypeCodeFactory.createExceptionTC(id, name, members); } final public org.omg.CORBA.TypeCode create_interface_tc(String id, String name) { return org.apache.yoko.orb.OB.TypeCodeFactory.createInterfaceTC(id, name); } final public org.omg.CORBA.TypeCode create_string_tc(int bound) { return org.apache.yoko.orb.OB.TypeCodeFactory.createStringTC(bound); } final public org.omg.CORBA.TypeCode create_wstring_tc(int bound) { return org.apache.yoko.orb.OB.TypeCodeFactory.createWStringTC(bound); } final public org.omg.CORBA.TypeCode create_fixed_tc(short digits, short scale) { return org.apache.yoko.orb.OB.TypeCodeFactory.createFixedTC(digits, scale); } final public org.omg.CORBA.TypeCode create_sequence_tc(int bound, org.omg.CORBA.TypeCode element_type) { return org.apache.yoko.orb.OB.TypeCodeFactory.createSequenceTC(bound, element_type); } /** * @deprecated */ final public org.omg.CORBA.TypeCode create_recursive_sequence_tc(int bound, int offset) { return org.apache.yoko.orb.OB.TypeCodeFactory .createRecursiveSequenceTC(bound, offset); } final public org.omg.CORBA.TypeCode create_array_tc(int length, org.omg.CORBA.TypeCode element_type) { return org.apache.yoko.orb.OB.TypeCodeFactory.createArrayTC(length, element_type); } final public org.omg.CORBA.TypeCode create_value_tc(String id, String name, short type_modifier, org.omg.CORBA.TypeCode concrete_base, org.omg.CORBA.ValueMember[] members) { return org.apache.yoko.orb.OB.TypeCodeFactory.createValueTC(id, name, type_modifier, concrete_base, members); } final public org.omg.CORBA.TypeCode create_value_box_tc(String id, String name, org.omg.CORBA.TypeCode boxed_type) { return org.apache.yoko.orb.OB.TypeCodeFactory.createValueBoxTC(id, name, boxed_type); } final public org.omg.CORBA.TypeCode create_native_tc(String id, String name) { return org.apache.yoko.orb.OB.TypeCodeFactory.createNativeTC(id, name); } final public org.omg.CORBA.TypeCode create_recursive_tc(String id) { return org.apache.yoko.orb.OB.TypeCodeFactory.createRecursiveTC(id); } final public org.omg.CORBA.TypeCode create_abstract_interface_tc(String id, String name) { return org.apache.yoko.orb.OB.TypeCodeFactory .createAbstractInterfaceTC(id, name); } final public org.omg.CORBA.TypeCode create_local_interface_tc(String id, String name) { return org.apache.yoko.orb.OB.TypeCodeFactory.createLocalInterfaceTC( id, name); } final public org.omg.CORBA.TypeCode get_primitive_tc( org.omg.CORBA.TCKind kind) { return org.apache.yoko.orb.OB.TypeCodeFactory.createPrimitiveTC(kind); } public boolean work_pending() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void perform_work() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void run() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void shutdown(boolean wait_for_completion) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void destroy() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Any create_any() { return new org.apache.yoko.orb.CORBA.Any(_OB_ORBInstance()); } public org.omg.CORBA.portable.OutputStream create_output_stream() { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void connect(org.omg.CORBA.Object obj) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public void disconnect(org.omg.CORBA.Object obj) { throw new org.omg.CORBA.NO_IMPLEMENT(); } public org.omg.CORBA.Policy create_policy(int policy_type, org.omg.CORBA.Any val) throws org.omg.CORBA.PolicyError { throw new org.omg.CORBA.NO_IMPLEMENT(); } protected void set_parameters(String[] args, java.util.Properties props) { throw new org.omg.CORBA.NO_IMPLEMENT(); } protected void set_parameters(java.applet.Applet app, java.util.Properties props) { throw new org.omg.CORBA.NO_IMPLEMENT(); } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ORBSingleton_impl() { } public org.apache.yoko.orb.OB.ORBInstance _OB_ORBInstance() { return null; } }
6,779
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBCORBA/ORB_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBCORBA; import java.security.AccessController; import java.util.Properties; import org.apache.yoko.orb.cmsf.CmsfClientInterceptor; import org.apache.yoko.orb.cmsf.CmsfIORInterceptor; import org.apache.yoko.orb.cmsf.CmsfServerInterceptor; import org.apache.yoko.orb.util.AutoLock; import org.apache.yoko.orb.util.AutoReadWriteLock; import org.apache.yoko.orb.util.GetSystemPropertyAction; import org.apache.yoko.orb.yasf.YasfClientInterceptor; import org.apache.yoko.orb.yasf.YasfIORInterceptor; import org.apache.yoko.orb.yasf.YasfServerInterceptor; import org.apache.yoko.osgi.ProviderLocator; import org.omg.CORBA.OBJECT_NOT_EXIST; // This class must be public and not final public class ORB_impl extends org.apache.yoko.orb.CORBA.ORBSingleton { // // All registered ORBInitializers // private java.util.Hashtable orbInitializers_ = new java.util.Hashtable(); // // The ORB Control // private org.apache.yoko.orb.OB.ORBControl orbControl_; // // Has the ORB been destroyed? // private final AutoReadWriteLock destroyLock_ = new AutoReadWriteLock(); private boolean destroy_; // // The OCI Plugin Manager // private org.apache.yoko.orb.OB.PluginManager pluginManager_; // // The ORBInstance object // private org.apache.yoko.orb.OB.ORBInstance orbInstance_; // // Default set of policies // private java.util.Vector policies_ = new java.util.Vector(); // // The ORB option filter // private static org.apache.yoko.orb.OB.OptionFilter orbOptionFilter_; // // The OA option filter // private static org.apache.yoko.orb.OB.OptionFilter oaOptionFilter_; // // Whether DII operations should raise system exceptions // private boolean raiseDIIExceptions_ = true; // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ // // This method does most of the ORB initialization that would // normally be done in the constructor. However, the constructor // cannot perform these steps because some of the initialization // requires that the command-line options and properties have // already been processed, which doesn't occur until set_parameters // is called. // private void initialize(org.omg.CORBA.StringSeqHolder args, String orbId, String serverId, String serverInstance, int concModel, org.apache.yoko.orb.OB.CoreTraceLevels coreTraceLevels, java.util.Properties properties, org.apache.yoko.orb.OB.Logger logger, int nativeCs, int nativeWcs, int defaultWcs) { String javaVersion = getSystemProperty("java.version"); float version = Float.parseFloat(javaVersion.substring(0, 3)); if (version < 1.3f) { throw new org.omg.CORBA.INITIALIZE("Unsupported Java version: " + version); } try (AutoLock writeLock = destroyLock_.getWriteLock()) { destroy_ = false; // // Create the ORBControl // orbControl_ = new org.apache.yoko.orb.OB.ORBControl(); // // Create the OCI Plugin Manager // pluginManager_ = new org.apache.yoko.orb.OB.PluginManager(this); // // Create the ORBInstance object // // org.apache.yoko.orb.OB.InitialServiceManager initServiceManager = new org.apache.yoko.orb.OB.InitialServiceManager(); org.apache.yoko.orb.OB.ClientManager clientManager = new org.apache.yoko.orb.OB.ClientManager( concModel); org.apache.yoko.orb.OB.ObjectFactory objectFactory = new org.apache.yoko.orb.OB.ObjectFactory(); org.apache.yoko.orb.OB.PolicyFactoryManager pfManager = new org.apache.yoko.orb.OB.PolicyFactoryManager(); org.apache.yoko.orb.OB.PIManager piManager = new org.apache.yoko.orb.OB.PIManager( this); org.apache.yoko.orb.OB.ValueFactoryManager valueFactoryManager = new org.apache.yoko.orb.OB.ValueFactoryManager(); org.apache.yoko.orb.IOP.CodecFactory_impl codecFactory = new org.apache.yoko.orb.IOP.CodecFactory_impl(); org.apache.yoko.orb.OBPortableServer.POAManagerFactory_impl pmFactory = new org.apache.yoko.orb.OBPortableServer.POAManagerFactory_impl(); org.apache.yoko.orb.OB.MultiRequestSender multiRequestSender = new org.apache.yoko.orb.OB.MultiRequestSender(); org.apache.yoko.orb.OB.DispatchStrategyFactory_impl dsf = new org.apache.yoko.orb.OB.DispatchStrategyFactory_impl(); org.apache.yoko.orb.OB.BootManager_impl bootManager = new org.apache.yoko.orb.OB.BootManager_impl(this); org.apache.yoko.orb.OCI.ConFactoryRegistry conFactoryRegistry = new org.apache.yoko.orb.OCI.ConFactoryRegistry_impl(); org.apache.yoko.orb.OCI.AccFactoryRegistry accFactoryRegistry = new org.apache.yoko.orb.OCI.AccFactoryRegistry_impl(); org.apache.yoko.orb.OB.UnknownExceptionStrategy unknownExceptionStrategy = new org.apache.yoko.orb.OB.UnknownExceptionStrategy_impl( this); org.apache.yoko.orb.OB.URLRegistry_impl urlRegistry = new org.apache.yoko.orb.OB.URLRegistry_impl(); orbInstance_ = new org.apache.yoko.orb.OB.ORBInstance(this, orbId, serverId, serverInstance, objectFactory, clientManager, pfManager, piManager, initServiceManager, valueFactoryManager, codecFactory, pmFactory, multiRequestSender, properties, dsf, bootManager, logger, coreTraceLevels, conFactoryRegistry, accFactoryRegistry, unknownExceptionStrategy, urlRegistry, nativeCs, nativeWcs, defaultWcs); objectFactory.setORBInstance(orbInstance_); initServiceManager.setORBInstance(orbInstance_); pmFactory._OB_setORBInstance(orbInstance_); piManager.setORBInstance(orbInstance_); codecFactory._OB_setORBInstance(orbInstance_); clientManager.setORBInstance(orbInstance_); dsf._OB_setORBInstance(orbInstance_); try { urlRegistry .add_scheme(new org.apache.yoko.orb.OB.IORURLScheme_impl( orbInstance_)); urlRegistry .add_scheme(new org.apache.yoko.orb.OB.FileURLScheme_impl( false, urlRegistry)); urlRegistry .add_scheme(new org.apache.yoko.orb.OB.FileURLScheme_impl( true, urlRegistry)); urlRegistry .add_scheme(new org.apache.yoko.orb.OB.CorbalocURLScheme_impl( orbInstance_)); urlRegistry .add_scheme(new org.apache.yoko.orb.OB.CorbanameURLScheme_impl( this, urlRegistry)); } catch (org.apache.yoko.orb.OB.URLRegistryPackage.SchemeAlreadyExists ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } // // Set the ORBInstance on the ORBControl // orbControl_.setORBInstance(orbInstance_); // // Initialize default policies // initializeDefaultPolicies(); // // Create the DynamicAny::DynAnyFactory object // org.omg.DynamicAny.DynAnyFactory dynAnyFactory = new org.apache.yoko.orb.DynamicAny.DynAnyFactory_impl( orbInstance_); // // Add initial references // try { initServiceManager.addInitialReference("POAManagerFactory", pmFactory); initServiceManager.addInitialReference("DynAnyFactory", dynAnyFactory); initServiceManager.addInitialReference("CodecFactory", codecFactory); initServiceManager.addInitialReference( "DispatchStrategyFactory", dsf); initServiceManager.addInitialReference("BootManager", bootManager); initServiceManager.addInitialReference("RootPOA", null); // Dummy initServiceManager.addInitialReference("OCIConFactoryRegistry", conFactoryRegistry); initServiceManager.addInitialReference("OCIAccFactoryRegistry", accFactoryRegistry); initServiceManager.addInitialReference("URLRegistry", urlRegistry); } catch (org.omg.CORBA.ORBPackage.InvalidName ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } // // Initialize the OCI client plug-ins // { String prop = properties.getProperty("yoko.oci.client"); if (prop == null) prop = "iiop"; int pos = 0; while (pos != -1) { java.util.Vector paramList = new java.util.Vector(); pos = org.apache.yoko.orb.OB.ParseParams.parse(prop, pos, paramList); String name = (String) paramList.firstElement(); paramList.removeElementAt(0); String[] params = new String[paramList.size()]; paramList.copyInto(params); org.apache.yoko.orb.OCI.Plugin plugin = pluginManager_ .initPlugin(name, args); if (plugin == null) { String err = "OCI client initialization failed " + "for `" + name + "'"; throw new org.omg.CORBA.INITIALIZE(err); } else plugin.init_client(params); } } // // Initialize the OCI server plug-ins // { String prop = properties.getProperty("yoko.oci.server"); if (prop == null) prop = "iiop"; int pos = 0; while (pos != -1) { java.util.Vector paramList = new java.util.Vector(); pos = org.apache.yoko.orb.OB.ParseParams.parse(prop, pos, paramList); String name = (String) paramList.firstElement(); paramList.removeElementAt(0); String[] params = new String[paramList.size()]; paramList.copyInto(params); org.apache.yoko.orb.OCI.Plugin plugin = pluginManager_ .initPlugin(name, args); if (plugin == null) { String err = "OCI server initialization failed " + "for `" + name + "'"; throw new org.omg.CORBA.INITIALIZE(err); } else plugin.init_server(params); } } // // Initialize Portable Interceptors - this must be done after // installing the OCI plug-ins to allow an ORBInitializer // or interceptor to make a remote invocation // // // Install IOR interceptor for code sets // try { piManager.addIORInterceptor( new org.apache.yoko.orb.OB.CodeSetIORInterceptor_impl( nativeCs, nativeWcs), false); } catch (org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } // // Install interceptors for Yoko Auxilliary Stream Format // try { piManager.addIORInterceptor(new YasfIORInterceptor(), true); piManager.addClientRequestInterceptor(new YasfClientInterceptor()); piManager.addServerRequestInterceptor(new YasfServerInterceptor(piManager.allocateSlotId())); } catch (org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } // // Install interceptors for Custom Marshal Stream Format negotiation // try { piManager.addIORInterceptor(new CmsfIORInterceptor(), false); piManager.addClientRequestInterceptor(new CmsfClientInterceptor()); piManager.addServerRequestInterceptor(new CmsfServerInterceptor(piManager.allocateSlotId())); } catch (org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } // // Install IOR interceptor for Message Routing // try { // // Get the router list from configuration data // org.omg.MessageRouting.RouterListHolder routerListHolder = new org.omg.MessageRouting.RouterListHolder(); routerListHolder.value = new org.omg.MessageRouting.Router[0]; org.apache.yoko.orb.OB.MessageRoutingUtil .getRouterListFromConfig(orbInstance_, routerListHolder); piManager .addIORInterceptor( new org.apache.yoko.orb.OB.MessageRoutingIORInterceptor_impl( routerListHolder.value), false); } catch (org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } // // Register the valuetype factory for ExceptionHolders // org.omg.CORBA.portable.ValueFactory exhFactory = new org.apache.yoko.orb.OBMessaging.ExceptionHolderFactory_impl(); valueFactoryManager.registerValueFactory( "IDL:omg.org/Messaging/ExceptionHolder:1.0", exhFactory); // // Register the appropriate router admin factory for each // router admin policy. // org.omg.CORBA.portable.ValueFactory routerAdminPolicyFactory = new org.apache.yoko.orb.OBMessageRouting.ImmediateSuspendPolicyFactory_impl(); valueFactoryManager.registerValueFactory( "IDL:omg.org/MessageRouting/ImmediateSuspendPolicy:1.0", routerAdminPolicyFactory); routerAdminPolicyFactory = new org.apache.yoko.orb.OBMessageRouting.UnlimitedPingPolicyFactory_impl(); valueFactoryManager.registerValueFactory( "IDL:omg.org/MessageRouting/UnlimitedPingPolicy:1.0", routerAdminPolicyFactory); routerAdminPolicyFactory = new org.apache.yoko.orb.OBMessageRouting.LimitedPingPolicyFactory_impl(); valueFactoryManager.registerValueFactory( "IDL:omg.org/MessageRouting/LimitedPingPolicy:1.0", routerAdminPolicyFactory); routerAdminPolicyFactory = new org.apache.yoko.orb.OBMessageRouting.DecayPolicyFactory_impl(); valueFactoryManager.registerValueFactory( "IDL:omg.org/MessageRouting/DecayPolicy:1.0", routerAdminPolicyFactory); routerAdminPolicyFactory = new org.apache.yoko.orb.OBMessageRouting.ResumePolicyFactory_impl(); valueFactoryManager.registerValueFactory( "IDL:omg.org/MessageRouting/ResumePolicy:1.0", routerAdminPolicyFactory); // // Register the valuetype factory for the persistent POA Object // Reference Template and the IMR Object Reference Template. // org.omg.CORBA.portable.ValueFactory ortFactory = new org.apache.yoko.orb.OBPortableInterceptor.TransientORTFactory_impl( orbInstance_); valueFactoryManager .registerValueFactory( "IDL:orb.yoko.apache.org/OBPortableInterceptor/TransientORT:1.0", ortFactory); ortFactory = new org.apache.yoko.orb.OBPortableInterceptor.PersistentORTFactory_impl( orbInstance_); valueFactoryManager .registerValueFactory( "IDL:orb.yoko.apache.org/OBPortableInterceptor/PersistentORT:1.0", ortFactory); ortFactory = new org.apache.yoko.orb.OBPortableInterceptor.IMRORTFactory_impl(); valueFactoryManager.registerValueFactory( "IDL:orb.yoko.apache.org/OBPortableInterceptor/IMRORT:1.0", ortFactory); // // Instantiate ORB initializers using the properties given // to ORB.init() // instantiateORBInitializers(properties, logger); // // Instantiate ORB initializers using the System properties. // Note that a SecurityException may be raised for applets. // try { java.util.Properties sysProperties = System.getProperties(); instantiateORBInitializers(sysProperties, logger); } catch (SecurityException ex) { // Ignore } // // Call each of the ORB initializers. If there are no ORB // initializers it's not necessary to setup the PIManager // since no interceptors will be called. // if (!orbInitializers_.isEmpty()) { org.apache.yoko.orb.OBPortableInterceptor.ORBInitInfo_impl info = new org.apache.yoko.orb.OBPortableInterceptor.ORBInitInfo_impl( this, args.value, orbId, piManager, initServiceManager, codecFactory); java.util.Enumeration e = orbInitializers_.elements(); while (e.hasMoreElements()) { ((org.omg.PortableInterceptor.ORBInitializer) e .nextElement()).pre_init(info); } // TODO: change state e = orbInitializers_.elements(); while (e.hasMoreElements()) { ((org.omg.PortableInterceptor.ORBInitializer) e .nextElement()).post_init(info); } info._OB_destroy(); } piManager.setupComplete(); } catch (RuntimeException ex) { // // Here the same thing as ORB::destroy must be done since // although the ORB itself isn't fully initialized all of the // ORB components may be. // if (orbControl_ != null) { orbControl_.shutdownServerClient(); orbControl_.destroy(); } if (pluginManager_ != null) { pluginManager_.destroy(); } if (orbInstance_ != null) { orbInstance_.destroy(); orbInstance_ = null; } throw ex; } } protected void finalize() throws Throwable { if (orbInstance_ != null) { org.apache.yoko.orb.OB.Logger logger = orbInstance_.getLogger(); logger.debug("ORB.destroy() was not called. " + "This may result in resource leaks."); } super.finalize(); } private void initializeDefaultPolicies() { org.apache.yoko.orb.OB.Logger logger = orbInstance_.getLogger(); java.util.Properties properties = orbInstance_.getProperties(); java.util.Enumeration keys = properties.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (!key.startsWith("yoko.orb.policy.")) continue; String value = properties.getProperty(key); if (key.equals("yoko.orb.policy.protocol")) { java.util.StringTokenizer tokenizer = new java.util.StringTokenizer( value, ", "); String[] seq = new String[tokenizer.countTokens()]; int n = 0; while (tokenizer.hasMoreTokens()) seq[n++] = tokenizer.nextToken(); if (seq.length == 0) { String err = "ORB.init: invalid value for " + "yoko.orb.policy.protocol: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } org.apache.yoko.orb.OB.ProtocolPolicy_impl p = new org.apache.yoko.orb.OB.ProtocolPolicy_impl( seq); policies_.addElement(p); } else if (key.equals("yoko.orb.policy.connection_reuse")) { boolean b; if (value.equals("true")) b = true; else if (value.equals("false")) b = false; else { String err = "ORB.init: invalid value for " + "yoko.orb.policy.connection_reuse: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } org.apache.yoko.orb.OB.ConnectionReusePolicy_impl p = new org.apache.yoko.orb.OB.ConnectionReusePolicy_impl( b); policies_.addElement(p); } else if (key.equals("yoko.orb.policy.zero_port")) { boolean b; if (value.equals("true")) b = true; else if (value.equals("false")) b = false; else { String err = "ORB.init: invalid value for " + "yoko.orb.policy.zero_port: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } org.apache.yoko.orb.OB.ZeroPortPolicy_impl p = new org.apache.yoko.orb.OB.ZeroPortPolicy_impl( b); policies_.addElement(p); } else if (key.equals("yoko.orb.policy.retry") || key.equals("yoko.orb.policy.retry.max") || key.equals("yoko.orb.policy.retry.interval") || key.equals("yoko.orb.policy.retry.remote")) { // Ignore here } else if (key.equals("yoko.orb.policy.timeout")) { int val = Integer.parseInt(value); if (val != -1) { org.apache.yoko.orb.OB.TimeoutPolicy_impl p = new org.apache.yoko.orb.OB.TimeoutPolicy_impl( val); policies_.addElement(p); } } else if (key.equals("yoko.orb.policy.location_transparency")) { short val; if (value.equals("strict")) val = org.apache.yoko.orb.OB.LOCATION_TRANSPARENCY_STRICT.value; else if (value.equals("relaxed")) val = org.apache.yoko.orb.OB.LOCATION_TRANSPARENCY_RELAXED.value; else { String err = "ORB.init: invalid value for " + "yoko.orb.policy.location_transparency: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } org.apache.yoko.orb.OB.LocationTransparencyPolicy_impl p = new org.apache.yoko.orb.OB.LocationTransparencyPolicy_impl( val); policies_.addElement(p); } else if (key.equals("yoko.orb.policy.interceptor")) { boolean b; if (value.equals("true")) b = true; else if (value.equals("false")) b = false; else { String err = "ORB.init: invalid value for " + "yoko.orb.policy.interceptor: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } org.apache.yoko.orb.OB.InterceptorPolicy_impl p = new org.apache.yoko.orb.OB.InterceptorPolicy_impl( b); policies_.addElement(p); } else if (key.equals("yoko.orb.policy.connect_timeout")) { int val = Integer.parseInt(value); if (val != -1) { org.apache.yoko.orb.OB.ConnectTimeoutPolicy_impl p = new org.apache.yoko.orb.OB.ConnectTimeoutPolicy_impl( val); policies_.addElement(p); } } else if (key.equals("yoko.orb.policy.request_timeout")) { int val = Integer.parseInt(value); if (val != -1) { org.apache.yoko.orb.OB.RequestTimeoutPolicy_impl p = new org.apache.yoko.orb.OB.RequestTimeoutPolicy_impl( val); policies_.addElement(p); } } else if (key.equals("yoko.orb.policy.locate_request")) { boolean b; if (value.equals("true")) b = true; else if (value.equals("false")) b = false; else { String err = "ORB.init: invalid value for " + "yoko.orb.policy.locate_request: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } org.apache.yoko.orb.OB.LocateRequestPolicy_impl p = new org.apache.yoko.orb.OB.LocateRequestPolicy_impl( b); policies_.addElement(p); } else if (key.equals("yoko.orb.policy.rebind")) { short val; if (value.equals("transparent")) val = org.omg.Messaging.TRANSPARENT.value; else if (value.equals("no_rebind")) val = org.omg.Messaging.NO_REBIND.value; else if (value.equals("no_reconnect")) val = org.omg.Messaging.NO_RECONNECT.value; else { String err = "ORB.init: invalid value for " + "yoko.orb.policy.rebind: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } org.apache.yoko.orb.Messaging.RebindPolicy_impl p = new org.apache.yoko.orb.Messaging.RebindPolicy_impl( val); policies_.addElement(p); } else if (key.equals("yoko.orb.policy.sync_scope")) { short val; if (value.equals("none")) val = org.omg.Messaging.SYNC_NONE.value; else if (value.equals("transport")) val = org.omg.Messaging.SYNC_WITH_TRANSPORT.value; else if (value.equals("server")) val = org.omg.Messaging.SYNC_WITH_SERVER.value; else if (value.equals("target")) val = org.omg.Messaging.SYNC_WITH_TARGET.value; else { String err = "ORB.init: invalid value for " + "yoko.orb.policy.sync_scope: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } org.apache.yoko.orb.Messaging.SyncScopePolicy_impl p = new org.apache.yoko.orb.Messaging.SyncScopePolicy_impl( val); policies_.addElement(p); } /* * TODO - Add the config keys for the new Message routing policies * here... * * else if(key.equals("yoko.orb.policy.max_hops")) { * } else if(key.equals("yoko.orb.policy.queue_order")) { * } */ else { String err = "ORB.init: unknown property `" + key + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } } // // Set the default policies, if not already set // if (properties.getProperty("yoko.orb.policy.connection_reuse") == null) { org.apache.yoko.orb.OB.ConnectionReusePolicy_impl p = new org.apache.yoko.orb.OB.ConnectionReusePolicy_impl( true); policies_.addElement(p); } // // Set the retry policy // short retry_mode = org.apache.yoko.orb.OB.RETRY_STRICT.value; int retry_interval = 0; int max_retries = 1; boolean retry_remote = false; String value; if ((value = properties.getProperty("yoko.orb.policy.retry")) != null) { if (value.equals("never")) retry_mode = org.apache.yoko.orb.OB.RETRY_NEVER.value; else if (value.equals("strict")) retry_mode = org.apache.yoko.orb.OB.RETRY_STRICT.value; else if (value.equals("always")) retry_mode = org.apache.yoko.orb.OB.RETRY_ALWAYS.value; else { String err = "ORB.init: invalid value for " + "yoko.orb.policy.retry: `" + value + "'"; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } } if ((value = properties.getProperty("yoko.orb.policy.retry.interval")) != null) { try { retry_interval = Integer.parseInt(value); } catch (NumberFormatException ex) { String err = "ORB.init: invalid value for " + "yoko.orb.policy.retry.interval: `" + value + "'"; logger.error(err, ex); throw new org.omg.CORBA.INITIALIZE(err); } } if ((value = properties.getProperty("yoko.orb.policy.retry.max")) != null) { try { max_retries = Integer.parseInt(value); } catch (NumberFormatException ex) { String err = "ORB.init: invalid value for " + "yoko.orb.policy.retry.max: `" + value + "'"; logger.error(err, ex); throw new org.omg.CORBA.INITIALIZE(err); } } if ((value = properties.getProperty("yoko.orb.policy.retry.remote")) != null) retry_remote = value.equals("true"); org.apache.yoko.orb.OB.RetryPolicy_impl p = new org.apache.yoko.orb.OB.RetryPolicy_impl( retry_mode, retry_interval, max_retries, retry_remote); policies_.addElement(p); // // Create the ORBPolicyManager // org.omg.CORBA.PolicyManager pm = new org.apache.yoko.orb.CORBA.ORBPolicyManager_impl( policies_); org.apache.yoko.orb.OB.InitialServiceManager initServiceManager = orbInstance_ .getInitialServiceManager(); try { initServiceManager.addInitialReference("ORBPolicyManager", pm); } catch (org.omg.CORBA.ORBPackage.InvalidName ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } org.apache.yoko.orb.OB.ObjectFactory objectFactory = orbInstance_ .getObjectFactory(); objectFactory.setPolicyManager(pm); // // Register the default PolicyFactory policies for the ORB // org.apache.yoko.orb.OB.PolicyFactoryManager pfm = orbInstance_ .getPolicyFactoryManager(); org.omg.PortableInterceptor.PolicyFactory factory = new org.apache.yoko.orb.CORBA.ORBPolicyFactory_impl(); pfm.registerPolicyFactory( org.apache.yoko.orb.OB.CONNECTION_REUSE_POLICY_ID.value, factory, true); pfm.registerPolicyFactory( org.apache.yoko.orb.OB.ZERO_PORT_POLICY_ID.value, factory, true); pfm.registerPolicyFactory( org.apache.yoko.orb.OB.PROTOCOL_POLICY_ID.value, factory, true); pfm.registerPolicyFactory(org.apache.yoko.orb.OB.RETRY_POLICY_ID.value, factory, true); pfm.registerPolicyFactory( org.apache.yoko.orb.OB.TIMEOUT_POLICY_ID.value, factory, true); pfm.registerPolicyFactory( org.apache.yoko.orb.OB.LOCATION_TRANSPARENCY_POLICY_ID.value, factory, true); pfm.registerPolicyFactory(org.omg.Messaging.REBIND_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.SYNC_SCOPE_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.apache.yoko.orb.OB.INTERCEPTOR_POLICY_ID.value, factory, true); pfm.registerPolicyFactory( org.apache.yoko.orb.OB.CONNECT_TIMEOUT_POLICY_ID.value, factory, true); pfm.registerPolicyFactory( org.apache.yoko.orb.OB.REQUEST_TIMEOUT_POLICY_ID.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.REPLY_START_TIME_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.REPLY_END_TIME_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.BiDirPolicy.BIDIRECTIONAL_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.REPLY_PRIORITY_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory(org.omg.Messaging.ROUTING_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory(org.omg.Messaging.MAX_HOPS_POLICY_TYPE.value, factory, true); pfm.registerPolicyFactory( org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE.value, factory, true); } private void instantiateORBInitializers(java.util.Properties properties, org.apache.yoko.orb.OB.Logger logger) { final String magic = "org.omg.PortableInterceptor.ORBInitializerClass."; java.util.Enumeration e = properties.keys(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.startsWith(magic)) { // // The remaining portion of the key is the initializer // class name. The value of the property is ignored. // String initClass = key.substring(magic.length()); if (!orbInitializers_.containsKey(initClass)) { try { // get the appropriate class for the loading. ClassLoader loader = Thread.currentThread().getContextClassLoader(); org.omg.PortableInterceptor.ORBInitializer init = (org.omg.PortableInterceptor.ORBInitializer) ProviderLocator.loadClass(initClass, getClass(), loader).newInstance(); orbInitializers_.put(initClass, init); } // Exceptions have to be ignored here catch (ClassNotFoundException ex) { logger.warning("ORB.init: initializer class " + initClass + " not found", ex); } catch (InstantiationException ex) { logger.warning("ORB.init: error occurred while " + "instantiating initializer class " + initClass, ex); } catch (IllegalAccessException ex) { logger.warning("ORB.init: cannot access " + "initializer class " + initClass, ex); } } } } } private static boolean loadConfigFile(String configFile, java.util.Properties properties, org.apache.yoko.orb.OB.Logger logger) { // // Load the contents of the configuration file // java.io.InputStream in = null; // // Try to open URL connection first // try { try { java.net.URL url = new java.net.URL(configFile); in = url.openStream(); } catch (java.net.MalformedURLException e) { // // Try to open plain file, if `configFile' is not a // URL specification // in = new java.io.FileInputStream(configFile); } } catch (java.io.IOException ex) { logger.warning("ORB.init: could not load configuration " + "file " + configFile, ex); } if (in != null) { try { java.io.BufferedInputStream bin = new java.io.BufferedInputStream( in); properties.load(bin); in.close(); return true; } catch (java.io.IOException ex) { logger.warning("ORB.init: could not load configuration " + "file " + configFile, ex); } } return false; } private static String[] parseAppletParams(java.applet.Applet app) { String[] args = new String[0]; // // Check for parameter list // String paramList = app.getParameter("ORBparams"); if (paramList != null) { java.util.StringTokenizer p = new java.util.StringTokenizer( paramList); args = new String[p.countTokens()]; int i = 0; while (p.hasMoreTokens()) args[i++] = p.nextToken(); } return args; } private void setParameters(org.omg.CORBA.StringSeqHolder args, java.util.Properties properties, org.apache.yoko.orb.OB.Logger logger) { if (args.value == null) args.value = new String[0]; // // Initialize the Logger // if (logger == null) logger = new org.apache.yoko.orb.OB.Logger_impl(); // // Initialize the properties // if (properties == null) { properties = new Properties(); try { properties.putAll(System.getProperties()); } catch (SecurityException ex) { // // May be raised in an applet // // logger.warning("ORB.init: Unable to access System " + // "properties"); } } args.value = ParseArgs(args.value, properties, logger); // // Process each property // String orbId = ""; String serverId = ""; String serverInstance = ""; int concModel = org.apache.yoko.orb.OB.Client.Blocking; int nativeCs = org.apache.yoko.orb.OB.CodeSetDatabase.ISOLATIN1; int nativeWcs = org.apache.yoko.orb.OB.CodeSetDatabase.UTF16; int defaultWcs = 0; java.util.Enumeration keys = properties.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); if (!key.startsWith("yoko.orb.")) continue; String value = properties.getProperty(key); org.apache.yoko.orb.OB.Assert._OB_assert(value != null); if (key.equals("yoko.orb.conc_model")) { if (value.equals("threaded")) { concModel = org.apache.yoko.orb.OB.Client.Threaded; } else { logger.warning("ORB.init: unknown value for " + "yoko.orb.conc_model: " + value); } } else if (key.startsWith("yoko.orb.trace.")) { // Ignore -- handled in CoreTraceLevels } else if (key.startsWith("yoko.orb.policy.")) { // Ignore -- handled in initializeDefaultPolicies() } else if (key.equals("yoko.orb.id")) { orbId = value; } else if (key.equals("yoko.orb.server_name")) { // // The server name must begin with an alpha-numeric // character // if (value.length() == 0 || !Character.isLetterOrDigit(value.charAt(0))) { String err = "ORB.init: illegal value for " + "yoko.orb.server_name: " + value; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } serverId = value; } else if (key.equals("yoko.orb.server_instance")) { serverInstance = value; } else if (key.equals("yoko.orb.raise_dii_exceptions")) { if (value.equalsIgnoreCase("true")) raiseDIIExceptions_ = true; else raiseDIIExceptions_ = false; } else if (key.equals("yoko.orb.native_cs")) { int csid = org.apache.yoko.orb.OB.CodeSetDatabase.instance() .nameToId(value); if (csid != 0 && csid != org.apache.yoko.orb.OB.CodeSetDatabase.UTF8) nativeCs = csid; else { String err = "ORB.init: unknown value for " + "yoko.orb.native_cs: " + value; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } } else if (key.equals("yoko.orb.native_wcs")) { int csid = org.apache.yoko.orb.OB.CodeSetDatabase.instance() .nameToId(value); if (csid != 0 && csid != org.apache.yoko.orb.OB.CodeSetDatabase.UTF8) nativeWcs = csid; else { String err = "ORB.init: unknown value for " + "yoko.orb.native_wcs: " + value; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } } else if (key.equals("yoko.orb.default_wcs")) { int csid = org.apache.yoko.orb.OB.CodeSetDatabase.instance() .nameToId(value); if (csid != 0 && csid != org.apache.yoko.orb.OB.CodeSetDatabase.UTF8) defaultWcs = csid; else { String err = "ORB.init: unknown value for " + "yoko.orb.default_wcs: " + value; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } } else if (key.equals("yoko.orb.extended_wchar")) { if (!value.equals("true") && !value.equals("false")) { String err = "ORB.init: unknown value for " + "yoko.orb.extended_wchar: " + value; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } } else if (key.equals("yoko.orb.default_init_ref")) { if (value.length() == 0) logger.warning("ORB.init: invalid value for " + "yoko.orb.default_init_ref"); } else if (key.equals("yoko.orb.server_timeout") || key.equals("yoko.orb.server_shutdown_timeout")) { // Used by GIOPServerWorker } else if (key.equals("yoko.orb.client_timeout") || key.equals("yoko.orb.client_shutdown_timeout")) { // Used by GIOPClientWorker } else if (key.startsWith("yoko.orb.service.")) { // Ignore } else if (key.startsWith("yoko.orb.oa.")) { // Ignore } else if (key.startsWith("yoko.orb.poamanager.")) { // Ignore } else if (key.equals("yoko.orb.noIMR")) { // Ignore } else if (key.equals("yoko.orb.use_type_code_cache")) { if (!value.equals("true") && !value.equals("false")) { String err = "ORB.init: unknown value for " + "yoko.orb.use_type_code_cache: " + value; logger.error(err); throw new org.omg.CORBA.INITIALIZE(err); } } else if (key.equals("yoko.orb.giop.max_message_size")) { try { int max = Integer.valueOf(value).intValue(); org.apache.yoko.orb.OB.GIOPIncomingMessage .setMaxMessageSize(max); org.apache.yoko.orb.OB.GIOPOutgoingMessage .setMaxMessageSize(max); } catch (NumberFormatException ex) { String err = "ORB.init: invalid value for " + "yoko.orb.giop.max_message_size: " + value; logger.error(err, ex); throw new org.omg.CORBA.INITIALIZE(err); } } else if (key.equals("yoko.orb.ami_workers")) { // ignore } else { logger.warning("ORB.init: unknown property `" + key + "'"); } } // // Parse the tracing levels from the properties // org.apache.yoko.orb.OB.CoreTraceLevels coreTraceLevels = new org.apache.yoko.orb.OB.CoreTraceLevels( logger, properties); // // Initialize the ORB state - this must be done after processing // command-line options and properties // initialize(args, orbId, serverId, serverInstance, concModel, coreTraceLevels, properties, logger, nativeCs, nativeWcs, defaultWcs); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String[] list_initial_services() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return orbInstance_.getInitialServiceManager().listInitialServices(); } } public org.omg.CORBA.Object resolve_initial_references( String identifier) throws org.omg.CORBA.ORBPackage.InvalidName { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) { throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); } org.apache.yoko.orb.OB.InitialServiceManager initServiceManager = orbInstance_ .getInitialServiceManager(); org.omg.CORBA.Object obj = null; try { obj = initServiceManager.resolveInitialReferences(identifier); } catch (org.omg.CORBA.ORBPackage.InvalidName ex) { // // If the service is the RootPOA and it hasn't yet been // initialized, create it. We could put in some automatic method // here for late binding of objects at some later point. // if (identifier.equals("RootPOA")) { orbControl_.initializeRootPOA(this); return resolve_initial_references(identifier); } else { throw ex; } } return obj; } } public void register_initial_reference(String name, org.omg.CORBA.Object obj) throws org.omg.CORBA.ORBPackage.InvalidName { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); orbInstance_.getInitialServiceManager().addInitialReference(name, obj); } } public String object_to_string(org.omg.CORBA.Object p) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.omg.IOP.IOR ior; if (p == null) { ior = new org.omg.IOP.IOR("", new org.omg.IOP.TaggedProfile[0]); } else { if (p instanceof org.omg.CORBA.LocalObject) throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorLocalObject), org.apache.yoko.orb.OB.MinorCodes.MinorLocalObject, org.omg.CORBA.CompletionStatus.COMPLETED_NO); org.apache.yoko.orb.CORBA.Delegate delegate = (org.apache.yoko.orb.CORBA.Delegate) (((org.omg.CORBA.portable.ObjectImpl) p) ._get_delegate()); ior = delegate._OB_origIOR(); } org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); org.apache.yoko.orb.CORBA.OutputStream out = new org.apache.yoko.orb.CORBA.OutputStream( buf); out._OB_writeEndian(); org.omg.IOP.IORHelper.write(out, ior); String str = org.apache.yoko.orb.OB.HexConverter.octetsToAscii(buf .data(), buf.length()); return "IOR:" + str; } } public org.omg.CORBA.Object string_to_object(String ior) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return orbInstance_.getObjectFactory().stringToObject(ior); } } public org.omg.CORBA.NVList create_list(int count) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); if (count < 0) count = 0; return new org.apache.yoko.orb.CORBA.NVList(this, count); } } /** * @deprecated Deprecated by CORBA 2.3. */ public org.omg.CORBA.NVList create_operation_list( org.omg.CORBA.OperationDef oper) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); // // Get operation description // org.omg.CORBA.ContainedPackage.Description d = oper.describe(); org.omg.CORBA.OperationDescription desc = org.omg.CORBA.OperationDescriptionHelper .extract(d.value); // // Create list // org.apache.yoko.orb.CORBA.NVList list = new org.apache.yoko.orb.CORBA.NVList( this); for (int i = 0; i < desc.parameters.length; i++) { org.omg.CORBA.ParameterDescription par = desc.parameters[i]; org.omg.CORBA.Any any = create_any(); any.type(par.type); int flags = 0; switch (par.mode.value()) { case org.omg.CORBA.ParameterMode._PARAM_IN: flags = org.omg.CORBA.ARG_IN.value; break; case org.omg.CORBA.ParameterMode._PARAM_OUT: flags = org.omg.CORBA.ARG_OUT.value; break; case org.omg.CORBA.ParameterMode._PARAM_INOUT: flags = org.omg.CORBA.ARG_INOUT.value; break; default: org.apache.yoko.orb.OB.Assert._OB_assert(false); } list.add_value(par.name, any, flags); } return list; } } public org.omg.CORBA.NVList create_operation_list( org.omg.CORBA.Object oper) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.omg.CORBA.OperationDef def = org.omg.CORBA.OperationDefHelper .narrow(oper); return create_operation_list(def); } } public org.omg.CORBA.NamedValue create_named_value( String name, org.omg.CORBA.Any value, int flags) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return new org.apache.yoko.orb.CORBA.NamedValue(name, value, flags); } } public org.omg.CORBA.ExceptionList create_exception_list() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return new org.apache.yoko.orb.CORBA.ExceptionList(); } } public org.omg.CORBA.ContextList create_context_list() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return new org.apache.yoko.orb.CORBA.ContextList(); } } public org.omg.CORBA.Context get_default_context() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return new org.apache.yoko.orb.CORBA.Context(this, ""); } } public org.omg.CORBA.Environment create_environment() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return new org.apache.yoko.orb.CORBA.Environment(); } } public void send_multiple_requests_oneway( org.omg.CORBA.Request[] requests) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.apache.yoko.orb.OB.MultiRequestSender multi = orbInstance_ .getMultiRequestSender(); multi.sendMultipleRequestsOneway(requests); } } public void send_multiple_requests_deferred( org.omg.CORBA.Request[] requests) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.apache.yoko.orb.OB.MultiRequestSender multi = orbInstance_ .getMultiRequestSender(); multi.sendMultipleRequestsDeferred(requests); } } public boolean poll_next_response() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.apache.yoko.orb.OB.MultiRequestSender multi = orbInstance_ .getMultiRequestSender(); return multi.pollNextResponse(); } } public org.omg.CORBA.Request get_next_response() throws org.omg.CORBA.WrongTransaction { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.apache.yoko.orb.OB.MultiRequestSender multi = orbInstance_ .getMultiRequestSender(); return multi.getNextResponse(); } } public boolean get_service_information(short service_type, org.omg.CORBA.ServiceInformationHolder service_info) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); service_info.value = new org.omg.CORBA.ServiceInformation(); service_info.value.service_options = new int[0]; service_info.value.service_details = new org.omg.CORBA.ServiceDetail[0]; return false; } } public boolean work_pending() { // // Ensure that the ORB mutex is not locked during the call to // ORBControl methods // try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); // // Ensure that other threads get a chance to execute if // work_pending() is being called in a tight loop. // Thread.yield(); return orbControl_.workPending(); } } public void perform_work() { // // Ensure that the ORB mutex is not locked during the call to // ORBControl methods // try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); orbControl_.performWork(); } } public void run() { // // Ensure that the ORB mutex is not locked during the call to // ORBControl methods // try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new OBJECT_NOT_EXIST("ORB is destroyed"); orbControl_.run(); } } public void shutdown(boolean wait_for_completion) { // // Ensure that the ORB mutex is not locked during the call to // ORBControl methods // try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new OBJECT_NOT_EXIST("ORB is destroyed"); orbControl_.shutdownServer(wait_for_completion); } } public void destroy() { try (AutoLock writelock = destroyLock_.getWriteLock()) { // // From the specification: // // This operation destroys the ORB so that its resources can be // reclaimed by the application. Any operation invoked on a // destroyed ORB reference will raise the OBJECT_NOT_EXIST // exception. Once an ORB has been destroyed, another call to // ORB_init with the same ORBid will return a reference to a newly // constructed ORB. // // If destroy is called on an ORB that has not been shut down, it // will start the shut down process and block until the ORB has // shut down before it destroys the ORB. If an application calls // destroy in a thread that is currently servicing an invocation, // the BAD_INV_ORDER system exception will be raised with the OMG // minor code 3, since blocking would result in a deadlock. // // For maximum portability and to avoid resource leaks, an // application should always call shutdown and destroy on all ORB // instances before exiting. // // // Has the ORB been destroyed yet? // if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); // // Shutdown both the server & client side of the ORB // orbControl_.shutdownServerClient(); // // Destroy the ORBControl. Don't set to _nil. // orbControl_.destroy(); // orbControl_ = null; // // Destroy the ORBInstance object // orbInstance_.destroy(); orbInstance_ = null; // // Destroy the OCI Plugin Manager. This must be done after all // the OCI objects have been destroyed. // pluginManager_.destroy(); pluginManager_ = null; // // Mark the ORB as destroyed // destroy_ = true; } } public org.omg.CORBA.portable.OutputStream create_output_stream() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); org.apache.yoko.orb.CORBA.OutputStream out = new org.apache.yoko.orb.CORBA.OutputStream( buf); out._OB_ORBInstance(orbInstance_); return out; } } public org.omg.CORBA.Object get_value_def(String repid) throws org.omg.CORBA.BAD_PARAM { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); try { org.omg.CORBA.Object obj = resolve_initial_references("InterfaceRepository"); org.omg.CORBA.Repository repository = org.omg.CORBA.RepositoryHelper .narrow(obj); org.omg.CORBA.Contained cont = repository.lookup_id(repid); if (cont != null) return org.omg.CORBA.ValueDefHelper.narrow(cont); } catch (org.omg.CORBA.ORBPackage.InvalidName ex) { } throw new org.omg.CORBA.BAD_PARAM("Repository lookup failed for " + repid); } } public void set_delegate(java.lang.Object wrapper) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); try { org.omg.PortableServer.Servant servant = (org.omg.PortableServer.Servant) wrapper; servant ._set_delegate(new org.apache.yoko.orb.PortableServer.Delegate( this)); } catch (ClassCastException ex) { throw (org.omg.CORBA.BAD_PARAM)new org.omg.CORBA.BAD_PARAM( "Argument is not of type " + "org.omg.PortableServer." + "Servant").initCause(ex); } } } protected void set_parameters(String[] args, java.util.Properties properties) { setParameters(new org.omg.CORBA.StringSeqHolder(args), properties, null); } protected void set_parameters(java.applet.Applet app, java.util.Properties properties) { String[] args = parseAppletParams(app); setParameters(new org.omg.CORBA.StringSeqHolder(args), properties, null); } // ------------------------------------------------------------------ // Additional Yoko specific functions // ------------------------------------------------------------------ public static org.omg.CORBA.ORB init(String[] args, java.util.Properties props, org.apache.yoko.orb.OB.Logger logger) { return init(new org.omg.CORBA.StringSeqHolder(args), props, logger); } public static org.omg.CORBA.ORB init(org.omg.CORBA.StringSeqHolder args, java.util.Properties props, org.apache.yoko.orb.OB.Logger logger) { final String propName = "org.omg.CORBA.ORBClass"; String orbClassName = null; ORB_impl orb; try { orb = (ORB_impl) ProviderLocator.getService(propName, ORB_impl.class, Thread.currentThread().getContextClassLoader()); if (orb == null) { if (props != null) orbClassName = props.getProperty(propName); try { if (orbClassName == null) orbClassName = getSystemProperty(propName); } catch (SecurityException ex) { // ignore } if (orbClassName == null) orbClassName = "org.apache.yoko.orb.CORBA.ORB"; orb = (ORB_impl) ProviderLocator.loadClass(orbClassName, ORB_impl.class, Thread.currentThread().getContextClassLoader()).newInstance(); } } catch (Throwable ex) { throw (org.omg.CORBA.INITIALIZE)new org.omg.CORBA.INITIALIZE("Invalid ORB class: " + orbClassName + '\n' + ex.getMessage()).initCause(ex); } orb.setParameters(args, props, logger); return orb; } public static org.omg.CORBA.ORB init(java.applet.Applet app, java.util.Properties props, org.apache.yoko.orb.OB.Logger logger) { String javaVersion = getSystemProperty("java.vm.version"); float version = Float.parseFloat(javaVersion); if (version < 1.5) { throw new org.omg.CORBA.INITIALIZE("Unsupported Java version: " + version); } final String propName = "org.omg.CORBA.ORBClass"; String orbClassName = null; ORB_impl orb; try { orb = (ORB_impl) ProviderLocator.getService(propName, ORB_impl.class, Thread.currentThread().getContextClassLoader()); if (orb == null) { if (props != null) orbClassName = props.getProperty(propName); try { if (orbClassName == null) orbClassName = getSystemProperty(propName); } catch (SecurityException ex) { // ignore } if (orbClassName == null) orbClassName = "org.apache.yoko.orb.CORBA.ORB"; orb = (ORB_impl) ProviderLocator.loadClass(orbClassName, ORB_impl.class, Thread.currentThread().getContextClassLoader()).newInstance(); } } catch (Throwable ex) { throw (org.omg.CORBA.INITIALIZE)new org.omg.CORBA.INITIALIZE("Invalid ORB class: " + orbClassName + '\n' + ex.getMessage()).initCause(ex); } String[] args = parseAppletParams(app); orb.setParameters(new org.omg.CORBA.StringSeqHolder(args), props, logger); return orb; } static public String[] ParseArgs(String[] args, java.util.Properties properties, org.apache.yoko.orb.OB.Logger logger) { if (logger == null) logger = new org.apache.yoko.orb.OB.Logger_impl(); // // If the yoko.config property is defined, and the yoko.config_loaded // property is NOT defined, then load the configuration file into // the given property set and define yoko.config_loaded so we // don't load it again // String yokoConfig = properties.getProperty("yoko.config"); String yokoConfigLoaded = properties.getProperty("yoko.config_loaded"); if (yokoConfig != null && yokoConfigLoaded == null) { if (loadConfigFile(yokoConfig, properties, logger)) properties.put("yoko.config_loaded", "true"); } // // Create list with options supported by the ORB // if (orbOptionFilter_ == null) { orbOptionFilter_ = new org.apache.yoko.orb.OB.OptionFilter( "ORB.init", "-ORB"); orbOptionFilter_.add("id", 1); orbOptionFilter_.add("service", 2); orbOptionFilter_.add("InitRef", 1); orbOptionFilter_.add("DefaultInitRef", 1); orbOptionFilter_.add("property", 1); orbOptionFilter_.add("repository", 1); orbOptionFilter_.add("naming", 1); orbOptionFilter_.add("config", 1); orbOptionFilter_.add("threaded", 0); orbOptionFilter_.add("version", 0); orbOptionFilter_.add("native_cs", 1); orbOptionFilter_.add("native_wcs", 1); orbOptionFilter_.add("default_wcs", 1); orbOptionFilter_.add("ServerId", 1); orbOptionFilter_.add("register", 1); orbOptionFilter_.add("ListenEndpoints", 1); orbOptionFilter_.add("NoProprietaryAction", 0); orbOptionFilter_.add("server_instance", 1); orbOptionFilter_.add("trace_connections", 1); orbOptionFilter_.add("trace_requests", 1); orbOptionFilter_.add("trace_requests_in", 1); orbOptionFilter_.add("trace_requests_out", 1); orbOptionFilter_.add("trace_retry", 1); orbOptionFilter_.add("_AmiWorkers", 1); } // // Create list with options supported by the Object Adaptor // if (oaOptionFilter_ == null) { oaOptionFilter_ = new org.apache.yoko.orb.OB.OptionFilter( "ORB.init", "-OA"); oaOptionFilter_.add("host", 1); // Deprecated oaOptionFilter_.add("port", 1); // Deprecated oaOptionFilter_.add("numeric", 0); // Deprecated oaOptionFilter_.add("version", 1); oaOptionFilter_.add("threaded", 0); oaOptionFilter_.add("thread_per_client", 0); oaOptionFilter_.add("thread_per_request", 0); oaOptionFilter_.add("thread_pool", 1); } String configFile = null; // // First scan through the argument list looking for the config // file option. We need to do this since command line arguments // have precedence over the properties. // if (args != null) { int i = 0; while (i < args.length) { if (args[i].equals("-ORBconfig")) { if (i + 1 >= args.length) { String msg = "ORB.init: argument expected " + "for -ORBconfig"; logger.error(msg); throw new org.omg.CORBA.INITIALIZE(msg); } configFile = args[i + 1]; break; } else ++i; } } // // Load the contents of the configuration file if present // if (configFile != null && configFile.length() > 0) { loadConfigFile(configFile, properties, logger); } // // Set the default value of the ORB and OA concurrency models if // they are not already set // if (properties.getProperty("yoko.orb.conc_model") == null) { properties.put("yoko.orb.conc_model", "threaded"); } if (properties.getProperty("yoko.orb.oa.conc_model") == null) { properties.put("yoko.orb.oa.conc_model", "thread_per_request"); } // // set the default number of AMI workers if not already set // if (properties.getProperty("yoko.orb.ami_workers") == null) { properties.put("yoko.orb.ami_workers", "1"); } // // Process each argument. Turn each argument into an appropriate // property. // org.apache.yoko.orb.OB.OptionFilter.Option[] options = orbOptionFilter_ .parse(logger, args); for (int i = 0; i < options.length; i++) { String name = options[i].name; String[] value = options[i].value; if (name.equals("id")) { properties.put("yoko.orb.id", value[0]); } else if (name.equals("server_name")) { properties.put("yoko.orb.server_name", value[0]); } else if (name.equals("register")) { properties.put("yoko.orb.server_name", value[0]); // // TODO: What do we do for Java? // // properties.put("yoko.orb.imr.register", value[0]); } else if (name.equals("server_instance")) { properties.put("yoko.orb.server_instance", value[0]); } else if (name.equals("ListenEndpoints")) { properties.put("yoko.orb.oa.endpoint", value[0]); } else if (name.equals("NoProprietaryAction")) { properties.put("yoko.orb.noIMR", "true"); } else if (name.equals("service")) { properties.put("yoko.orb.service." + value[0], value[1]); } else if (name.equals("InitRef")) { int n = value[0].indexOf('='); if (n <= 0 || value[0].length() == n + 1) { logger.error("ORB.init: invalid value for -ORBInitRef"); throw new org.omg.CORBA.INITIALIZE(); } String svc = value[0].substring(0, n); String url = value[0].substring(n + 1); properties.put("yoko.orb.service." + svc, url); } else if (name.equals("DefaultInitRef")) { properties.put("yoko.orb.default_init_ref", value[0]); } else if (name.equals("property")) { int n = value[0].indexOf('='); if (n <= 0 || value[0].length() == n + 1) { logger.error("ORB.init: invalid value for -ORBproperty"); throw new org.omg.CORBA.INITIALIZE(); } String propName = value[0].substring(0, n); String propValue = value[0].substring(n + 1); properties.put(propName, propValue); } else if (name.equals("repository")) { properties .put("yoko.orb.service.InterfaceRepository", value[0]); } else if (name.equals("naming")) { properties.put("yoko.orb.service.NameService", value[0]); } else if (name.equals("trace_connections") || name.equals("trace_retry") || name.equals("trace_requests") || name.equals("trace_requests_in") || name.equals("trace_requests_out")) { String prop = "yoko.orb.trace."; prop += name.substring(6); properties.put(prop, value[0]); } else if (name.equals("threaded")) { properties.put("yoko.orb.conc_model", "threaded"); } else if (name.equals("version")) { logger.info(org.apache.yoko.orb.OB.Version.getVersion()); } else if (name.equals("native_cs")) { properties.put("yoko.orb.native_cs", value[0]); } else if (name.equals("native_wcs")) { properties.put("yoko.orb.native_wcs", value[0]); } else if (name.equals("default_wcs")) { properties.put("yoko.orb.default_wcs", value[0]); } else if (name.equals("ServerId")) { properties.put("yoko.orb.server_name", value[0]); } else if (name.equals("_AmiWorkers")) { properties.put("yoko.orb.ami_workers", value[0]); } } // // Process each argument. Turn each argument into an appropriate // property. // options = oaOptionFilter_.parse(logger, args); for (int i = 0; i < options.length; i++) { String name = options[i].name; String[] value = options[i].value; if (name.equals("host")) // Deprecated - see IIOP plug-in { properties.put("yoko.iiop.host", value[0]); } else if (name.equals("port")) // Deprecated - see IIOP plug-in { properties.put("yoko.iiop.port", value[0]); } else if (name.equals("numeric")) // Deprecated - see IIOP plug-in { properties.put("yoko.iiop.numeric", "true"); } else if (name.equals("version")) { properties.put("yoko.orb.oa.version", value[0]); } else if (name.equals("threaded")) { properties.put("yoko.orb.oa.conc_model", "threaded"); } else if (name.equals("thread_per_client")) { properties.put("yoko.orb.oa.conc_model", "thread_per_client"); } else if (name.equals("thread_per_request")) { properties.put("yoko.orb.oa.conc_model", "thread_per_request"); } else if (name.equals("thread_pool")) { properties.put("yoko.orb.oa.conc_model", "thread_pool"); properties.put("yoko.orb.oa.thread_pool", value[0]); } } args = orbOptionFilter_.filter(args); args = oaOptionFilter_.filter(args); return args; } public org.omg.CORBA.Policy create_policy(int type, org.omg.CORBA.Any any) throws org.omg.CORBA.PolicyError { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return orbInstance_.getPolicyFactoryManager().createPolicy(type, any); } } public org.omg.CORBA.portable.ValueFactory register_value_factory( String id, org.omg.CORBA.portable.ValueFactory factory) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.apache.yoko.orb.OB.ValueFactoryManager valueFactoryManager = orbInstance_ .getValueFactoryManager(); return valueFactoryManager.registerValueFactory(id, factory); } } public void unregister_value_factory(String id) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.apache.yoko.orb.OB.ValueFactoryManager valueFactoryManager = orbInstance_ .getValueFactoryManager(); valueFactoryManager.unregisterValueFactory(id); } } public org.omg.CORBA.portable.ValueFactory lookup_value_factory( String id) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); org.apache.yoko.orb.OB.ValueFactoryManager valueFactoryManager = orbInstance_ .getValueFactoryManager(); return valueFactoryManager.lookupValueFactory(id); } } // ------------------------------------------------------------------ // Additional Yoko specific functions // ------------------------------------------------------------------ public java.util.Properties properties() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return orbInstance_.getProperties(); } } public org.apache.yoko.orb.OB.Logger logger() { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return orbInstance_.getLogger(); } } public org.apache.yoko.orb.OB.UnknownExceptionStrategy set_unknown_exception_strategy( org.apache.yoko.orb.OB.UnknownExceptionStrategy strategy) { try (AutoLock readLock = destroyLock_.getReadLock()) { if (destroy_) throw new org.omg.CORBA.OBJECT_NOT_EXIST("ORB is destroyed"); return orbInstance_.setUnknownExceptionStrategy(strategy); } } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ORB_impl() { // // Most of the initialization is done in initialize() // } public boolean _OB_raiseDIIExceptions() { return raiseDIIExceptions_; } public org.apache.yoko.orb.OB.ORBInstance _OB_ORBInstance() { return orbInstance_; } /** * Simple utility for retrieving a system property * using the AccessController. * * @param name The property name * * @return The property value. */ private static String getSystemProperty(String name) { return (String)AccessController.doPrivileged(new GetSystemPropertyAction(name)); } }
6,780
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/cmsf/CmsfVersion.java
package org.apache.yoko.orb.cmsf; import java.io.IOException; import java.util.Arrays; import org.apache.yoko.orb.OCI.Buffer; import org.omg.CORBA.Any; import org.omg.CORBA.INTERNAL; import org.omg.CORBA.MARSHAL; import org.omg.CORBA.ORB; import org.omg.IOP.RMICustomMaxStreamFormat; import org.omg.IOP.ServiceContext; import org.omg.IOP.TAG_RMI_CUSTOM_MAX_STREAM_FORMAT; import org.omg.IOP.TaggedComponent; public enum CmsfVersion { CMSFv1(1), CMSFv2(2); public static final boolean ENABLED = true; private final byte value; private final TaggedComponent tc; private final ServiceContext sc; private final Any any; private CmsfVersion(int value) { this((byte)(value & 0xff)); } private CmsfVersion(byte value) { this.value = value; final byte[] data = genData(value); this.tc = new TaggedComponent(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value, data.clone()); this.sc = new ServiceContext(RMICustomMaxStreamFormat.value, data); this.any = ORB.init().create_any(); this.any.insert_octet((byte)value); } byte getValue() { return value; } TaggedComponent getTc() { return tc; } ServiceContext getSc() { return sc; } Any getAny() { return any; } static CmsfVersion readAny(Any any) { if (any == null) return CMSFv1; return (any.extract_octet() >= 2) ? CMSFv2 : CMSFv1; } static CmsfVersion readData(byte[] data) { if (data == null) return CMSFv1; int cmsf = 1; Buffer buf = new Buffer(data, data.length); try (org.apache.yoko.orb.CORBA.InputStream in = new org.apache.yoko.orb.CORBA.InputStream(buf, 0, false)) { in._OB_readEndian(); cmsf = in.read_octet(); } catch (Exception e) { throw (MARSHAL)(new MARSHAL(e.getMessage())).initCause(e); } return (cmsf >= 2) ? CMSFv2 : CMSFv1; } private static byte[] genData(byte value) { Buffer buf = new Buffer(2); try (org.apache.yoko.orb.CORBA.OutputStream out = new org.apache.yoko.orb.CORBA.OutputStream(buf)) { out._OB_writeEndian(); out.write_octet(value); return Arrays.copyOf(buf.data(), buf.length()); } catch (IOException e) { throw (INTERNAL)(new INTERNAL(e.getMessage())).initCause(e); } } }
6,781
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/cmsf/CmsfClientInterceptor.java
package org.apache.yoko.orb.cmsf; import static org.apache.yoko.orb.OB.MinorCodes.MinorInvalidComponentId; import static org.apache.yoko.orb.cmsf.CmsfVersion.CMSFv1; import static org.apache.yoko.orb.cmsf.CmsfVersion.CMSFv2; import java.io.IOException; import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.apache.yoko.util.cmsf.CmsfThreadLocal; import org.omg.CORBA.BAD_PARAM; import org.omg.CORBA.LocalObject; import org.omg.IOP.TAG_RMI_CUSTOM_MAX_STREAM_FORMAT; import org.omg.IOP.TaggedComponent; import org.omg.PortableInterceptor.ClientRequestInfo; import org.omg.PortableInterceptor.ClientRequestInterceptor; import org.omg.PortableInterceptor.ForwardRequest; public final class CmsfClientInterceptor extends LocalObject implements ClientRequestInterceptor { private static final String NAME = CmsfClientInterceptor.class.getName(); @Override public void send_request(ClientRequestInfo ri) throws ForwardRequest { CmsfVersion cmsf = CMSFv1; try { TaggedComponent tc = ri.get_effective_component(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value); cmsf = CmsfVersion.readData(tc.component_data); } catch (BAD_PARAM e) { if (e.minor != MinorInvalidComponentId) { throw e; } } CmsfThreadLocal.push(cmsf.getValue()); if (CmsfVersion.ENABLED) ri.add_request_service_context(CMSFv2.getSc(), false); } @Override public void send_poll(ClientRequestInfo ri) { } @Override public void receive_reply(ClientRequestInfo ri) { CmsfThreadLocal.pop(); } @Override public void receive_exception(ClientRequestInfo ri) throws ForwardRequest { CmsfThreadLocal.pop(); } @Override public void receive_other(ClientRequestInfo ri) throws ForwardRequest { CmsfThreadLocal.pop(); } @Override public String name() { return NAME; } @Override public void destroy() { } private void readObject(ObjectInputStream ios) throws IOException { throw new NotSerializableException(NAME); } private void writeObject(ObjectOutputStream oos) throws IOException { throw new NotSerializableException(NAME); } }
6,782
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/cmsf/CmsfServerInterceptor.java
package org.apache.yoko.orb.cmsf; import static org.apache.yoko.orb.OB.MinorCodes.MinorInvalidServiceContextId; import static org.apache.yoko.orb.cmsf.CmsfVersion.CMSFv1; import java.io.IOException; import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.yoko.orb.OB.IORUtil; import org.apache.yoko.util.cmsf.CmsfThreadLocal; import org.omg.CORBA.BAD_PARAM; import org.omg.CORBA.INTERNAL; import org.omg.CORBA.LocalObject; import org.omg.IOP.RMICustomMaxStreamFormat; import org.omg.IOP.ServiceContext; import org.omg.PortableInterceptor.ForwardRequest; import org.omg.PortableInterceptor.InvalidSlot; import org.omg.PortableInterceptor.ServerRequestInfo; import org.omg.PortableInterceptor.ServerRequestInterceptor; public final class CmsfServerInterceptor extends LocalObject implements ServerRequestInterceptor { private static final Logger LOGGER = Logger.getLogger(CmsfServerInterceptor.class.getName()); private static final String NAME = CmsfServerInterceptor.class.getName(); private final int slotId; public CmsfServerInterceptor(int slotId) { this.slotId = slotId; } @Override public void receive_request_service_contexts(ServerRequestInfo ri) throws ForwardRequest { CmsfThreadLocal.reset(); CmsfVersion cmsf = CMSFv1; try { ServiceContext sc = ri.get_request_service_context(RMICustomMaxStreamFormat.value); cmsf = CmsfVersion.readData(sc.context_data); if (LOGGER.isLoggable(Level.FINEST)) LOGGER.finest(String.format("Using custom marshal stream format version: %s, retrieved from bytes: %s", cmsf, IORUtil.dump_octets(sc.context_data))); } catch (BAD_PARAM e) { if (e.minor != MinorInvalidServiceContextId) { throw e; } } try { ri.set_slot(slotId, cmsf.getAny()); } catch (InvalidSlot e) { throw (INTERNAL)(new INTERNAL(e.getMessage())).initCause(e); } } @Override public void receive_request(ServerRequestInfo ri) throws ForwardRequest { } private void setupCmsfThreadLocalValue(ServerRequestInfo ri) { CmsfVersion cmsf = CMSFv1; try { cmsf = CmsfVersion.readAny(ri.get_slot(slotId)); } catch (InvalidSlot e) { throw (INTERNAL)(new INTERNAL(e.getMessage())).initCause(e); } CmsfThreadLocal.push(cmsf.getValue()); } @Override public void send_reply(ServerRequestInfo ri) { setupCmsfThreadLocalValue(ri); } @Override public void send_exception(ServerRequestInfo ri) throws ForwardRequest { setupCmsfThreadLocalValue(ri); } @Override public void send_other(ServerRequestInfo ri) throws ForwardRequest { setupCmsfThreadLocalValue(ri); } @Override public String name() { return NAME; } @Override public void destroy() { } private void readObject(ObjectInputStream ios) throws IOException { throw new NotSerializableException(NAME); } private void writeObject(ObjectOutputStream oos) throws IOException { throw new NotSerializableException(NAME); } }
6,783
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/cmsf/CmsfIORInterceptor.java
package org.apache.yoko.orb.cmsf; import static org.apache.yoko.orb.cmsf.CmsfVersion.CMSFv2; import java.io.IOException; import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.omg.CORBA.LocalObject; import org.omg.PortableInterceptor.IORInfo; import org.omg.PortableInterceptor.IORInterceptor; public final class CmsfIORInterceptor extends LocalObject implements IORInterceptor { private static final String NAME = CmsfIORInterceptor.class.getName(); @Override public void establish_components(IORInfo info) { if (CmsfVersion.ENABLED) info.add_ior_component(CMSFv2.getTc()); } @Override public String name() { return NAME; } @Override public void destroy() { } private void readObject(ObjectInputStream ios) throws IOException { throw new NotSerializableException(NAME); } private void writeObject(ObjectOutputStream oos) throws IOException { throw new NotSerializableException(NAME); } }
6,784
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/RelativeRoundtripTimeoutPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class RelativeRoundtripTimeoutPolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.RelativeRoundtripTimeoutPolicy { private long value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public long relative_expiry() { return value_; } public int policy_type() { return org.omg.Messaging.RELATIVE_RT_TIMEOUT_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public RelativeRoundtripTimeoutPolicy_impl(long value) { value_ = value; } }
6,785
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/RoutingPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class RoutingPolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.RoutingPolicy { private org.omg.Messaging.RoutingTypeRange value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.Messaging.RoutingTypeRange routing_range() { return value_; } public int policy_type() { return org.omg.Messaging.ROUTING_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public RoutingPolicy_impl(org.omg.Messaging.RoutingTypeRange value) { value_ = value; } }
6,786
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/RequestStartTimePolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class RequestStartTimePolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.RequestStartTimePolicy { private org.omg.TimeBase.UtcT value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.TimeBase.UtcT start_time() { return value_; } public int policy_type() { return org.omg.Messaging.REQUEST_START_TIME_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public RequestStartTimePolicy_impl(org.omg.TimeBase.UtcT value) { value_ = value; } }
6,787
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/RequestEndTimePolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class RequestEndTimePolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.RequestEndTimePolicy { private org.omg.TimeBase.UtcT value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.TimeBase.UtcT end_time() { return value_; } public int policy_type() { return org.omg.Messaging.REQUEST_END_TIME_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public RequestEndTimePolicy_impl(org.omg.TimeBase.UtcT value) { value_ = value; } }
6,788
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/RequestPriorityPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class RequestPriorityPolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.RequestPriorityPolicy { private org.omg.Messaging.PriorityRange value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.Messaging.PriorityRange priority_range() { return value_; } public int policy_type() { return org.omg.Messaging.REQUEST_PRIORITY_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public RequestPriorityPolicy_impl(org.omg.Messaging.PriorityRange value) { value_ = value; } }
6,789
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/RelativeRequestTimeoutPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class RelativeRequestTimeoutPolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.RelativeRequestTimeoutPolicy { private long value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public long relative_expiry() { return value_; } public int policy_type() { return org.omg.Messaging.RELATIVE_REQ_TIMEOUT_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public RelativeRequestTimeoutPolicy_impl(long value) { value_ = value; } }
6,790
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/RebindPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class RebindPolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.RebindPolicy { private short value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public short rebind_mode() { return value_; } public int policy_type() { return org.omg.Messaging.REBIND_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public RebindPolicy_impl(short value) { value_ = value; } }
6,791
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/MaxHopsPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class MaxHopsPolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.MaxHopsPolicy { private short value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public short max_hops() { return value_; } public int policy_type() { return org.omg.Messaging.MAX_HOPS_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public MaxHopsPolicy_impl(short value) { value_ = value; } }
6,792
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/ReplyStartTimePolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class ReplyStartTimePolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.ReplyStartTimePolicy { private org.omg.TimeBase.UtcT value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.TimeBase.UtcT start_time() { return value_; } public int policy_type() { return org.omg.Messaging.REPLY_START_TIME_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ReplyStartTimePolicy_impl(org.omg.TimeBase.UtcT value) { value_ = value; } }
6,793
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/ReplyPriorityPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class ReplyPriorityPolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.ReplyPriorityPolicy { private org.omg.Messaging.PriorityRange value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.Messaging.PriorityRange priority_range() { return value_; } public int policy_type() { return org.omg.Messaging.REPLY_PRIORITY_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ReplyPriorityPolicy_impl(org.omg.Messaging.PriorityRange value) { value_ = value; } }
6,794
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/QueueOrderPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class QueueOrderPolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.QueueOrderPolicy { private short value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public short allowed_orders() { return value_; } public int policy_type() { return org.omg.Messaging.QUEUE_ORDER_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public QueueOrderPolicy_impl(short value) { value_ = value; } }
6,795
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/SyncScopePolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class SyncScopePolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.SyncScopePolicy { private short value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public short synchronization() { return value_; } public int policy_type() { return org.omg.Messaging.SYNC_SCOPE_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public SyncScopePolicy_impl(short value) { value_ = value; } }
6,796
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/Messaging/ReplyEndTimePolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.Messaging; final public class ReplyEndTimePolicy_impl extends org.omg.CORBA.LocalObject implements org.omg.Messaging.ReplyEndTimePolicy { private org.omg.TimeBase.UtcT value_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.TimeBase.UtcT end_time() { return value_; } public int policy_type() { return org.omg.Messaging.REPLY_END_TIME_POLICY_TYPE.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public ReplyEndTimePolicy_impl(org.omg.TimeBase.UtcT value) { value_ = value; } }
6,797
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBPortableServer/InterceptorCallPolicy_impl.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBPortableServer; import org.apache.yoko.orb.OBPortableServer.INTERCEPTOR_CALL_POLICY_ID; import org.apache.yoko.orb.OBPortableServer.InterceptorCallPolicy; public final class InterceptorCallPolicy_impl extends org.omg.CORBA.LocalObject implements InterceptorCallPolicy { private boolean value_; public InterceptorCallPolicy_impl(boolean value) { value_ = value; } public boolean value() { return value_; } public int policy_type() { return INTERCEPTOR_CALL_POLICY_ID.value; } public org.omg.CORBA.Policy copy() { return this; } public void destroy() { } }
6,798
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OBPortableServer/GIOP_VERSION_POLICY_1_0.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.yoko.orb.OBPortableServer; // // IDL:orb.yoko.apache.org/OBPortableServer/GIOP_VERSION_POLICY_1_0:1.0 // /** * * The <code>GIOP_VERSION_POLICY_1_0</code> GIOPVersionPolicy value. * **/ public interface GIOP_VERSION_POLICY_1_0 { short value = (short)(0L); }
6,799