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/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Exceptions.java
package org.apache.yoko.orb.OCI.IIOP; import static org.apache.yoko.orb.OB.MinorCodes.*; import org.omg.CORBA.COMM_FAILURE; import org.omg.CORBA.TRANSIENT; import java.io.IOException; import java.io.InterruptedIOException; import java.net.SocketException; import java.net.UnknownHostException; import static org.apache.yoko.orb.OB.MinorCodes.MinorSetsockopt; import static org.apache.yoko.orb.OB.MinorCodes.describeCommFailure; import static org.omg.CORBA.CompletionStatus.COMPLETED_NO; enum Exceptions {; static COMM_FAILURE asCommFailure(SocketException e) {return asCommFailure(e, MinorSetsockopt);} static COMM_FAILURE asCommFailure(UnknownHostException e) {return asCommFailure(e, MinorGethostbyname);} static COMM_FAILURE asCommFailure(IOException e, int minor) { String msg = String.format("%s: %s", describeCommFailure(minor), e.getMessage()); return (COMM_FAILURE) new COMM_FAILURE(msg, minor, COMPLETED_NO).initCause(e); } static COMM_FAILURE asCommFailure(Exception e, int minor, String message) { String msg = String.format("%s: %s: %s", describeCommFailure(minor), message, e.getMessage()); return (COMM_FAILURE) new COMM_FAILURE(msg, minor, COMPLETED_NO).initCause(e); } static TRANSIENT asTransient(Exception e, int minor) { String msg = String.format("%s: %s", describeTransient(minor), e.getMessage()); return (TRANSIENT) new TRANSIENT(msg, minor, COMPLETED_NO); } }
6,600
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/AcceptorInfo_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.OCI.IIOP; import org.apache.yoko.orb.OCI.IIOP.AcceptorInfo; import org.apache.yoko.orb.OCI.IIOP.PLUGIN_ID; import org.omg.CORBA.LocalObject; public final class AcceptorInfo_impl extends LocalObject implements AcceptorInfo { private Acceptor_impl acceptor_; // The associated acceptor // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String id() { return PLUGIN_ID.value; } public int tag() { return org.omg.IOP.TAG_INTERNET_IOP.value; } public synchronized String describe() { String desc = "id: " + PLUGIN_ID.value; String localAddr = addr(); short localPort = port(); desc += "\nlocal address: "; desc += localAddr; desc += ":"; desc += (localPort < 0 ? 0xffff + (int) localPort + 1 : localPort); desc += "\nhosts: "; String[] hostNames = hosts(); for (int i = 0; i < hostNames.length; i++) { if (i > 0) desc += ", "; desc += hostNames[i]; } return desc; } public synchronized String[] hosts() { if (acceptor_ == null) throw new org.omg.CORBA.NO_RESOURCES(); return acceptor_.hosts_; } public synchronized String addr() { if (acceptor_ == null) throw new org.omg.CORBA.NO_RESOURCES(); return acceptor_.socket_.getInetAddress().getHostAddress(); } public synchronized short port() { if (acceptor_ == null) throw new org.omg.CORBA.NO_RESOURCES(); int port = acceptor_.socket_.getLocalPort(); if (port >= 0x8000) return (short) (port - 0xffff - 1); else return (short) port; } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ AcceptorInfo_impl(Acceptor_impl acceptor) { acceptor_ = acceptor; } synchronized void _OB_destroy() { acceptor_ = null; } }
6,601
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/ConFactoryInfoOperations.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/ConFactoryInfo:1.0 // /** * * Information on an IIOP OCI Connector Factory object. * * @see ConFactory * @see ConFactoryInfo * **/ public interface ConFactoryInfoOperations extends org.apache.yoko.orb.OCI.ConFactoryInfoOperations { }
6,602
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/ExtendedConnectionHelper.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.OCI.IIOP; import java.io.IOException; import java.net.ConnectException; import java.net.InetAddress; import java.net.Socket; import java.net.ServerSocket; import org.omg.CORBA.ORB; import org.omg.CORBA.Policy; import org.omg.IOP.IOR; // // IDL:orb.yoko.apache.org/OCI/IIOP/AcceptorInfo:1.0 // /** * * Information on an IIOP OCI Acceptor object. * * @see Acceptor * @see AcceptorInfo * **/ public interface ExtendedConnectionHelper { public void init(ORB orb, String parms); public Socket createSocket(IOR ior, Policy[] policies, InetAddress address, int port) throws IOException, ConnectException; public Socket createSelfConnection(InetAddress address, int port) throws IOException, ConnectException; public ServerSocket createServerSocket(int port, int backlog, String[] params) throws IOException, ConnectException; public ServerSocket createServerSocket(int port, int backlog, InetAddress address, String[] params) throws IOException, ConnectException; }
6,603
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/AcceptorInfoHolder.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/AcceptorInfo:1.0 // final public class AcceptorInfoHolder implements org.omg.CORBA.portable.Streamable { public AcceptorInfo value; public AcceptorInfoHolder() { } public AcceptorInfoHolder(AcceptorInfo initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = AcceptorInfoHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { AcceptorInfoHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return AcceptorInfoHelper.type(); } }
6,604
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/CorbalocProtocol_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.OCI.IIOP; public class CorbalocProtocol_impl extends org.omg.CORBA.LocalObject implements org.apache.yoko.orb.OB.CorbalocProtocol { public String name() { return "iiop"; } public org.omg.IOP.TaggedProfile parse_address(String addr, byte[] key) { byte major, minor; // // Do we have an iiop version 'X.Y@' portion? (default is 1.0) // int start = 0; int at = addr.indexOf('@'); if (at == -1) { major = 1; minor = 0; } else { int pos = 0; int dot = 0; boolean seenDot = false; boolean ok = true; while (pos < at && ok) { char ch = addr.charAt(pos); if (ch == '.') { if (seenDot || pos == 0 || pos == at - 1) ok = false; seenDot = true; dot = pos; } else if (!Character.isDigit(ch)) ok = false; pos++; } if (!ok || !seenDot) throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress) + ": iiop version must be of the form `X.Y'", org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress, org.omg.CORBA.CompletionStatus.COMPLETED_NO); int nMajor = 0, nMinor = 0; try { nMajor = Integer.parseInt(addr.substring(0, dot)); nMinor = Integer.parseInt(addr.substring(dot + 1, at)); } catch (NumberFormatException ex) { } if (nMajor != 1 || nMinor > 255) throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress) + ": iiop version is invalid or unsupported", org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // Can only provide up to an iiop 1.2 profile. A server should // be able to communicate with a client with a lesser minor // version number. // if (nMinor > 2) nMinor = 2; major = (byte) nMajor; minor = (byte) nMinor; // // Skip the version // start = at + 1; } // // Empty hostname is illegal (as is port ':YYYY' by itself) // if (start == addr.length() || addr.charAt(start) == ':') throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress) + ": iiop hostname must be specified", org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress, org.omg.CORBA.CompletionStatus.COMPLETED_NO); // // Hostname is terminated by ':port', or by end of string // String host; int colon = addr.indexOf(':', start); if (colon == -1) host = addr.substring(start); else host = addr.substring(start, colon); // // Valid range for port is 1 - 65535 // int port = 2809; // default port if (colon != -1 && colon < addr.length()) { String str = addr.substring(colon + 1); try { port = Integer.parseInt(str); } catch (NumberFormatException ex) { throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress) + ": iiop port is invalid", org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } if (port < 1 || port > 65535) throw new org.omg.CORBA.BAD_PARAM( org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress) + ": iiop port must be between 1 and 65535", org.apache.yoko.orb.OB.MinorCodes.MinorBadAddress, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } // // Create profile // org.omg.IOP.TaggedProfile profile = new org.omg.IOP.TaggedProfile(); profile.tag = org.omg.IOP.TAG_INTERNET_IOP.value; if (major == (byte) 1 && minor == (byte) 0) { org.omg.IIOP.ProfileBody_1_0 body = new org.omg.IIOP.ProfileBody_1_0(); body.iiop_version = new org.omg.IIOP.Version(major, minor); body.host = host; if (port >= 0x8000) body.port = (short) (port - 0xffff - 1); else body.port = (short) port; body.object_key = key; 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.IIOP.ProfileBody_1_0Helper.write(out, body); profile.profile_data = new byte[buf.length()]; System.arraycopy(buf.data(), 0, profile.profile_data, 0, buf .length()); } else { // // IIOP version is 1.1 or 1.2 // org.omg.IIOP.ProfileBody_1_1 body = new org.omg.IIOP.ProfileBody_1_1(); body.iiop_version = new org.omg.IIOP.Version(major, minor); body.host = host; if (port >= 0x8000) body.port = (short) (port - 0xffff - 1); else body.port = (short) port; body.object_key = key; body.components = new org.omg.IOP.TaggedComponent[0]; 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.IIOP.ProfileBody_1_1Helper.write(out, body); profile.profile_data = new byte[buf.length()]; System.arraycopy(buf.data(), 0, profile.profile_data, 0, buf .length()); } return profile; } public void destroy() { } }
6,605
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/TransportInfoHelper.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/TransportInfo:1.0 // final public class TransportInfoHelper { public static void insert(org.omg.CORBA.Any any, TransportInfo val) { any.insert_Object(val, type()); } public static TransportInfo extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_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, 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_ = ((org.omg.CORBA_2_4.ORB)orb).create_local_interface_tc(id(), "TransportInfo"); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/OCI/IIOP/TransportInfo:1.0"; } public static TransportInfo read(org.omg.CORBA.portable.InputStream in) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadUnsupported), org.apache.yoko.orb.OB.MinorCodes.MinorReadUnsupported, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } public static void write(org.omg.CORBA.portable.OutputStream out, TransportInfo val) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorWriteUnsupported), org.apache.yoko.orb.OB.MinorCodes.MinorWriteUnsupported, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } public static TransportInfo narrow(org.omg.CORBA.Object val) { try { return (TransportInfo)val; } catch(ClassCastException ex) { } throw new org.omg.CORBA.BAD_PARAM(org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType), org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } }
6,606
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/TransportInfoHolder.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/TransportInfo:1.0 // final public class TransportInfoHolder implements org.omg.CORBA.portable.Streamable { public TransportInfo value; public TransportInfoHolder() { } public TransportInfoHolder(TransportInfo initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = TransportInfoHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { TransportInfoHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return TransportInfoHelper.type(); } }
6,607
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/TransportInfo.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/TransportInfo:1.0 // /** * * Information on an IIOP OCI Transport object. * * @see Transport * @see TransportInfo * **/ public interface TransportInfo extends TransportInfoOperations, org.apache.yoko.orb.OCI.TransportInfo { }
6,608
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/AccFactoryInfo_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.OCI.IIOP; import org.apache.yoko.orb.OCI.IIOP.AccFactoryInfo; import org.apache.yoko.orb.OCI.IIOP.PLUGIN_ID; final class AccFactoryInfo_impl extends org.omg.CORBA.LocalObject implements AccFactoryInfo { // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String id() { return PLUGIN_ID.value; } public int tag() { return org.omg.IOP.TAG_INTERNET_IOP.value; } public String describe() { return "id: " + PLUGIN_ID.value; } }
6,609
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/ConnectorInfo_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.OCI.IIOP; import static org.apache.yoko.orb.OCI.IIOP.Exceptions.*; import org.apache.yoko.orb.OCI.ConnectCB; import org.omg.CORBA.LocalObject; import org.omg.IOP.TAG_INTERNET_IOP; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.*; /** * Immutable memo of the endpoint details for a connection. The InetAddress * is looked up when first needed but never changed again. It is used in * hashcode() and equals(). */ public final class ConnectorInfo_impl extends LocalObject implements ConnectorInfo { private final String host; private final short port; private volatile InetAddress addr; // initialised lazily // // All connect callback objects // private final List<ConnectCB> callbacks; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String id() {return PLUGIN_ID.value;} public int tag() {return TAG_INTERNET_IOP.value;} public String describe() {return String.format("id: %s%nremote address: %s:%d", PLUGIN_ID.value, remote_addr(), port);} public String remote_addr() {return getInetAddress().getHostAddress();} public short remote_port() {return port;} // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ ConnectorInfo_impl(String host, int port, ConnectCB...cb) { this.host = host; this.port = (short)port; if (cb == null || cb.length == 0) callbacks = Collections.emptyList(); else callbacks = Collections.unmodifiableList(new ArrayList<ConnectCB>(Arrays.asList(cb))); } String getHost() { return host; } int getPort() { return (char)port; } private InetAddress getInetAddress() { if (addr == null) synchronized (this) { if (addr == null) try { addr = InetAddress.getByName(host); } catch (UnknownHostException ex) { throw asCommFailure(ex); } } return addr; } synchronized void _OB_callConnectCB(org.apache.yoko.orb.OCI.TransportInfo info) { for (ConnectCB cb : callbacks) cb.connect_cb(info); } @Override public boolean equals(Object other) { if (this == other) return true; if (!!! (other instanceof ConnectorInfo_impl)) return false; ConnectorInfo_impl that = (ConnectorInfo_impl) other; return (this.port == that.port) && this.getInetAddress().equals(that.getInetAddress()); } @Override public int hashCode() {return 31*port + getInetAddress().hashCode();} }
6,610
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/AcceptorInfoHelper.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/AcceptorInfo:1.0 // final public class AcceptorInfoHelper { public static void insert(org.omg.CORBA.Any any, AcceptorInfo val) { any.insert_Object(val, type()); } public static AcceptorInfo extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_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, 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_ = ((org.omg.CORBA_2_4.ORB)orb).create_local_interface_tc(id(), "AcceptorInfo"); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/OCI/IIOP/AcceptorInfo:1.0"; } public static AcceptorInfo read(org.omg.CORBA.portable.InputStream in) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadUnsupported), org.apache.yoko.orb.OB.MinorCodes.MinorReadUnsupported, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } public static void write(org.omg.CORBA.portable.OutputStream out, AcceptorInfo val) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorWriteUnsupported), org.apache.yoko.orb.OB.MinorCodes.MinorWriteUnsupported, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } public static AcceptorInfo narrow(org.omg.CORBA.Object val) { try { return (AcceptorInfo)val; } catch(ClassCastException ex) { } throw new org.omg.CORBA.BAD_PARAM(org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType), org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } }
6,611
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/InetAddrHelper.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/InetAddr:1.0 // final public class InetAddrHelper { public static void insert(org.omg.CORBA.Any any, String val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static String 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(), "InetAddr", orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string)); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/OCI/IIOP/InetAddr:1.0"; } public static String read(org.omg.CORBA.portable.InputStream in) { String _ob_v; _ob_v = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, String val) { out.write_string(val); } }
6,612
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/ListenerMap.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.OCI.IIOP; public final class ListenerMap { // // Internal list of ListenPoints // private java.util.LinkedList list_ = new java.util.LinkedList(); // // adds a new endpoint to the internal list // public void add(String host, short port) { // // first make sure we don't already have this host/port in our // list // java.util.ListIterator i = list_.listIterator(0); while (i.hasNext()) { org.omg.IIOP.ListenPoint lp = (org.omg.IIOP.ListenPoint) i.next(); if (match(lp, host, port)) return; } // // we are now free to add this item // org.omg.IIOP.ListenPoint lp = new org.omg.IIOP.ListenPoint(host, port); list_.add(lp); } // // removes an endpoint from the internal list // public void remove(String host, short port) { java.util.ListIterator i = list_.listIterator(0); while (i.hasNext()) { org.omg.IIOP.ListenPoint lp = (org.omg.IIOP.ListenPoint) i.next(); if (match(lp, host, port)) { i.remove(); return; } } } // // checks if a ListenPoint is equal to the specified host/port // public boolean match(org.omg.IIOP.ListenPoint lp, String host, short port) { if (lp.port != port) return false; if (host.equals(lp.host)) return true; return false; } // // returns an array of ListenPoints from this ListenerMap // public org.omg.IIOP.ListenPoint[] getListenPoints() { org.omg.IIOP.ListenPoint[] lpl = new org.omg.IIOP.ListenPoint[list_ .size()]; int i = 0; java.util.ListIterator itor = list_.listIterator(); while (itor.hasNext()) { lpl[i++] = (org.omg.IIOP.ListenPoint) itor.next(); } return lpl; } }
6,613
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/PLUGIN_ID.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/PLUGIN_ID:1.0 // /** The identifier for the ORBacus IIOP plug-in. */ public interface PLUGIN_ID { String value = "iiop"; }
6,614
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/AccFactoryInfo.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.OCI.IIOP; // // IDL:orb.yoko.apache.org/OCI/IIOP/AccFactoryInfo:1.0 // /** * * Information on an IIOP OCI Acceptor Factory object. * * @see AccFactory * **/ public interface AccFactoryInfo extends AccFactoryInfoOperations, org.apache.yoko.orb.OCI.AccFactoryInfo { }
6,615
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/DefaultConnectionHelper.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.OCI.IIOP; import java.io.IOException; import java.net.ConnectException; import java.net.InetAddress; import java.net.Socket; import java.net.ServerSocket; import java.net.SocketException; import org.omg.CORBA.ORB; import org.omg.CORBA.Policy; import org.omg.IOP.IOR; public class DefaultConnectionHelper implements ConnectionHelper { public void init(ORB orb, String parms) { // no initializer parameters required by this version. } public Socket createSocket(IOR ior, Policy[] policies, InetAddress address, int port) throws IOException, ConnectException { return setOptions(new Socket(address, port)); } public Socket createSelfConnection(InetAddress address, int port) throws IOException, ConnectException { return setOptions(new Socket(address, port)); } private Socket setOptions(Socket socket) throws SocketException { socket.setTcpNoDelay(true); return socket; } public ServerSocket createServerSocket(int port, int backlog) throws IOException, ConnectException { return setOptions(new ServerSocket(port, backlog)); } public ServerSocket createServerSocket(int port, int backlog, InetAddress address) throws IOException, ConnectException { return setOptions(new ServerSocket(port, backlog, address)); } private ServerSocket setOptions(ServerSocket serverSocket) throws SocketException { serverSocket.setReuseAddress(true); serverSocket.setPerformancePreferences(0, 2, 1); return serverSocket; } }
6,616
0
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI
Create_ds/geronimo-yoko/yoko-core/src/main/java/org/apache/yoko/orb/OCI/IIOP/AccFactory_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.OCI.IIOP; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.yoko.orb.OB.Assert; import org.apache.yoko.orb.OCI.IIOP.PLUGIN_ID; import org.omg.CORBA.ORBPackage.InvalidName; import org.omg.IOP.Codec; import org.omg.IOP.CodecFactory; import org.omg.IOP.ENCODING_CDR_ENCAPS; import org.omg.IOP.Encoding; import org.omg.IOP.CodecFactoryPackage.UnknownEncoding; final class AccFactory_impl extends org.omg.CORBA.LocalObject implements org.apache.yoko.orb.OCI.AccFactory { // the real logger backing instance. We use the interface class as the locator static final Logger logger = Logger.getLogger(org.apache.yoko.orb.OCI.AccFactory.class.getName()); private static final Encoding CDR_1_2_ENCODING = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 2); // // AccFactory information // private AccFactoryInfo_impl info_; private org.omg.CORBA.ORB orb_; // The ORB private ConnectionHelper connectionHelper_; // client connection helper private ListenerMap listenMap_; private ExtendedConnectionHelper extendedConnectionHelper_; // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public String id() { return PLUGIN_ID.value; } public int tag() { return org.omg.IOP.TAG_INTERNET_IOP.value; } public org.apache.yoko.orb.OCI.AccFactoryInfo get_info() { return info_; } public org.apache.yoko.orb.OCI.Acceptor create_acceptor(String[] params) throws org.apache.yoko.orb.OCI.InvalidParam { String bind = null; String[] hosts = null; boolean keepAlive = true; boolean multiProfile = false; int port = 0; int backlog = 0; boolean numeric = false; int i = 0; while (i < params.length) { if (params[i].equals("--backlog")) { if (i + 1 >= params.length) throw new org.apache.yoko.orb.OCI.InvalidParam( "argument expected " + "for --backlog"); String arg = params[i + 1]; try { backlog = Integer.valueOf(arg).intValue(); } catch (NumberFormatException ex) { throw new org.apache.yoko.orb.OCI.InvalidParam( "invalid argument " + "for backlog"); } if (backlog < 1 || backlog > 65535) throw new org.apache.yoko.orb.OCI.InvalidParam( "invalid backlog"); i += 2; } else if (params[i].equals("--bind")) { if (i + 1 >= params.length) throw new org.apache.yoko.orb.OCI.InvalidParam( "argument expected " + "for --bind"); bind = params[i + 1]; i += 2; } else if (params[i].equals("--host")) { if (i + 1 >= params.length) throw new org.apache.yoko.orb.OCI.InvalidParam( "argument expected " + "for --host"); java.util.Vector vec = new java.util.Vector(); int start = 0; String str = params[i + 1]; while (true) { while (start < str.length() && str.charAt(start) == ' ') start++; if (start >= str.length()) break; int comma = str.indexOf(',', start); if (comma == start) start++; else { if (comma == -1) comma = str.length(); int end = comma - 1; while (str.charAt(end) == ' ') end--; vec.addElement(str.substring(start, end + 1)); start = comma + 1; } } if (vec.size() == 0) throw new org.apache.yoko.orb.OCI.InvalidParam( "invalid argument " + "for --host"); hosts = new String[vec.size()]; vec.copyInto(hosts); i += 2; } else if (params[i].equals("--multi-profile")) { multiProfile = true; i++; } else if (params[i].equals("--no-keepalive")) { keepAlive = false; i++; } else if (params[i].equals("--numeric")) { numeric = true; i++; } else if (params[i].equals("--port")) { if (i + 1 >= params.length) throw new org.apache.yoko.orb.OCI.InvalidParam( "argument expected " + "for --port"); String arg = params[i + 1]; try { port = Integer.valueOf(arg).intValue(); } catch (NumberFormatException ex) { throw new org.apache.yoko.orb.OCI.InvalidParam( "invalid argument " + "for port"); } if (port < 1 || port > 65535) throw new org.apache.yoko.orb.OCI.InvalidParam( "invalid port"); i += 2; } else if (connectionHelper_ != null){ throw new org.apache.yoko.orb.OCI.InvalidParam( "unknown parameter: " + params[i]); } else { i++; } } if (hosts == null) { hosts = new String[1]; hosts[0] = org.apache.yoko.orb.OB.Net.getCanonicalHostname(numeric); } logger.fine("Creating acceptor for port=" + port); Codec codec; try { codec = ((CodecFactory) orb_.resolve_initial_references("CodecFactory")).create_codec(CDR_1_2_ENCODING); } catch (InvalidName e) { throw new org.apache.yoko.orb.OCI.InvalidParam("Could not obtain codec factory using name 'CodecFactory'"); } catch (UnknownEncoding e) { throw new org.apache.yoko.orb.OCI.InvalidParam("Could not obtain codec using encoding " + CDR_1_2_ENCODING); } return new Acceptor_impl(bind, hosts, multiProfile, port, backlog, keepAlive, connectionHelper_, extendedConnectionHelper_, listenMap_, params, codec); } public void change_key(org.omg.IOP.IORHolder ior, byte[] key) { // // Extract the IIOP profile information from the provided IOR // for (int profile = 0; profile < ior.value.profiles.length; profile++) { if (ior.value.profiles[profile].tag == org.omg.IOP.TAG_INTERNET_IOP.value) { // // Extract the 1_0 profile body // byte[] data = ior.value.profiles[profile].profile_data; org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer( data, data.length); org.apache.yoko.orb.CORBA.InputStream in = new org.apache.yoko.orb.CORBA.InputStream( buf, 0, false, null, null); in._OB_readEndian(); org.omg.IIOP.ProfileBody_1_0 body = org.omg.IIOP.ProfileBody_1_0Helper .read(in); // // Read components if the IIOP version is > 1.0 // org.omg.IOP.TaggedComponent[] components; if (body.iiop_version.major > 1 || body.iiop_version.minor > 0) { int len = in.read_ulong(); components = new org.omg.IOP.TaggedComponent[len]; for (int j = 0; j < len; j++) components[j] = org.omg.IOP.TaggedComponentHelper .read(in); } else components = new org.omg.IOP.TaggedComponent[0]; // // Fill in the new object-key // body.object_key = key; // // Remarshal the new body // org.apache.yoko.orb.OCI.Buffer buf2 = new org.apache.yoko.orb.OCI.Buffer(); org.apache.yoko.orb.CORBA.OutputStream out = new org.apache.yoko.orb.CORBA.OutputStream( buf2); out._OB_writeEndian(); org.omg.IIOP.ProfileBody_1_0Helper.write(out, body); // // Remarshal the components if the IIOP version is > 1.0 // if (body.iiop_version.major > 1 || body.iiop_version.minor > 0) { out.write_ulong(components.length); for (int i = 0; i < components.length; i++) org.omg.IOP.TaggedComponentHelper.write(out, components[i]); } ior.value.profiles[profile].profile_data = new byte[buf2 .length()]; System.arraycopy(buf2.data(), 0, ior.value.profiles[profile].profile_data, 0, buf2 .length()); } } } // ------------------------------------------------------------------ // Yoko internal functions // Application programs must not use these functions directly // ------------------------------------------------------------------ public AccFactory_impl(org.omg.CORBA.ORB orb, ListenerMap lm, ConnectionHelper helper, ExtendedConnectionHelper extendedHelper) { Assert._OB_assert((helper == null) ^ (extendedHelper == null)); orb_ = orb; info_ = new AccFactoryInfo_impl(); listenMap_ = lm; connectionHelper_ = helper; extendedConnectionHelper_ = extendedHelper; } }
6,617
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/DynamicAny/DynArray_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; final class DynArray_impl extends DynSeqBase_impl implements org.omg.DynamicAny.DynArray { DynArray_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { super(factory, orbInstance, type); } DynArray_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type, DynValueReader dynValueReader) { super(factory, orbInstance, type, dynValueReader); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized org.omg.CORBA.Any[] get_elements() { return getElements(); } public synchronized void set_elements(org.omg.CORBA.Any[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { for (int i = 0; i < value.length; i++) { org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(value[i] .type()); if (origTC.kind() != contentKind_) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } if (value.length != length_) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); for (int i = 0; i < value.length; i++) setValue(i, value[i]); index_ = 0; notifyParent(); } public synchronized org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any() { return getElementsAsDynAny(); } public synchronized void set_elements_as_dyn_any( org.omg.DynamicAny.DynAny[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { for (int i = 0; i < value.length; i++) { org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(value[i] .type()); if (origTC.kind() != contentKind_) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } if (value.length != length_) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); for (int i = 0; i < value.length; i++) setValue(i, value[i]); index_ = 0; notifyParent(); } }
6,618
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/DynamicAny/DynEnum_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; final class DynEnum_impl extends DynAny_impl implements org.omg.DynamicAny.DynEnum { private int value_; DynEnum_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { super(factory, orbInstance, type); value_ = 0; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return; if (!dyn_any.type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.omg.DynamicAny.DynEnum dyn_enum = (org.omg.DynamicAny.DynEnum) dyn_any; value_ = dyn_enum.get_as_ulong(); notifyParent(); } public synchronized void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); Any val = null; try { val = (Any) value; } catch (ClassCastException ex) { val = new Any(value); } if (val.value() == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); if (!val._OB_type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); value_ = ((Integer) val.value()).intValue(); notifyParent(); } public synchronized org.omg.CORBA.Any to_any() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return new Any(orbInstance_, type_, new Integer(value_)); } public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) { return to_any(); } public synchronized boolean equal(org.omg.DynamicAny.DynAny dyn_any) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return true; if (!dyn_any.type().equivalent(type_)) return false; org.omg.DynamicAny.DynEnum dyn_enum = (org.omg.DynamicAny.DynEnum) dyn_any; return (value_ == dyn_enum.get_as_ulong()); } public synchronized org.omg.DynamicAny.DynAny copy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); DynEnum_impl result = new DynEnum_impl(factory_, orbInstance_, type_); result.value_ = value_; return result; } public boolean seek(int index) { return false; } public void rewind() { // do nothing } public boolean next() { return false; } public int component_count() { return 0; } public org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } public synchronized String get_as_string() { String result = null; try { result = origType_.member_name(value_); } 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; } public synchronized void set_as_string(String value) throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { try { int count = origType_.member_count(); for (int i = 0; i < count; i++) { if (value.equals(origType_.member_name(i))) { value_ = i; notifyParent(); return; } } throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); } 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); } } public synchronized int get_as_ulong() { return value_; } public synchronized void set_as_ulong(int value) throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { try { if (value < 0 || value >= origType_.member_count()) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); value_ = value; notifyParent(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } // ------------------------------------------------------------------ // Internal member implementations // ------------------------------------------------------------------ synchronized void _OB_marshal(OutputStream out) { out.write_ulong(value_); } synchronized void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter) { _OB_marshal(out); } synchronized void _OB_unmarshal(InputStream in) { value_ = in.read_ulong(); notifyParent(); } synchronized Any _OB_currentAny() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return null; } synchronized Any _OB_currentAnyValue() { return null; } }
6,619
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/DynamicAny/DynValueCommon_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; abstract class DynValueCommon_impl extends DynAny_impl implements org.omg.DynamicAny.DynValueCommon { private boolean isNull_; DynValueCommon_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { super(factory, orbInstance, type); } // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ protected abstract void createComponents(); protected abstract void destroyComponents(); // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized boolean is_null() { return isNull_; } public synchronized void set_to_null() { if (!isNull_) { isNull_ = true; destroyComponents(); } } public synchronized void set_to_value() { if (isNull_) { isNull_ = false; createComponents(); } } }
6,620
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/DynamicAny/DynSeqBase_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; abstract class DynSeqBase_impl extends DynAny_impl { protected org.omg.CORBA.TypeCode contentType_; protected org.omg.CORBA.TCKind contentKind_; protected org.omg.DynamicAny.DynAny[] components_; protected int index_ = 0; protected int length_ = 0; protected int max_ = 0; protected java.lang.Object buf_; protected boolean primitive_; protected boolean ignoreChild_; org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader_; DynSeqBase_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { this(factory, orbInstance, type, null); } DynSeqBase_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type, org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader) { super(factory, orbInstance, type); dynValueReader_ = dynValueReader; components_ = new org.omg.DynamicAny.DynAny[0]; try { contentType_ = origType_.content_type(); org.omg.CORBA.TypeCode origContent = TypeCode ._OB_getOrigType(contentType_); contentKind_ = origContent.kind(); length_ = 0; index_ = -1; buf_ = null; ignoreChild_ = false; switch (contentKind_.value()) { 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_string: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_wchar: case org.omg.CORBA.TCKind._tk_wstring: primitive_ = true; break; default: primitive_ = false; break; } // // An array must be initialized to its proper length // max_ = origType_.length(); if (origType_.kind() == org.omg.CORBA.TCKind.tk_array) { resize(max_, true); index_ = 0; } } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ protected void childModified(org.omg.DynamicAny.DynAny p) { if (ignoreChild_) { ignoreChild_ = false; return; } // // If this object holds a sequence of primitive types, we need // to keep the optimized array and the components in sync // if (primitive_) { int i; for (i = 0; i < length_; i++) if (components_[i] == p) break; org.apache.yoko.orb.OB.Assert._OB_assert(i < length_); try { setValue(i, p); } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } notifyParent(); } } protected void validate(org.omg.CORBA.TCKind kind) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (kind != contentKind_) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ < 0) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.apache.yoko.orb.OB.Assert._OB_assert(length_ > 0); } protected void getValue(int index, org.omg.CORBA.Any a) { Any any = (Any) a; // // Get the value from the primitive array at the given index // and insert it into the any // org.apache.yoko.orb.OB.Assert._OB_assert(index < length_ && primitive_); switch (contentKind_.value()) { case org.omg.CORBA.TCKind._tk_short: { short[] buf = (short[]) buf_; any.replace(contentType_, new Integer(buf[index])); break; } case org.omg.CORBA.TCKind._tk_long: { int[] buf = (int[]) buf_; any.replace(contentType_, new Integer(buf[index])); break; } case org.omg.CORBA.TCKind._tk_ushort: { short[] buf = (short[]) buf_; any.replace(contentType_, new Integer(buf[index])); break; } case org.omg.CORBA.TCKind._tk_ulong: { int[] buf = (int[]) buf_; any.replace(contentType_, new Integer(buf[index])); break; } case org.omg.CORBA.TCKind._tk_float: { float[] buf = (float[]) buf_; any.replace(contentType_, new Float(buf[index])); break; } case org.omg.CORBA.TCKind._tk_double: { double[] buf = (double[]) buf_; any.replace(contentType_, new Double(buf[index])); break; } case org.omg.CORBA.TCKind._tk_boolean: { boolean[] buf = (boolean[]) buf_; any.replace(contentType_, Boolean.valueOf(buf[index])); break; } case org.omg.CORBA.TCKind._tk_char: { char[] buf = (char[]) buf_; any.replace(contentType_, new Character(buf[index])); break; } case org.omg.CORBA.TCKind._tk_octet: { byte[] buf = (byte[]) buf_; any.replace(contentType_, new Byte(buf[index])); break; } case org.omg.CORBA.TCKind._tk_string: { String[] buf = (String[]) buf_; any.replace(contentType_, new String(buf[index])); break; } case org.omg.CORBA.TCKind._tk_longlong: { long[] buf = (long[]) buf_; any.replace(contentType_, new Long(buf[index])); break; } case org.omg.CORBA.TCKind._tk_ulonglong: { long[] buf = (long[]) buf_; any.replace(contentType_, new Long(buf[index])); break; } case org.omg.CORBA.TCKind._tk_wchar: { char[] buf = (char[]) buf_; any.replace(contentType_, new Character(buf[index])); break; } case org.omg.CORBA.TCKind._tk_wstring: { String[] buf = (String[]) buf_; any.replace(contentType_, new String(buf[index])); break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported sequence type"); } } protected void setValue(int index, org.omg.CORBA.Any any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { // // Set the value of the primitive array and/or component from // the contents of the any // org.apache.yoko.orb.OB.Assert._OB_assert(index < length_); if (components_[index] != null) components_[index].from_any(any); else { switch (contentKind_.value()) { case org.omg.CORBA.TCKind._tk_short: { short[] buf = (short[]) buf_; buf[index] = any.extract_short(); break; } case org.omg.CORBA.TCKind._tk_long: { int[] buf = (int[]) buf_; buf[index] = any.extract_long(); break; } case org.omg.CORBA.TCKind._tk_ushort: { short[] buf = (short[]) buf_; buf[index] = any.extract_ushort(); break; } case org.omg.CORBA.TCKind._tk_ulong: { int[] buf = (int[]) buf_; buf[index] = any.extract_ulong(); break; } case org.omg.CORBA.TCKind._tk_float: { float[] buf = (float[]) buf_; buf[index] = any.extract_float(); break; } case org.omg.CORBA.TCKind._tk_double: { double[] buf = (double[]) buf_; buf[index] = any.extract_double(); break; } case org.omg.CORBA.TCKind._tk_boolean: { boolean[] buf = (boolean[]) buf_; buf[index] = any.extract_boolean(); break; } case org.omg.CORBA.TCKind._tk_char: { char[] buf = (char[]) buf_; buf[index] = any.extract_char(); break; } case org.omg.CORBA.TCKind._tk_octet: { byte[] buf = (byte[]) buf_; buf[index] = any.extract_octet(); break; } case org.omg.CORBA.TCKind._tk_string: { String[] buf = (String[]) buf_; buf[index] = any.extract_string(); break; } case org.omg.CORBA.TCKind._tk_longlong: { long[] buf = (long[]) buf_; buf[index] = any.extract_longlong(); break; } case org.omg.CORBA.TCKind._tk_ulonglong: { long[] buf = (long[]) buf_; buf[index] = any.extract_ulonglong(); break; } case org.omg.CORBA.TCKind._tk_wchar: { char[] buf = (char[]) buf_; buf[index] = any.extract_wchar(); break; } case org.omg.CORBA.TCKind._tk_wstring: { String[] buf = (String[]) buf_; buf[index] = any.extract_wstring(); break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported sequence type"); } } } protected void setValue(int index, org.omg.DynamicAny.DynAny p) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { // // Set value from a DynAny object. We update our primitive // array and our component. // if (primitive_) { switch (contentKind_.value()) { case org.omg.CORBA.TCKind._tk_short: { short[] buf = (short[]) buf_; buf[index] = p.get_short(); break; } case org.omg.CORBA.TCKind._tk_long: { int[] buf = (int[]) buf_; buf[index] = p.get_long(); break; } case org.omg.CORBA.TCKind._tk_ushort: { short[] buf = (short[]) buf_; buf[index] = p.get_ushort(); break; } case org.omg.CORBA.TCKind._tk_ulong: { int[] buf = (int[]) buf_; buf[index] = p.get_ulong(); break; } case org.omg.CORBA.TCKind._tk_float: { float[] buf = (float[]) buf_; buf[index] = p.get_float(); break; } case org.omg.CORBA.TCKind._tk_double: { double[] buf = (double[]) buf_; buf[index] = p.get_double(); break; } case org.omg.CORBA.TCKind._tk_boolean: { boolean[] buf = (boolean[]) buf_; buf[index] = p.get_boolean(); break; } case org.omg.CORBA.TCKind._tk_char: { char[] buf = (char[]) buf_; buf[index] = p.get_char(); break; } case org.omg.CORBA.TCKind._tk_octet: { byte[] buf = (byte[]) buf_; buf[index] = p.get_octet(); break; } case org.omg.CORBA.TCKind._tk_string: { String[] buf = (String[]) buf_; buf[index] = p.get_string(); break; } case org.omg.CORBA.TCKind._tk_longlong: { long[] buf = (long[]) buf_; buf[index] = p.get_longlong(); break; } case org.omg.CORBA.TCKind._tk_ulonglong: { long[] buf = (long[]) buf_; buf[index] = p.get_ulonglong(); break; } case org.omg.CORBA.TCKind._tk_wchar: { char[] buf = (char[]) buf_; buf[index] = p.get_wchar(); break; } case org.omg.CORBA.TCKind._tk_wstring: { String[] buf = (String[]) buf_; buf[index] = p.get_wstring(); break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported sequence type"); } } if (components_[index] != null && components_[index] != p) { ignoreChild_ = true; components_[index].assign(p); } } private void updateComponent(int index, boolean createComp) { // // Update the component with the value from the primitive array. // If desired, the component will be created first. // if (components_[index] == null) { if (createComp) components_[index] = create(contentType_, true); else return; } Any any = new Any(orbInstance_); getValue(index, any); ignoreChild_ = true; try { components_[index].from_any(any); } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } protected void resize(int len, boolean init) { if (primitive_ && len > length_) { switch (contentKind_.value()) { case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_ushort: { short[] oldBuf = (short[]) buf_; if (len > 0) { short[] buf = new short[len]; if (init && oldBuf != null) System.arraycopy(oldBuf, 0, buf, 0, length_); buf_ = buf; } else buf_ = null; break; } case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_ulong: { int[] oldBuf = (int[]) buf_; if (len > 0) { int[] buf = new int[len]; if (init && oldBuf != null) System.arraycopy(oldBuf, 0, buf, 0, length_); buf_ = buf; } else buf_ = null; break; } case org.omg.CORBA.TCKind._tk_float: { float[] oldBuf = (float[]) buf_; if (len > 0) { float[] buf = new float[len]; if (init && oldBuf != null) System.arraycopy(oldBuf, 0, buf, 0, length_); buf_ = buf; } else buf_ = null; break; } case org.omg.CORBA.TCKind._tk_double: { double[] oldBuf = (double[]) buf_; if (len > 0) { double[] buf = new double[len]; if (init && oldBuf != null) System.arraycopy(oldBuf, 0, buf, 0, length_); buf_ = buf; } else buf_ = null; break; } case org.omg.CORBA.TCKind._tk_boolean: { boolean[] oldBuf = (boolean[]) buf_; if (len > 0) { boolean[] buf = new boolean[len]; if (init && oldBuf != null) System.arraycopy(oldBuf, 0, buf, 0, length_); buf_ = buf; } else buf_ = null; break; } case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_wchar: { char[] oldBuf = (char[]) buf_; if (len > 0) { char[] buf = new char[len]; if (init && oldBuf != null) System.arraycopy(oldBuf, 0, buf, 0, length_); buf_ = buf; } else buf_ = null; break; } case org.omg.CORBA.TCKind._tk_octet: { byte[] oldBuf = (byte[]) buf_; if (len > 0) { byte[] buf = new byte[len]; if (init && oldBuf != null) System.arraycopy(oldBuf, 0, buf, 0, length_); buf_ = buf; } else buf_ = null; break; } case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: { String[] oldBuf = (String[]) buf_; if (len > 0) { String[] buf = new String[len]; if (init) { if (oldBuf != null) { System.arraycopy(oldBuf, 0, buf, 0, length_); for (int i = length_; i < len; i++) buf[i] = ""; } else { for (int i = 0; i < len; i++) buf[i] = ""; } } buf_ = buf; } else buf_ = null; break; } case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: { long[] oldBuf = (long[]) buf_; if (len > 0) { long[] buf = new long[len]; if (init && oldBuf != null) System.arraycopy(oldBuf, 0, buf, 0, length_); buf_ = buf; } else buf_ = null; break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported sequence type"); } } // // Update the components_ sequence. Although we use a separate // array for primitive types, we still keep the length of the // components_ sequence consistent. New elements are initialized // to nil for primitive types. // if (len > length_) // increase length { org.omg.DynamicAny.DynAny[] components = new org.omg.DynamicAny.DynAny[len]; System.arraycopy(components_, 0, components, 0, length_); if ((contentKind_.value() == org.omg.CORBA.TCKind._tk_value) && (dynValueReader_ != null)) { for (int i = length_; i < len; i++) components[i] = null; } else { for (int i = length_; i < len; i++) { if (!primitive_) components[i] = prepare(contentType_, dynValueReader_, true); else components[i] = null; } } components_ = components; } else if (len < length_) // decrease length { org.omg.DynamicAny.DynAny[] components = new org.omg.DynamicAny.DynAny[len]; System.arraycopy(components_, 0, components, 0, len); components_ = components; } // // Update the current position, if necessary // if (len > length_) // length was increased { if (index_ == -1) index_ = length_; // first newly-added element } else if (len < length_) // length was decreased { if (len == 0 || index_ >= len) index_ = -1; } length_ = len; } protected org.omg.CORBA.Any[] getElements() { org.omg.CORBA.Any[] result = new org.omg.CORBA.Any[length_]; for (int i = 0; i < length_; i++) { if (primitive_) { result[i] = new Any(orbInstance_); getValue(i, result[i]); } else { result[i] = components_[i].to_any(); } } return result; } protected org.omg.DynamicAny.DynAny[] getElementsAsDynAny() { if (primitive_) { for (int i = 0; i < length_; i++) { if (components_[i] == null) updateComponent(i, true); } } org.omg.DynamicAny.DynAny[] result = new org.omg.DynamicAny.DynAny[length_]; System.arraycopy(components_, 0, result, 0, length_); return result; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return; if (!dyn_any.type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); DynAny_impl impl = (DynAny_impl) dyn_any; org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); impl._OB_marshal(out); org.omg.CORBA.portable.InputStream in = out.create_input_stream(); _OB_unmarshal((InputStream) in); notifyParent(); } public synchronized void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // Convert value to an ORBacus Any - the JDK implementation // of TypeCode.equivalent() raises NO_IMPLEMENT // Any val = null; try { val = (Any) value; } catch (ClassCastException ex) { try { val = new Any(value); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } } if (!val._OB_type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (val.value() == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.portable.InputStream in = val.create_input_stream(); _OB_unmarshal((InputStream) in); index_ = 0; notifyParent(); } public synchronized org.omg.CORBA.Any to_any() { return to_any(null); } public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); if (dynValueWriter != null) _OB_marshal(out, dynValueWriter); else _OB_marshal(out); org.omg.CORBA.portable.InputStream in = out.create_input_stream(); Any result = new Any(orbInstance_, type_, in); return result; } public synchronized boolean equal(org.omg.DynamicAny.DynAny dyn_any) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return true; if (!dyn_any.type().equivalent(type_)) return false; if (length_ != dyn_any.component_count()) return false; if (length_ == 0) return true; DynSeqBase_impl seq = (DynSeqBase_impl) dyn_any; if (primitive_) { switch (contentKind_.value()) { case org.omg.CORBA.TCKind._tk_short: case org.omg.CORBA.TCKind._tk_ushort: { short[] buf1 = (short[]) buf_; short[] buf2 = (short[]) seq.buf_; for (int i = 0; i < length_; i++) if (buf1[i] != buf2[i]) return false; break; } case org.omg.CORBA.TCKind._tk_long: case org.omg.CORBA.TCKind._tk_ulong: { int[] buf1 = (int[]) buf_; int[] buf2 = (int[]) seq.buf_; for (int i = 0; i < length_; i++) if (buf1[i] != buf2[i]) return false; break; } case org.omg.CORBA.TCKind._tk_float: { float[] buf1 = (float[]) buf_; float[] buf2 = (float[]) seq.buf_; for (int i = 0; i < length_; i++) if (buf1[i] != buf2[i]) return false; break; } case org.omg.CORBA.TCKind._tk_double: { double[] buf1 = (double[]) buf_; double[] buf2 = (double[]) seq.buf_; for (int i = 0; i < length_; i++) if (buf1[i] != buf2[i]) return false; break; } case org.omg.CORBA.TCKind._tk_boolean: { boolean[] buf1 = (boolean[]) buf_; boolean[] buf2 = (boolean[]) seq.buf_; for (int i = 0; i < length_; i++) if (buf1[i] != buf2[i]) return false; break; } case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_wchar: { char[] buf1 = (char[]) buf_; char[] buf2 = (char[]) seq.buf_; for (int i = 0; i < length_; i++) if (buf1[i] != buf2[i]) return false; break; } case org.omg.CORBA.TCKind._tk_octet: { byte[] buf1 = (byte[]) buf_; byte[] buf2 = (byte[]) seq.buf_; for (int i = 0; i < length_; i++) if (buf1[i] != buf2[i]) return false; break; } case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: { String[] buf1 = (String[]) buf_; String[] buf2 = (String[]) seq.buf_; for (int i = 0; i < length_; i++) if (!buf1[i].equals(buf2[i])) return false; break; } case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: { long[] buf1 = (long[]) buf_; long[] buf2 = (long[]) seq.buf_; for (int i = 0; i < length_; i++) if (buf1[i] != buf2[i]) return false; break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported sequence type"); } } else { for (int i = 0; i < length_; i++) if (!components_[i].equal(seq.components_[i])) return false; } return true; } public synchronized org.omg.DynamicAny.DynAny copy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); DynValueWriter dynValueWriter = new DynValueWriter(orbInstance_, factory_); org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); _OB_marshal(out, dynValueWriter); dynValueReader_ = dynValueWriter.getReader(); org.omg.DynamicAny.DynAny result = prepare(type_, dynValueReader_, false); DynSeqBase_impl seq = (DynSeqBase_impl) result; org.omg.CORBA.portable.InputStream in = out.create_input_stream(); seq._OB_unmarshal((InputStream) in); return result; } public synchronized boolean seek(int index) { if (index >= length_ || index < 0) { index_ = -1; return false; } index_ = index; return true; } public synchronized void rewind() { seek(0); } public synchronized boolean next() { index_++; if (index_ == length_) { index_ = -1; return false; } return true; } public synchronized int component_count() { return length_; } public synchronized org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (index_ < 0) return null; // // Create component if necessary // if (components_[index_] == null) updateComponent(index_, true); return components_[index_]; } final public synchronized void insert_boolean(boolean value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_boolean); boolean[] buf = (boolean[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_octet(byte value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_octet); byte[] buf = (byte[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_char(char value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_char); char[] buf = (char[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_short(short value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_short); short[] buf = (short[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_ushort(short value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_ushort); short[] buf = (short[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_long(int value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_long); int[] buf = (int[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_ulong(int value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_ulong); int[] buf = (int[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_float(float value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_float); float[] buf = (float[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_double(double value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_double); double[] buf = (double[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_string(String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (value == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); validate(org.omg.CORBA.TCKind.tk_string); org.omg.CORBA.TypeCode origContent = TypeCode ._OB_getOrigType(contentType_); // // Check for bounded string // try { int len = origContent.length(); if (len > 0 && value.length() > len) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } String[] buf = (String[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_reference(org.omg.CORBA.Object value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_objref); // // Delegate to component // components_[index_].insert_reference(value); notifyParent(); } final public synchronized void insert_typecode(org.omg.CORBA.TypeCode value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_TypeCode); // // Delegate to component // components_[index_].insert_typecode(value); notifyParent(); } final public synchronized void insert_longlong(long value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_longlong); long[] buf = (long[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_ulonglong(long value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_ulonglong); long[] buf = (long[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_wchar(char value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_wchar); char[] buf = (char[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_wstring(String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (value == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); validate(org.omg.CORBA.TCKind.tk_wstring); org.omg.CORBA.TypeCode origContent = TypeCode ._OB_getOrigType(contentType_); // // Check for bounded wstring // try { int len = origContent.length(); if (len > 0 && value.length() > len) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } String[] buf = (String[]) buf_; buf[index_] = value; updateComponent(index_, false); notifyParent(); } final public synchronized void insert_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_any); // // Delegate to component // components_[index_].insert_any(value); notifyParent(); } final public synchronized void insert_dyn_any( org.omg.DynamicAny.DynAny value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (value == null) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); validate(org.omg.CORBA.TCKind.tk_any); // // Delegate to component // components_[index_].insert_dyn_any(value); notifyParent(); } final public synchronized void insert_val(java.io.Serializable value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (contentKind_ != org.omg.CORBA.TCKind.tk_value && contentKind_ != org.omg.CORBA.TCKind.tk_value_box) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ < 0) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Delegate to component // components_[index_].insert_val(value); notifyParent(); } final public synchronized boolean get_boolean() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_boolean); boolean[] buf = (boolean[]) buf_; return buf[index_]; } final public synchronized byte get_octet() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_octet); byte[] buf = (byte[]) buf_; return buf[index_]; } final public synchronized char get_char() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_char); char[] buf = (char[]) buf_; return buf[index_]; } final public synchronized short get_short() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_short); short[] buf = (short[]) buf_; return buf[index_]; } final public synchronized short get_ushort() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_ushort); short[] buf = (short[]) buf_; return buf[index_]; } final public synchronized int get_long() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_long); int[] buf = (int[]) buf_; return buf[index_]; } final public synchronized int get_ulong() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_ulong); int[] buf = (int[]) buf_; return buf[index_]; } final public synchronized float get_float() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_float); float[] buf = (float[]) buf_; return buf[index_]; } final public synchronized double get_double() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_double); double[] buf = (double[]) buf_; return buf[index_]; } final public synchronized String get_string() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_string); String[] buf = (String[]) buf_; return buf[index_]; } final public synchronized org.omg.CORBA.Object get_reference() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_objref); // // Delegate to component // return components_[index_].get_reference(); } final public synchronized org.omg.CORBA.TypeCode get_typecode() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_TypeCode); // // Delegate to component // return components_[index_].get_typecode(); } final public synchronized long get_longlong() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_longlong); long[] buf = (long[]) buf_; return buf[index_]; } final public synchronized long get_ulonglong() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_ulonglong); long[] buf = (long[]) buf_; return buf[index_]; } final public synchronized char get_wchar() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_wchar); char[] buf = (char[]) buf_; return buf[index_]; } final public synchronized String get_wstring() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_wstring); String[] buf = (String[]) buf_; return buf[index_]; } final public synchronized org.omg.CORBA.Any get_any() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_any); // // Delegate to component // return components_[index_].get_any(); } final public synchronized org.omg.DynamicAny.DynAny get_dyn_any() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { validate(org.omg.CORBA.TCKind.tk_any); // // Delegate to component // return components_[index_].get_dyn_any(); } final public synchronized java.io.Serializable get_val() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (contentKind_ != org.omg.CORBA.TCKind.tk_value && contentKind_ != org.omg.CORBA.TCKind.tk_value_box) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ < 0) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Delegate to component // return components_[index_].get_val(); } // ------------------------------------------------------------------ // Internal member implementations // ------------------------------------------------------------------ synchronized void _OB_marshal(OutputStream out) { _OB_marshal(out, new DynValueWriter(orbInstance_, factory_)); } synchronized void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter) { if (origType_.kind() == org.omg.CORBA.TCKind.tk_sequence) { out.write_ulong(length_); if (length_ == 0) return; } switch (contentKind_.value()) { case org.omg.CORBA.TCKind._tk_short: out.write_short_array((short[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_long: out.write_long_array((int[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_ushort: out.write_ushort_array((short[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_ulong: out.write_ulong_array((int[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_float: out.write_float_array((float[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_double: out.write_double_array((double[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_boolean: out.write_boolean_array((boolean[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_char: out.write_char_array((char[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_octet: out.write_octet_array((byte[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_string: { String[] buf = (String[]) buf_; for (int i = 0; i < length_; i++) out.write_string(buf[i]); break; } case org.omg.CORBA.TCKind._tk_longlong: out.write_longlong_array((long[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_ulonglong: out.write_ulonglong_array((long[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_wchar: out.write_wchar_array((char[]) buf_, 0, length_); break; case org.omg.CORBA.TCKind._tk_wstring: { String[] buf = (String[]) buf_; for (int i = 0; i < length_; i++) out.write_wstring(buf[i]); break; } default: { for (int i = 0; i < length_; i++) { DynAny_impl impl = (DynAny_impl) components_[i]; impl._OB_marshal(out, dynValueWriter); } } } } synchronized void _OB_unmarshal(InputStream in) { int len; if (origType_.kind() == org.omg.CORBA.TCKind.tk_array) len = length_; else { len = in.read_ulong(); resize(len, false); if (len == 0) return; } switch (contentKind_.value()) { case org.omg.CORBA.TCKind._tk_short: { short[] buf = (short[]) buf_; in.read_short_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_long: { int[] buf = (int[]) buf_; in.read_long_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_ushort: { short[] buf = (short[]) buf_; in.read_ushort_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_ulong: { int[] buf = (int[]) buf_; in.read_ulong_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_float: { float[] buf = (float[]) buf_; in.read_float_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_double: { double[] buf = (double[]) buf_; in.read_double_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_boolean: { boolean[] buf = (boolean[]) buf_; in.read_boolean_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_char: { char[] buf = (char[]) buf_; in.read_char_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_octet: { byte[] buf = (byte[]) buf_; in.read_octet_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_string: { String[] buf = (String[]) buf_; for (int i = 0; i < len; i++) buf[i] = in.read_string(); break; } case org.omg.CORBA.TCKind._tk_longlong: { long[] buf = (long[]) buf_; in.read_longlong_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_ulonglong: { long[] buf = (long[]) buf_; in.read_ulonglong_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_wchar: { char[] buf = (char[]) buf_; in.read_wchar_array(buf, 0, len); break; } case org.omg.CORBA.TCKind._tk_wstring: { String[] buf = (String[]) buf_; for (int i = 0; i < len; i++) buf[i] = in.read_wstring(); break; } case org.omg.CORBA.TCKind._tk_value: { if (dynValueReader_ != null) { for (int i = 0; i < len; i++) { org.apache.yoko.orb.OB.Assert ._OB_assert(components_[i] == null); try { components_[i] = dynValueReader_.readValue(in, contentType_); } catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return; } adoptChild(components_[i]); } } else { for (int i = 0; i < len; i++) { org.apache.yoko.orb.OB.Assert ._OB_assert(components_[i] != null); DynAny_impl impl = (DynAny_impl) components_[i]; impl._OB_unmarshal(in); } } break; } default: { for (int i = 0; i < len; i++) { DynAny_impl impl = (DynAny_impl) components_[i]; impl._OB_unmarshal(in); } } } notifyParent(); } synchronized Any _OB_currentAny() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (index_ >= 0 && index_ < length_ && !primitive_) { DynAny_impl impl = (DynAny_impl) components_[index_]; return impl._OB_currentAnyValue(); } else return null; } synchronized Any _OB_currentAnyValue() { return null; } }
6,621
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/DynamicAny/DynAnyFactory_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.DynamicAny; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.TypeCode; final public class DynAnyFactory_impl extends org.omg.CORBA.LocalObject implements org.omg.DynamicAny.DynAnyFactory { private org.apache.yoko.orb.OB.ORBInstance orbInstance_; public DynAnyFactory_impl(org.apache.yoko.orb.OB.ORBInstance orbInstance) { orbInstance_ = orbInstance; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public org.omg.DynamicAny.DynAny create_dyn_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode { DynValueReader dynValueReader = new DynValueReader(orbInstance_, this, true); try { org.omg.DynamicAny.DynAny p = prepare_dyn_any_from_type_code(value .type(), dynValueReader); p.from_any(value); return p; } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { } throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode(); } public org.omg.DynamicAny.DynAny create_dyn_any_without_truncation( org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode, org.omg.DynamicAny.MustTruncate { DynValueReader dynValueReader = new DynValueReader(orbInstance_, this, false); try { org.omg.DynamicAny.DynAny p = prepare_dyn_any_from_type_code(value .type(), dynValueReader); p.from_any(value); if (dynValueReader.mustTruncate) throw new org.omg.DynamicAny.MustTruncate(); return p; } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { } throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode(); } public org.omg.DynamicAny.DynAny prepare_dyn_any_from_type_code( org.omg.CORBA.TypeCode tc, org.apache.yoko.orb.DynamicAny.DynValueReader dvr) throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode { org.omg.DynamicAny.DynAny result = null; TypeCode type = null; try { type = (TypeCode) tc; } catch (ClassCastException ex) { type = TypeCode._OB_convertForeignTypeCode(tc); } org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(type); switch (origTC.kind().value()) { case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: result = new DynStruct_impl(this, orbInstance_, type, dvr); break; case org.omg.CORBA.TCKind._tk_union: result = new DynUnion_impl(this, orbInstance_, type, dvr); break; case org.omg.CORBA.TCKind._tk_sequence: result = new DynSequence_impl(this, orbInstance_, type, dvr); break; case org.omg.CORBA.TCKind._tk_array: result = new DynArray_impl(this, orbInstance_, type, dvr); break; case org.omg.CORBA.TCKind._tk_value: try { if (origTC.type_modifier() == org.omg.CORBA.VM_CUSTOM.value) result = create_dyn_any_from_type_code(tc); else result = new DynValue_impl(this, orbInstance_, type, dvr); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { } break; default: result = create_dyn_any_from_type_code(tc); } return result; } public org.omg.DynamicAny.DynAny create_dyn_any_from_type_code( org.omg.CORBA.TypeCode tc) throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode { org.omg.DynamicAny.DynAny result = null; TypeCode type = null; try { type = (TypeCode) tc; } catch (ClassCastException ex) { type = TypeCode._OB_convertForeignTypeCode(tc); } org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(type); switch (origTC.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_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_objref: case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: case org.omg.CORBA.TCKind._tk_wchar: case org.omg.CORBA.TCKind._tk_wstring: case org.omg.CORBA.TCKind._tk_abstract_interface: case org.omg.CORBA_2_4.TCKind._tk_local_interface: result = new DynBasic_impl(this, orbInstance_, type); break; case org.omg.CORBA.TCKind._tk_fixed: result = new DynFixed_impl(this, orbInstance_, type); break; case org.omg.CORBA.TCKind._tk_enum: result = new DynEnum_impl(this, orbInstance_, type); break; case org.omg.CORBA.TCKind._tk_struct: case org.omg.CORBA.TCKind._tk_except: result = new DynStruct_impl(this, orbInstance_, type); break; case org.omg.CORBA.TCKind._tk_union: result = new DynUnion_impl(this, orbInstance_, type); break; case org.omg.CORBA.TCKind._tk_sequence: result = new DynSequence_impl(this, orbInstance_, type); break; case org.omg.CORBA.TCKind._tk_array: result = new DynArray_impl(this, orbInstance_, type); break; case org.omg.CORBA.TCKind._tk_value: try { if (origTC.type_modifier() == org.omg.CORBA.VM_CUSTOM.value) result = new DynBasic_impl(this, orbInstance_, type); else result = new DynValue_impl(this, orbInstance_, type); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { } break; case org.omg.CORBA.TCKind._tk_value_box: result = new DynValueBox_impl(this, orbInstance_, type); break; case org.omg.CORBA.TCKind._tk_Principal: case org.omg.CORBA.TCKind._tk_native: case org.omg.CORBA.TCKind._tk_longdouble: throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode(); case org.omg.CORBA.TCKind._tk_alias: default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported type code"); } return result; } public org.omg.DynamicAny.DynAny[] create_multiple_dyn_anys( org.omg.CORBA.Any[] values, boolean allow_truncate) throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode, org.omg.DynamicAny.MustTruncate { // // Put the sequence of Anys and marshal it. This ensures that // ValueType equality that "spans" dynAnys will be mapped by // indirections when marshalled. // org.omg.CORBA.Any aSeq = orbInstance_.getORB().create_any(); org.omg.CORBA.AnySeqHelper.insert(aSeq, values); org.apache.yoko.orb.CORBA.Any valSeq; valSeq = (org.apache.yoko.orb.CORBA.Any) aSeq; InputStream in = (InputStream) valSeq.create_input_stream(); // NOTE: the input stream I obtain does not contain // indirections that "span" the original members of the sequence. // (that is an issue with the implementation of Anys). Thus // ValueType that span the original Any instance are not // properly mapped. // // Create a sequence of Dynamic Anys // org.omg.DynamicAny.DynAny result[] = new org.omg.DynamicAny.DynAny[values.length]; DynValueReader dynValueReader = new DynValueReader(orbInstance_, this, allow_truncate); for (int i = 0; i < values.length; i++) { org.omg.CORBA.TypeCode type = ((org.apache.yoko.orb.CORBA.Any) values[i]) ._OB_type(); result[i] = prepare_dyn_any_from_type_code(type, dynValueReader); } // // Populate the DynAnys by unmarshalling the sequence of Anys. // Start by skipping the sequence lenght // in.read_ulong(); for (int i = 0; i < values.length; i++) { in.read_TypeCode(); DynAny_impl impl = (DynAny_impl) result[i]; impl._OB_unmarshal(in); } return result; } public org.omg.CORBA.Any[] create_multiple_anys( org.omg.DynamicAny.DynAny[] values) { // TODO: DynValue equalities that "span" members of // the sequence of DynAnys are not maintained org.omg.CORBA.Any[] result = new org.omg.CORBA.Any[values.length]; for (int i = 0; i < values.length; i++) { DynAny_impl impl = (DynAny_impl) values[i]; result[i] = impl.to_any(); } return result; } }
6,622
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/DynamicAny/DynBasic_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; import org.omg.DynamicAny.DynAnyPackage.InvalidValue; final class DynBasic_impl extends DynAny_impl { private Any any_; // // This object needs a component when the type is tk_any // org.omg.DynamicAny.DynAny comp_; DynBasic_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { super(factory, orbInstance, type); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(type); switch (origTC.kind().value()) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: any_ = new Any(orbInstance_, type, null); break; 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: any_ = new Any(orbInstance_, type, new Integer(0)); break; case org.omg.CORBA.TCKind._tk_longlong: case org.omg.CORBA.TCKind._tk_ulonglong: any_ = new Any(orbInstance_, type, new Long(0)); break; case org.omg.CORBA.TCKind._tk_float: any_ = new Any(orbInstance_, type, new Float(0)); break; case org.omg.CORBA.TCKind._tk_double: any_ = new Any(orbInstance_, type, new Double(0)); break; case org.omg.CORBA.TCKind._tk_boolean: any_ = new Any(orbInstance_, type, Boolean.FALSE); break; case org.omg.CORBA.TCKind._tk_char: case org.omg.CORBA.TCKind._tk_wchar: any_ = new Any(orbInstance_, type, new Character((char) 0)); break; case org.omg.CORBA.TCKind._tk_octet: any_ = new Any(orbInstance_, type, new Byte((byte) 0)); break; case org.omg.CORBA.TCKind._tk_any: any_ = new Any(orbInstance_, type, new Any(orbInstance_)); break; case org.omg.CORBA.TCKind._tk_TypeCode: { org.omg.CORBA.TypeCode nullTC = org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(org.omg.CORBA.TCKind.tk_null); any_ = new Any(orbInstance_, type, nullTC); break; } case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA_2_4.TCKind._tk_local_interface: any_ = new Any(orbInstance_, type, null); break; case org.omg.CORBA.TCKind._tk_string: case org.omg.CORBA.TCKind._tk_wstring: any_ = new Any(orbInstance_, type, new String("")); break; case org.omg.CORBA.TCKind._tk_abstract_interface: any_ = new Any(orbInstance_, type, null); break; case org.omg.CORBA.TCKind._tk_value: // // Only custom valuetypes are supported by DynBasic_impl // try { org.apache.yoko.orb.OB.Assert ._OB_assert(origTC.type_modifier() == org.omg.CORBA.VM_CUSTOM.value); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } any_ = new Any(orbInstance_, type, null); break; case org.omg.CORBA.TCKind._tk_Principal: default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported type code"); } } // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ protected void notifyParent() { // // We have intercepted a change notification. If our type is tk_any, // then we release our component. It will be created again during // get_dyn_any(). // if (origType_.kind() == org.omg.CORBA.TCKind.tk_any) { if (comp_ != null) comp_ = null; } super.notifyParent(); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return; if (!dyn_any.type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); any_ = (Any) dyn_any.to_any(); notifyParent(); } public synchronized void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // Convert value to an ORBacus Any - the JDK implementation // of TypeCode.equivalent() raises NO_IMPLEMENT // try { any_ = new Any(value); } catch (NullPointerException ex) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(ex); } org.omg.CORBA.TypeCode tc = any_._OB_type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); if (!tc.equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); // // Check for an invalid value // if (any_.value() == null) { switch (origTC.kind().value()) { case org.omg.CORBA.TCKind._tk_null: case org.omg.CORBA.TCKind._tk_void: case org.omg.CORBA.TCKind._tk_TypeCode: case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA.TCKind._tk_value: case org.omg.CORBA.TCKind._tk_abstract_interface: case org.omg.CORBA_2_4.TCKind._tk_local_interface: // // Some types can legally have a null value // break; default: throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); } } notifyParent(); } public synchronized org.omg.CORBA.Any to_any() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return new Any(any_); } public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) { return to_any(); } public synchronized boolean equal(org.omg.DynamicAny.DynAny dyn_any) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return true; if (!dyn_any.type().equivalent(type_)) return false; // // Don't use Any.equal() here because it calls equal() on // the TypeCodes, and the semantics of DynAny.equal() // only require TypeCodes to be equivalent. // java.lang.Object v1 = any_.value(); java.lang.Object v2 = ((DynBasic_impl) dyn_any).any_.value(); switch (origType_.kind().value()) { 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_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_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_string: case org.omg.CORBA.TCKind._tk_wstring: return v1.equals(v2); case org.omg.CORBA.TCKind._tk_any: return ((org.omg.CORBA.Any) v1).equal((org.omg.CORBA.Any) v2); case org.omg.CORBA.TCKind._tk_TypeCode: if (v1 == null && v2 == null) return true; else if (v1 == null || v2 == null) return false; else return ((org.omg.CORBA.TypeCode) v1) .equal((org.omg.CORBA.TypeCode) v2); case org.omg.CORBA.TCKind._tk_objref: case org.omg.CORBA_2_4.TCKind._tk_local_interface: if (v1 == null && v2 == null) return true; else if (v1 == null || v2 == null) return false; else return ((org.omg.CORBA.Object) v1) ._is_equivalent((org.omg.CORBA.Object) v2); case org.omg.CORBA.TCKind._tk_value: if (v1 == v2) return true; else if (v1 == null || v2 == null) return false; else { // // Currently, it's not possible for a custom valuetype // to be represented as an InputStream in an any // org.apache.yoko.orb.OB.Assert._OB_assert("Unable to compare value types"); } case org.omg.CORBA.TCKind._tk_abstract_interface: if (v1 == v2) return true; else if (v1 == null || v2 == null) return false; else if (v1 instanceof org.omg.CORBA.Object && v2 instanceof org.omg.CORBA.Object) { return ((org.omg.CORBA.Object) v1) ._is_equivalent((org.omg.CORBA.Object) v2); } else { // // Currently, it's not possible for an abstract interface // to be represented as an InputStream in an any // org.apache.yoko.orb.OB.Assert._OB_assert("Unable to compare abstract_interface types"); } return false; case org.omg.CORBA.TCKind._tk_Principal: default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported type code"); } return false; // The compiler needs this } public synchronized org.omg.DynamicAny.DynAny copy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); DynBasic_impl result = new DynBasic_impl(factory_, orbInstance_, type_); result.any_ = new Any(any_); return result; } public boolean seek(int index) { return false; } public void rewind() { // do nothing } public boolean next() { return false; } public int component_count() { return 0; } public org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } // ------------------------------------------------------------------ // Internal member implementations // ------------------------------------------------------------------ synchronized void _OB_marshal(OutputStream out) { any_.write_value(out); } synchronized void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter) { _OB_marshal(out); } synchronized void _OB_unmarshal(InputStream in) { any_.read_value(in, type_); if (comp_ != null) comp_ = null; notifyParent(); } synchronized Any _OB_currentAny() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return any_; } synchronized Any _OB_currentAnyValue() { return any_; } synchronized org.omg.DynamicAny.DynAny _OB_getDynAny() { if (origType_.kind() != org.omg.CORBA.TCKind.tk_any) return null; if (comp_ == null) comp_ = create((Any) any_.value(), true); return comp_; } synchronized boolean _OB_insertDynAny(org.omg.DynamicAny.DynAny p) { // // Do nothing if caller is passing our component // if (p == comp_) return true; try { checkValue(any_, org.omg.CORBA.TCKind.tk_any); DynAny_impl impl = (DynAny_impl) p; Any implAny = impl._OB_currentAny(); checkValue(implAny, org.omg.CORBA.TCKind.tk_any); Any any = (Any) implAny.value(); any_.replace(any_.type(), new Any(any)); if (comp_ != null) comp_ = null; return true; } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { } return false; } }
6,623
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/DynamicAny/DynAny_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; import org.omg.CORBA.CustomMarshal; import org.omg.DynamicAny.DynAnyPackage.TypeMismatch; abstract class DynAny_impl extends org.omg.CORBA.LocalObject implements org.omg.DynamicAny.DynAny { protected org.omg.DynamicAny.DynAnyFactory factory_; protected org.apache.yoko.orb.OB.ORBInstance orbInstance_; protected org.omg.CORBA.TypeCode type_; protected org.omg.CORBA.TypeCode origType_; protected DynAny_impl parent_; protected boolean destroyed_; DynAny_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { factory_ = factory; orbInstance_ = orbInstance; type_ = type; origType_ = TypeCode._OB_getOrigType(type_); } // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ protected void checkValue(Any any, org.omg.CORBA.TCKind kind) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.TypeCode tc = org.apache.yoko.orb.OB.TypeCodeFactory .createPrimitiveTC(kind); if (!any._OB_type().equivalent(tc)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } protected org.omg.DynamicAny.DynAny create(org.omg.CORBA.Any any, boolean adopt) { org.omg.DynamicAny.DynAny result = null; try { result = factory_.create_dyn_any(any); } catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } if (adopt) adoptChild(result); return result; } protected org.omg.DynamicAny.DynAny create(org.omg.CORBA.TypeCode tc, boolean adopt) { org.omg.DynamicAny.DynAny result = null; try { result = factory_.create_dyn_any_from_type_code(tc); } catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } if (adopt) adoptChild(result); return result; } protected org.omg.DynamicAny.DynAny prepare(org.omg.CORBA.TypeCode tc, org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader, boolean adopt) { // // Use "create" if the instantiation of DynValues // must not be delayed // if (dynValueReader == null) return create(tc, adopt); org.omg.DynamicAny.DynAny result = null; DynAnyFactory_impl factory_impl = (DynAnyFactory_impl) factory_; try { result = factory_impl.prepare_dyn_any_from_type_code(tc, dynValueReader); } catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } if (adopt) adoptChild(result); return result; } protected void adoptChild(org.omg.DynamicAny.DynAny d) { DynAny_impl impl = (DynAny_impl) d; impl.parent_ = this; } protected void notifyParent() { if (parent_ != null) parent_.childModified(this); } protected void childModified(org.omg.DynamicAny.DynAny p) { // do nothing } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ final public org.omg.CORBA.TypeCode type() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return type_; } public abstract void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch; public abstract void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue; public abstract org.omg.CORBA.Any to_any(); public abstract boolean equal(org.omg.DynamicAny.DynAny dyn_any); public void destroy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (parent_ == null) destroyed_ = true; } public abstract org.omg.DynamicAny.DynAny copy(); public synchronized void insert_boolean(boolean value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_boolean); any.replace(any.type(), Boolean.valueOf(value)); notifyParent(); } public synchronized void insert_octet(byte value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_octet); any.replace(any.type(), new Byte(value)); notifyParent(); } public synchronized void insert_char(char value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_char); any.replace(any.type(), new Character(value)); notifyParent(); } public synchronized void insert_short(short value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_short); any.replace(any.type(), new Integer(value)); notifyParent(); } public synchronized void insert_ushort(short value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_ushort); any.replace(any.type(), new Integer(value)); notifyParent(); } public synchronized void insert_long(int value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_long); any.replace(any.type(), new Integer(value)); notifyParent(); } public synchronized void insert_ulong(int value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_ulong); any.replace(any.type(), new Integer(value)); notifyParent(); } public synchronized void insert_float(float value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_float); any.replace(any.type(), new Float(value)); notifyParent(); } public synchronized void insert_double(double value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_double); any.replace(any.type(), new Double(value)); notifyParent(); } public synchronized void insert_string(String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); // Don't use checkValue() - we must accomodate bounded and // unbounded strings if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.TypeCode tc = any.type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); if (origTC.kind() != org.omg.CORBA.TCKind.tk_string) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); // // Check for bounded string // try { int len = origTC.length(); if (len > 0 && value.length() > len) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } any.replace(tc, value); notifyParent(); } public synchronized void insert_reference(org.omg.CORBA.Object value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); // Don't use checkValue() if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.TypeCode tc = any.type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); if (origTC.kind() != org.omg.CORBA.TCKind.tk_objref && origTC.kind() != org.omg.CORBA_2_4.TCKind.tk_local_interface) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); any.replace(tc, value); notifyParent(); } public synchronized void insert_typecode(org.omg.CORBA.TypeCode value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_TypeCode); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_longlong(long value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_longlong); any.replace(any.type(), new Long(value)); notifyParent(); } public synchronized void insert_ulonglong(long value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_ulonglong); any.replace(any.type(), new Long(value)); notifyParent(); } public synchronized void insert_wchar(char value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_wchar); any.replace(any.type(), new Character(value)); notifyParent(); } public synchronized void insert_wstring(String value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); // Don't use checkValue() - we must accomodate bounded and // unbounded strings if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.TypeCode tc = any.type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); if (origTC.kind() != org.omg.CORBA.TCKind.tk_wstring) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); // // Check for bounded wstring // try { int len = origTC.length(); if (len > 0 && value.length() > len) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } any.replace(tc, value); notifyParent(); } public synchronized void insert_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.TCKind.tk_any); Any val = new Any(value); val._OB_ORBInstance(orbInstance_); any.replace(any.type(), val); notifyParent(); } public synchronized void insert_dyn_any(org.omg.DynamicAny.DynAny value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (value == null) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (!_OB_insertDynAny(value)) { org.omg.DynamicAny.DynAny comp = current_component(); if (comp == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); DynAny_impl impl = (DynAny_impl) comp; if (!impl._OB_insertDynAny(value)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } notifyParent(); } public synchronized void insert_val(java.io.Serializable value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // TODO: Custom valuetypes are not currently supported // if (value instanceof org.omg.CORBA.CustomMarshal) { throw new org.omg.CORBA.BAD_PARAM(org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType), org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } org.omg.DynamicAny.DynAny comp = current_component(); if (comp == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Ensure the given value has the proper type // org.omg.CORBA.TypeCode tc = comp.type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); if (origTC.kind() != org.omg.CORBA.TCKind.tk_value && origTC.kind() != org.omg.CORBA.TCKind.tk_value_box) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); try { if (value != null && value instanceof org.omg.CORBA.portable.ValueBase) { String id = origTC.id(); String[] ids = ((org.omg.CORBA.portable.ValueBase) value) ._truncatable_ids(); int i; for (i = 0; i < ids.length; i++) if (id.equals(ids[i])) break; if (i >= ids.length) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } // // Create an any and invoke from_any // Any any = new Any(orbInstance_, tc, value); comp.from_any(any); notifyParent(); } public synchronized void insert_abstract(java.lang.Object value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.TypeCode type = any.type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(type); if (origTC.kind() != org.omg.CORBA.TCKind.tk_abstract_interface) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (value == null) any.insert_Value(null, type); else if (value instanceof java.io.Serializable) any.insert_Value((java.io.Serializable) value, type); else if (value instanceof org.omg.CORBA.Object) any.insert_Object((org.omg.CORBA.Object) value, type); else throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); notifyParent(); } public synchronized void insert_boolean_seq(boolean[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.BooleanSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_octet_seq(byte[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.OctetSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_char_seq(char[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.CharSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_wchar_seq(char[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.WCharSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_short_seq(short[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.ShortSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_ushort_seq(short[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.UShortSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_long_seq(int[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.LongSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_ulong_seq(int[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.ULongSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_longlong_seq(long[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.LongLongSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_ulonglong_seq(long[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.ULongLongSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_float_seq(float[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.FloatSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized void insert_double_seq(double[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); checkValue(any, org.omg.CORBA.DoubleSeqHelper.type().kind()); any.replace(any.type(), value); notifyParent(); } public synchronized boolean get_boolean() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_boolean(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized byte get_octet() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_octet(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized char get_char() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_char(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized short get_short() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_short(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized short get_ushort() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_ushort(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized int get_long() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_long(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized int get_ulong() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_ulong(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized float get_float() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_float(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized double get_double() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_double(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized String get_string() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_string(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized org.omg.CORBA.Object get_reference() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_Object(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized org.omg.CORBA.TypeCode get_typecode() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_TypeCode(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized long get_longlong() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_longlong(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized long get_ulonglong() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_ulonglong(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized char get_wchar() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_wchar(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized String get_wstring() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_wstring(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized org.omg.CORBA.Any get_any() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return any.extract_any(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized org.omg.DynamicAny.DynAny get_dyn_any() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); DynAny_impl da = (DynAny_impl) _OB_getDynAny(); if (da == null) { org.omg.DynamicAny.DynAny comp = current_component(); if (comp == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); DynAny_impl impl = (DynAny_impl) comp; da = (DynAny_impl) impl._OB_getDynAny(); } if (da == null) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); return da; } public synchronized java.io.Serializable get_val() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); org.omg.DynamicAny.DynAny comp = current_component(); if (comp == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Ensure the given value has the proper type // org.omg.CORBA.TypeCode tc = comp.type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); if (origTC.kind() != org.omg.CORBA.TCKind.tk_value && origTC.kind() != org.omg.CORBA.TCKind.tk_value_box) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); DynAny_impl impl = (DynAny_impl) comp; org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); impl._OB_marshal(out); InputStream in = (InputStream) out.create_input_stream(); // This is not necessary // in._OB_ORBInstance(orbInstance_); return in.read_value(); } public synchronized java.lang.Object get_abstract() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.TypeCode type = any.type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(type); if (origTC.kind() != org.omg.CORBA.TCKind.tk_abstract_interface) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); try { return any.extract_Object(); } catch (org.omg.CORBA.BAD_OPERATION ex) { try { return any.extract_Value(); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } } public synchronized boolean[] get_boolean_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.BooleanSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized byte[] get_octet_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.OctetSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized char[] get_char_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.CharSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized char[] get_wchar_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.WCharSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized short[] get_short_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.ShortSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized short[] get_ushort_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.UShortSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized int[] get_long_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.LongSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized int[] get_ulong_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.ULongSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized long[] get_longlong_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.LongLongSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized long[] get_ulonglong_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.ULongLongSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized float[] get_float_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.FloatSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public synchronized double[] get_double_seq() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { Any any = _OB_currentAny(); if (any == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return org.omg.CORBA.DoubleSeqHelper.extract(any); } catch (org.omg.CORBA.BAD_OPERATION e) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(e); } } public abstract boolean seek(int index); public abstract void rewind(); public abstract boolean next(); public abstract int component_count(); public abstract org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch; // ------------------------------------------------------------------ // Yoko internal functions // ------------------------------------------------------------------ abstract void _OB_marshal(OutputStream out); abstract void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter); abstract void _OB_unmarshal(InputStream in); abstract Any _OB_currentAny(); abstract Any _OB_currentAnyValue(); org.omg.DynamicAny.DynAny _OB_getDynAny() { return null; } boolean _OB_insertDynAny(org.omg.DynamicAny.DynAny value) { return false; } }
6,624
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/DynamicAny/DynValueReader.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.DynamicAny; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.TypeCode; final public class DynValueReader { private org.apache.yoko.orb.OB.ORBInstance orbInstance_; private org.omg.DynamicAny.DynAnyFactory factory_; private java.util.Hashtable instanceTable_; private boolean truncateOK_; public boolean mustTruncate; public DynValueReader(org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.DynamicAny.DynAnyFactory factory, boolean truncateOK) { orbInstance_ = orbInstance; factory_ = factory; truncateOK_ = truncateOK; mustTruncate = false; instanceTable_ = new java.util.Hashtable(131); } public org.omg.DynamicAny.DynAny readValue(InputStream in, org.omg.CORBA.TypeCode tc) throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode { // // See if we already have a DynValue for this position // org.omg.DynamicAny.DynAny result = getValue(in, tc); if (result != null) return result; // // Read the tag and attempt to process an indirection. // org.apache.yoko.orb.OCI.Buffer buf = in._OB_buffer(); int save = buf.pos_; int tag = in.read_long(); int curPos = save; // buf.cur_ - 4; try { if (tag == -1) return readIndirection(in); } catch (org.omg.CORBA.MARSHAL ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return null; } // // Prepare a new DynValue and reference it as a possible // target for indirection. // DynAnyFactory_impl factory_impl = (DynAnyFactory_impl) factory_; result = factory_impl.prepare_dyn_any_from_type_code(tc, this); // // Skip null valueType // if (tag != 0) { int startPos = curPos;// - buf.data_; indexValue(startPos, result); } // // Restore the position of the input stream and populate the // DynValue (unmarshal) // in._OB_pos(save); DynAny_impl impl = (DynAny_impl) result; impl._OB_unmarshal(in); return result; } protected void indexValue(int startPos, org.omg.DynamicAny.DynAny dv) { instanceTable_.put(new Integer(startPos), dv); } private org.omg.DynamicAny.DynAny readIndirection(InputStream in) throws org.omg.CORBA.MARSHAL { org.apache.yoko.orb.OCI.Buffer buf = in._OB_buffer(); int offs = in.read_long(); int startPos = buf.pos_ - 4 + offs; org.omg.DynamicAny.DynAny result = (org.omg.DynamicAny.DynAny) instanceTable_ .get(new Integer(startPos)); if (result == null) { throw new org.omg.CORBA.MARSHAL( org.apache.yoko.orb.OB.MinorCodes .describeMarshal(org.apache.yoko.orb.OB.MinorCodes.MinorReadInvalidIndirection), org.apache.yoko.orb.OB.MinorCodes.MinorReadInvalidIndirection, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return result; } private org.omg.DynamicAny.DynAny getValue(InputStream in, org.omg.CORBA.TypeCode tc) { // // See if we already have a reference for the DynValue marshalled // at the current position of the stream (the record would have // been created earlier by DynValueWriter). // org.apache.yoko.orb.OCI.Buffer buf = in._OB_buffer(); int startPos = buf.pos_; org.omg.DynamicAny.DynAny orig = (org.omg.DynamicAny.DynAny) instanceTable_ .get(new Integer(startPos)); if (orig == null) return null; // // We found an existing DynValue. Now we have to advance the // Input Stream by unmarshalling a temporary copy of the DynValue. // DynAnyFactory_impl factory_impl = (DynAnyFactory_impl) factory_; org.omg.DynamicAny.DynAny copy = null; try { copy = factory_impl.prepare_dyn_any_from_type_code(tc, this); } catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } DynAny_impl impl = (DynAny_impl) copy; impl._OB_unmarshal(in); // // Return the original value (not the copy) // return orig; } }
6,625
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/DynamicAny/DynValueBox_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; final class DynValueBox_impl extends DynValueCommon_impl implements org.omg.DynamicAny.DynValueBox { private org.omg.DynamicAny.DynAny component_; private org.omg.CORBA.TypeCode boxedType_; private int index_; DynValueBox_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { super(factory, orbInstance, type); try { boxedType_ = origType_.content_type(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } // // Initial value is null // set_to_null(); } // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ protected void createComponents() { if (component_ == null) { component_ = create(boxedType_, true); index_ = 0; } } protected void destroyComponents() { if (component_ != null) { component_.destroy(); component_ = null; } index_ = -1; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return; if (!dyn_any.type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); DynValueBox_impl dv = (DynValueBox_impl) dyn_any; if (dv.is_null()) set_to_null(); else { set_to_value(); dv.rewind(); component_.assign(dv.current_component()); index_ = 0; } notifyParent(); } public synchronized void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // Convert value to an ORBacus Any - the JDK implementation // of TypeCode.equivalent() raises NO_IMPLEMENT // Any val = null; try { val = (Any) value; } catch (ClassCastException ex) { try { val = new Any(value); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } } if (!val._OB_type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.omg.CORBA.portable.InputStream in = null; try { in = val.create_input_stream(); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } _OB_unmarshal((InputStream) in); if (is_null()) index_ = -1; else index_ = 0; notifyParent(); } public synchronized org.omg.CORBA.Any to_any() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (is_null()) return new Any(orbInstance_, type_, null); else { org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); _OB_marshal(out); InputStream in = (InputStream) out.create_input_stream(); return new Any(orbInstance_, type_, in); } } public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) { return to_any(); } public synchronized boolean equal(org.omg.DynamicAny.DynAny dyn_any) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return true; if (!dyn_any.type().equivalent(type_)) return false; DynValueBox_impl impl = (DynValueBox_impl) dyn_any; if (is_null() || impl.is_null()) return (is_null() && impl.is_null()); return component_.equal(impl.component_); } public synchronized org.omg.DynamicAny.DynAny copy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); DynValueBox_impl result = new DynValueBox_impl(factory_, orbInstance_, type_); if (!is_null()) { try { result.set_boxed_value_as_dyn_any(component_); } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } return result; } public synchronized boolean seek(int index) { if (is_null() || index != 0) { index_ = -1; return false; } index_ = index; return true; } public synchronized void rewind() { seek(0); } public synchronized boolean next() { if (index_ == 0) { index_ = -1; return false; } org.apache.yoko.orb.OB.Assert._OB_assert(index_ == -1); index_++; return true; } public synchronized int component_count() { return (is_null() ? 0 : 1); } public synchronized org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (index_ == -1) return null; org.apache.yoko.orb.OB.Assert._OB_assert(index_ == 0); return component_; } public synchronized org.omg.CORBA.Any get_boxed_value() throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (is_null()) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); return component_.to_any(); } public synchronized void set_boxed_value(org.omg.CORBA.Any boxed) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { // // Convert value to an ORBacus Any - the JDK implementation // of TypeCode.equivalent() raises NO_IMPLEMENT // Any val = null; try { val = (Any) boxed; } catch (ClassCastException ex) { try { val = new Any(boxed); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } } if (!val._OB_type().equivalent(boxedType_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); boolean isNull = is_null(); try { set_to_value(); component_.from_any(val); } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { // // Restore previous state if necessary // if (isNull) set_to_null(); throw ex; } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { // // Restore previous state if necessary // if (isNull) set_to_null(); throw ex; } index_ = 0; notifyParent(); } public synchronized org.omg.DynamicAny.DynAny get_boxed_value_as_dyn_any() throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (is_null()) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); return component_; } public synchronized void set_boxed_value_as_dyn_any( org.omg.DynamicAny.DynAny boxed) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (!boxedType_.equivalent(boxed.type())) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); boolean isNull = is_null(); try { set_to_value(); component_.assign(boxed); } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { // // Restore previous state if necessary // if (isNull) set_to_null(); throw ex; } index_ = 0; notifyParent(); } // ------------------------------------------------------------------ // Internal member implementations // ------------------------------------------------------------------ synchronized void _OB_marshal(OutputStream out) { if (is_null()) out.write_ulong(0); else { try { int tag = 0x7fffff02; boolean chunk = false; String[] ids = { type_.id() }; out._OB_beginValue(tag, ids, chunk); DynAny_impl impl = (DynAny_impl) component_; impl._OB_marshal(out); out._OB_endValue(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } } synchronized void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter) { _OB_marshal(out); } synchronized void _OB_unmarshal(InputStream in) { // // Peek at value tag // int save = in._OB_pos(); int ind = 0; int tag = in.read_long(); if (tag == 0) // null value { set_to_null(); return; } else if (tag == -1) { // // Indirection - rewind to offset // int offs = in.read_long(); ind = in._OB_pos(); // save position after offset in._OB_pos(in._OB_pos() - 4 + offs); } else in._OB_pos(save); // restore tag position set_to_value(); in._OB_beginValue(); // // Unmarshal component state // DynAny_impl impl = (DynAny_impl) component_; impl._OB_unmarshal(in); in._OB_endValue(); // // Restore position after indirection // if (ind != 0) in._OB_pos(ind); notifyParent(); } synchronized Any _OB_currentAny() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (index_ == 0) { DynAny_impl impl = (DynAny_impl) component_; return impl._OB_currentAnyValue(); } return null; } Any _OB_currentAnyValue() { return null; } }
6,626
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/DynamicAny/DynValueWriter.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.DynamicAny; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; final public class DynValueWriter { private org.apache.yoko.orb.OB.ORBInstance orbInstance_; private org.omg.DynamicAny.DynAnyFactory factory_; private DynValueReader dynValueReader_; private java.util.Hashtable instanceTable_; public DynValueWriter(org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.DynamicAny.DynAnyFactory factory) { orbInstance_ = orbInstance; factory_ = factory; instanceTable_ = new java.util.Hashtable(131); dynValueReader_ = new DynValueReader(orbInstance_, factory_, false); } public boolean writeIndirection(org.omg.DynamicAny.DynAny dv, OutputStream out) { Integer pos = (Integer) instanceTable_.get(dv); if (pos != null) { org.apache.yoko.orb.OCI.Buffer buf = out._OB_buffer(); out.write_long(-1); int off = pos.intValue() - buf.pos_; out.write_long(off); return true; } return false; } public void indexValue(org.omg.DynamicAny.DynAny dv, int startPos) { instanceTable_.put(dv, new Integer(startPos)); dynValueReader_.indexValue(startPos, dv); } public DynValueReader getReader() { return dynValueReader_; } }
6,627
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/DynamicAny/DynStruct_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; final class DynStruct_impl extends DynAny_impl implements org.omg.DynamicAny.DynStruct { private org.omg.DynamicAny.DynAny[] components_; private int index_; org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader_; DynStruct_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { super(factory, orbInstance, type); dynValueReader_ = null; try { int count = origType_.member_count(); components_ = new org.omg.DynamicAny.DynAny[count]; for (int i = 0; i < count; i++) components_[i] = create(origType_.member_type(i), true); if (count == 0) // empty exception index_ = -1; else index_ = 0; } 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); } } DynStruct_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type, org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader) { super(factory, orbInstance, type); dynValueReader_ = dynValueReader; try { int count = origType_.member_count(); components_ = new org.omg.DynamicAny.DynAny[count]; for (int i = 0; i < count; i++) { org.omg.CORBA.TypeCode memberType = origType_.member_type(i); org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(memberType); if ((origTC.kind().value() == org.omg.CORBA.TCKind._tk_value) && (dynValueReader_ != null)) { components_[i] = null; } else { components_[i] = prepare(memberType, dynValueReader_, true); } } if (count == 0) // empty exception index_ = -1; else index_ = 0; } 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); } } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return; if (!dyn_any.type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.apache.yoko.orb.OB.Assert._OB_assert(components_.length == dyn_any .component_count()); dyn_any.rewind(); for (int i = 0; i < components_.length; i++) { components_[i].assign(dyn_any.current_component()); dyn_any.next(); } if (components_.length == 0) // empty exception index_ = -1; else index_ = 0; notifyParent(); } public synchronized void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // Convert value to an ORBacus Any - the JDK implementation // of TypeCode.equivalent() raises NO_IMPLEMENT // Any val = null; try { val = (Any) value; } catch (ClassCastException ex) { try { val = new Any(value); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } } if (!val._OB_type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.omg.CORBA.portable.InputStream in = null; try { in = val.create_input_stream(); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } _OB_unmarshal((InputStream) in); if (components_.length == 0) // empty exception index_ = -1; else index_ = 0; notifyParent(); } public synchronized org.omg.CORBA.Any to_any() { return to_any(null); } public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); if (dynValueWriter != null) _OB_marshal(out, dynValueWriter); else _OB_marshal(out); InputStream in = (InputStream) out.create_input_stream(); Any result = new Any(orbInstance_, type_, in); return result; } public synchronized boolean equal(org.omg.DynamicAny.DynAny dyn_any) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return true; if (!dyn_any.type().equivalent(type_)) return false; dyn_any.rewind(); try { for (int i = 0; i < components_.length; i++) { if (!components_[i].equal(dyn_any.current_component())) return false; dyn_any.next(); } } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { return false; } return true; } public synchronized org.omg.DynamicAny.DynAny copy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // Marshal this. The DynValueWriter keeps track of DynValue instances. // They will be referenced again during demarshalling, thus // maintaining DynValue equality between the original and the copy. // DynValueWriter dynValueWriter = new DynValueWriter(orbInstance_, factory_); org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); _OB_marshal(out, dynValueWriter); dynValueReader_ = dynValueWriter.getReader(); org.omg.DynamicAny.DynAny result = prepare(type_, dynValueReader_, false); DynAny_impl impl = (DynAny_impl) result; InputStream in = (InputStream) out.create_input_stream(); impl._OB_unmarshal(in); return result; } public synchronized boolean seek(int index) { if (index < 0 || index >= components_.length) { index_ = -1; return false; } index_ = index; return true; } public synchronized void rewind() { seek(0); } public synchronized boolean next() { if (index_ + 1 >= components_.length) { index_ = -1; return false; } index_++; return true; } public synchronized int component_count() { return components_.length; } public synchronized org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (components_.length == 0) // empty exception throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ == -1) return null; return components_[index_]; } public synchronized String current_member_name() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (components_.length == 0) // empty exception throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ < 0) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); String result = null; try { result = origType_.member_name(index_); } 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; } public synchronized org.omg.CORBA.TCKind current_member_kind() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (components_.length == 0) // empty exception throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ < 0) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.TCKind result = null; try { org.omg.CORBA.TypeCode memberTC = origType_.member_type(index_); org.omg.CORBA.TypeCode origMemberTC = TypeCode ._OB_getOrigType(memberTC); result = origMemberTC.kind(); } 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; } public synchronized org.omg.DynamicAny.NameValuePair[] get_members() { org.omg.DynamicAny.NameValuePair[] result = new org.omg.DynamicAny.NameValuePair[components_.length]; try { for (int i = 0; i < components_.length; i++) { result[i] = new org.omg.DynamicAny.NameValuePair(); result[i].id = origType_.member_name(i); result[i].value = components_[i].to_any(); } } 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; } public synchronized void set_members( org.omg.DynamicAny.NameValuePair[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (value.length != components_.length) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Prior to modifying our components, validate the supplied // name-value pairs to check for matching member names and // compatible TypeCodes // try { Any[] values = new Any[value.length]; for (int i = 0; i < components_.length; i++) { String name = origType_.member_name(i); if (value[i].id.length() > 0 && name.length() > 0 && !value[i].id.equals(name)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); // // The JDK ORB's implementation of TypeCode doesn't // support equivalent(), so we need to ensure we // get an ORBacus TypeCode // try { values[i] = (Any) value[i].value; } catch (ClassCastException ex) { values[i] = new Any(value[i].value); } org.omg.CORBA.TypeCode valueType = values[i]._OB_type(); org.omg.CORBA.TypeCode memberType = components_[i].type(); if (!valueType.equivalent(memberType)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } for (int i = 0; i < components_.length; i++) components_[i].from_any(values[i]); if (components_.length == 0) // empty exception index_ = -1; else index_ = 0; notifyParent(); } 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); } } public synchronized org.omg.DynamicAny.NameDynAnyPair[] get_members_as_dyn_any() { org.omg.DynamicAny.NameDynAnyPair[] result = new org.omg.DynamicAny.NameDynAnyPair[components_.length]; try { for (int i = 0; i < components_.length; i++) { result[i] = new org.omg.DynamicAny.NameDynAnyPair(); result[i].id = origType_.member_name(i); result[i].value = components_[i]; } } 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; } public synchronized void set_members_as_dyn_any( org.omg.DynamicAny.NameDynAnyPair[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (value.length != components_.length) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Prior to modifying our components, validate the supplied // name-value pairs to check for matching member names and // compatible TypeCodes // try { for (int i = 0; i < components_.length; i++) { String name = origType_.member_name(i); if (value[i].id.length() > 0 && name.length() > 0 && !value[i].id.equals(name)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.omg.CORBA.TypeCode valueType = value[i].value.type(); org.omg.CORBA.TypeCode memberType = components_[i].type(); if (!valueType.equivalent(memberType)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } for (int i = 0; i < components_.length; i++) components_[i].assign(value[i].value); if (components_.length == 0) // empty exception index_ = -1; else index_ = 0; notifyParent(); } 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); } } // ------------------------------------------------------------------ // Internal member implementations // ------------------------------------------------------------------ synchronized void _OB_marshal(OutputStream out) { _OB_marshal(out, new DynValueWriter(orbInstance_, factory_)); } synchronized void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter) { if (origType_.kind() == org.omg.CORBA.TCKind.tk_except) { try { out.write_string(origType_.id()); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } for (int i = 0; i < components_.length; i++) { DynAny_impl impl = (DynAny_impl) components_[i]; impl._OB_marshal(out, dynValueWriter); } } synchronized void _OB_unmarshal(InputStream in) { if (origType_.kind() == org.omg.CORBA.TCKind.tk_except) { in.read_string(); } for (int i = 0; i < components_.length; i++) { org.omg.CORBA.TypeCode memberType; try { memberType = origType_.member_type(i); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return; } catch (org.omg.CORBA.TypeCodePackage.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return; } org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(memberType); if ((origTC.kind().value() == org.omg.CORBA.TCKind._tk_value) && (dynValueReader_ != null)) { // // Create DynValue components // org.apache.yoko.orb.OB.Assert ._OB_assert(components_[i] == null); try { components_[i] = dynValueReader_.readValue(in, memberType); } catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return; } adoptChild(components_[i]); } else { // // Set non-DynValue components // DynAny_impl impl = (DynAny_impl) components_[i]; impl._OB_unmarshal(in); } } notifyParent(); } synchronized Any _OB_currentAny() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (index_ >= 0 && index_ <= components_.length) { DynAny_impl impl = (DynAny_impl) components_[index_]; return impl._OB_currentAnyValue(); } return null; } Any _OB_currentAnyValue() { return null; } }
6,628
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/DynamicAny/DynSequence_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; final class DynSequence_impl extends DynSeqBase_impl implements org.omg.DynamicAny.DynSequence { DynSequence_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { super(factory, orbInstance, type); } DynSequence_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type, DynValueReader dynValueReader) { super(factory, orbInstance, type, dynValueReader); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized int get_length() { return length_; } public synchronized void set_length(int len) throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { // // If bounded sequence, ensure new length is not greater // than the bounds // if (max_ > 0 && len > max_) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); resize(len, true); notifyParent(); } public synchronized org.omg.CORBA.Any[] get_elements() { return getElements(); } public synchronized void set_elements(org.omg.CORBA.Any[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { for (int i = 0; i < value.length; i++) { org.omg.CORBA.TypeCode tc = value[i].type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); if (origTC.kind() != contentKind_) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } resize(value.length, false); for (int i = 0; i < value.length; i++) setValue(i, value[i]); if (value.length == 0) index_ = -1; else index_ = 0; notifyParent(); } public synchronized org.omg.DynamicAny.DynAny[] get_elements_as_dyn_any() { return getElementsAsDynAny(); } public synchronized void set_elements_as_dyn_any( org.omg.DynamicAny.DynAny[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { for (int i = 0; i < value.length; i++) { org.omg.CORBA.TypeCode tc = value[i].type(); org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); if (origTC.kind() != contentKind_) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } resize(value.length, false); for (int i = 0; i < value.length; i++) setValue(i, value[i]); if (value.length == 0) index_ = -1; else index_ = 0; notifyParent(); } }
6,629
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/DynamicAny/DynUnion_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; final class DynUnion_impl extends DynAny_impl implements org.omg.DynamicAny.DynUnion { private org.omg.DynamicAny.DynAny disc_; private org.omg.DynamicAny.DynAny member_; private int index_; private int defaultMember_; private int selectedMember_; private long[] memberLabels_; private org.omg.CORBA.TypeCode origDiscTC_; private boolean ignoreDiscChange_; org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader_; DynUnion_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { this(factory, orbInstance, type, null); } DynUnion_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type, org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader) { super(factory, orbInstance, type); dynValueReader_ = dynValueReader; try { org.omg.CORBA.TypeCode discTC = origType_.discriminator_type(); index_ = 0; defaultMember_ = origType_.default_index(); selectedMember_ = 0; origDiscTC_ = TypeCode._OB_getOrigType(discTC); int count = origType_.member_count(); memberLabels_ = new long[count]; for (int i = 0; i < count; i++) { if (i != defaultMember_) { org.omg.CORBA.Any any = origType_.member_label(i); memberLabels_[i] = getDiscriminatorValue(any); } } if (defaultMember_ != -1) memberLabels_[defaultMember_] = findUnusedDiscriminator(); disc_ = create(discTC, true); ignoreDiscChange_ = true; resetDiscriminator(memberLabels_[selectedMember_]); org.omg.CORBA.TypeCode memberType = origType_ .member_type(selectedMember_); if (dynValueReader_ != null) { org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(memberType); if (origTC.kind().value() == org.omg.CORBA.TCKind._tk_value) member_ = null; else member_ = prepare(memberType, dynValueReader_, true); } else { member_ = create(memberType, true); } } 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); } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ protected void childModified(org.omg.DynamicAny.DynAny p) { // // We need to monitor the discriminator component. If it is modified, // then we need to initialize the active member appropriately. If // ignoreDiscChange_ is true, then we ignore this change to the // discriminator. // if (p == disc_) { if (!ignoreDiscChange_) { // // Act as if set_discriminator had been called // initMember(); if (member_ == null) index_ = 0; else index_ = 1; notifyParent(); } ignoreDiscChange_ = false; } } private void initMember() { try { long discValue; if (discriminator_kind() == org.omg.CORBA.TCKind.tk_enum) { org.omg.DynamicAny.DynEnum de = org.omg.DynamicAny.DynEnumHelper .narrow(disc_); discValue = de.get_as_ulong(); } else { DynAny_impl discImpl = (DynAny_impl) disc_; org.omg.CORBA.Any discAny = discImpl._OB_currentAny(); org.apache.yoko.orb.OB.Assert._OB_assert(discAny != null); discValue = getDiscriminatorValue(discAny); } // // Search the labels for one matching the discriminator // int i; for (i = 0; i < memberLabels_.length; i++) if (discValue == memberLabels_[i]) break; // // If no matching label was found, check for a default member. // If there's no default member, then we have no member value. // if (i == memberLabels_.length) { if (defaultMember_ != -1) i = defaultMember_; else { if (member_ != null) member_ = null; selectedMember_ = origType_.member_count(); return; } } // // If the member names are different, then we deactivate the // current member and initialize the new one // if (selectedMember_ == origType_.member_count() || !origType_.member_name(selectedMember_).equals( origType_.member_name(i))) { member_ = create(origType_.member_type(i), true); } selectedMember_ = i; } 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); } } private void resetDiscriminator(long val) { try { // // Insert the default discriminator value // switch (discriminator_kind().value()) { case org.omg.CORBA.TCKind._tk_boolean: disc_.insert_boolean(val == 1); break; case org.omg.CORBA.TCKind._tk_char: disc_.insert_char((char) val); break; case org.omg.CORBA.TCKind._tk_short: disc_.insert_short((short) val); break; case org.omg.CORBA.TCKind._tk_ushort: disc_.insert_ushort((short) val); break; case org.omg.CORBA.TCKind._tk_long: disc_.insert_long((int) val); break; case org.omg.CORBA.TCKind._tk_ulong: disc_.insert_ulong((int) val); break; case org.omg.CORBA.TCKind._tk_longlong: disc_.insert_longlong(val); break; case org.omg.CORBA.TCKind._tk_ulonglong: disc_.insert_ulonglong(val); break; case org.omg.CORBA.TCKind._tk_enum: { org.omg.DynamicAny.DynEnum e = org.omg.DynamicAny.DynEnumHelper .narrow(disc_); e.set_as_ulong((int) val); break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported union type"); } } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } private long getDiscriminatorValue(org.omg.CORBA.Any any) { long result = 0; switch (discriminator_kind().value()) { case org.omg.CORBA.TCKind._tk_boolean: result = any.extract_boolean() ? 1 : 0; break; case org.omg.CORBA.TCKind._tk_char: result = any.extract_char(); break; case org.omg.CORBA.TCKind._tk_short: result = any.extract_short(); break; case org.omg.CORBA.TCKind._tk_ushort: result = any.extract_ushort(); break; case org.omg.CORBA.TCKind._tk_long: result = any.extract_long(); break; case org.omg.CORBA.TCKind._tk_ulong: result = any.extract_ulong(); break; case org.omg.CORBA.TCKind._tk_longlong: result = any.extract_longlong(); break; case org.omg.CORBA.TCKind._tk_ulonglong: result = any.extract_ulonglong(); break; case org.omg.CORBA.TCKind._tk_enum: { try { Any a = (Any) any; result = ((Integer) a.value()).longValue(); } catch (ClassCastException ex) { result = any.create_input_stream().read_ulong(); } break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported union type"); } return result; } private long findUnusedDiscriminator() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { // // Find an unused value among the member labels // long min = 0, max = 0; switch (discriminator_kind().value()) { case org.omg.CORBA.TCKind._tk_boolean: min = 0; max = 1; break; case org.omg.CORBA.TCKind._tk_char: min = 0; max = 255; break; case org.omg.CORBA.TCKind._tk_short: min = -32768; max = 32767; break; case org.omg.CORBA.TCKind._tk_ushort: min = 0; max = 65535; break; case org.omg.CORBA.TCKind._tk_long: min = Integer.MIN_VALUE; max = Integer.MAX_VALUE; break; case org.omg.CORBA.TCKind._tk_ulong: min = 0; max = Integer.MAX_VALUE; break; case org.omg.CORBA.TCKind._tk_longlong: min = Long.MIN_VALUE; max = Long.MAX_VALUE; break; case org.omg.CORBA.TCKind._tk_ulonglong: min = 0; max = Long.MAX_VALUE; break; case org.omg.CORBA.TCKind._tk_enum: { try { min = 0; max = (origDiscTC_.member_count() - 1); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } break; } default: org.apache.yoko.orb.OB.Assert._OB_assert("Unsupported union type"); } for (long i = max; i >= min; i--) { boolean found = false; for (int j = 0; !found && j < memberLabels_.length; j++) if (j != defaultMember_ && memberLabels_[j] == i) found = true; if (!found) return i; } // // No value found // throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return; if (!dyn_any.type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); DynUnion_impl impl = (DynUnion_impl) dyn_any; selectedMember_ = impl.selectedMember_; ignoreDiscChange_ = true; disc_.assign(impl.disc_); if (member_ != null) member_ = null; if (impl.member_ != null) { member_ = impl.member_.copy(); adoptChild(member_); } index_ = 0; notifyParent(); } public synchronized void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // Convert value to an ORBacus Any - the JDK implementation // of TypeCode.equivalent() raises NO_IMPLEMENT // Any val = null; try { val = (Any) value; } catch (ClassCastException ex) { try { val = new Any(value); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } } if (!val._OB_type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.omg.CORBA.portable.InputStream in = null; try { in = val.create_input_stream(); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } _OB_unmarshal((InputStream) in); index_ = 0; notifyParent(); } public synchronized org.omg.CORBA.Any to_any() { return to_any(null); } public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); if (dynValueWriter != null) _OB_marshal(out, dynValueWriter); else _OB_marshal(out); InputStream in = (InputStream) out.create_input_stream(); Any result = new Any(orbInstance_, type_, in); return result; } public synchronized boolean equal(org.omg.DynamicAny.DynAny dyn_any) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return true; if (!dyn_any.type().equivalent(type_)) return false; if (component_count() != dyn_any.component_count()) return false; org.omg.DynamicAny.DynUnion du = org.omg.DynamicAny.DynUnionHelper .narrow(dyn_any); if (!disc_.equal(du.get_discriminator())) return false; try { if (member_ != null) { if (!member_.equal(du.member())) return false; } } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } return true; } public synchronized org.omg.DynamicAny.DynAny copy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); DynValueReader dynValueReader = new DynValueReader(orbInstance_, factory_, false); DynUnion_impl result = new DynUnion_impl(factory_, orbInstance_, type_, dynValueReader); try { result.set_discriminator(disc_); if (member_ != null) { org.omg.CORBA.TypeCode memberType = origType_ .member_type(selectedMember_); org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(memberType); if (origTC.kind().value() == org.omg.CORBA.TCKind._tk_value) { org.apache.yoko.orb.OB.Assert ._OB_assert(result.member_ == null); result.member_ = member_.copy(); } else { result.member().assign(member_); } } } 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); } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } return result; } public synchronized boolean seek(int index) { int max = (member_ == null) ? 1 : 2; if (index < 0 || index >= max) { index_ = -1; return false; } index_ = index; return true; } public synchronized void rewind() { seek(0); } public synchronized boolean next() { int max = (member_ == null) ? 1 : 2; if (index_ + 1 >= max) { index_ = -1; return false; } index_++; return true; } public synchronized int component_count() { if (member_ == null) return 1; else return 2; } public synchronized org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (index_ < 0) return null; org.apache.yoko.orb.OB.Assert._OB_assert(index_ < 2); if (index_ == 0) return disc_; else { org.apache.yoko.orb.OB.Assert._OB_assert(member_ != null); return member_; } } public synchronized org.omg.DynamicAny.DynAny get_discriminator() { return disc_; } public synchronized void set_discriminator(org.omg.DynamicAny.DynAny d) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (!d.type().equivalent(origDiscTC_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (!d.equal(disc_)) { // // Change the discriminator - the member will be initialized // by childModified() // disc_.assign(d); notifyParent(); } } public synchronized void set_to_default_member() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (defaultMember_ == -1) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); // // Reset the discriminator to select the default member. The // member will be initialized by childModified(). // resetDiscriminator(memberLabels_[defaultMember_]); index_ = 0; notifyParent(); } public synchronized void set_to_no_active_member() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (defaultMember_ != -1) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); // // Reset the discriminator to an unused value. The current // member will be deactivated by childModified(). // long val = findUnusedDiscriminator(); resetDiscriminator(val); index_ = 0; notifyParent(); } public synchronized boolean has_no_active_member() { return (member_ == null); } public synchronized org.omg.CORBA.TCKind discriminator_kind() { return origDiscTC_.kind(); } public synchronized org.omg.DynamicAny.DynAny member() throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (member_ == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); return member_; } public synchronized String member_name() throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (member_ == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return origType_.member_name(selectedMember_); } 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 null; // The compiler needs this } public synchronized org.omg.CORBA.TCKind member_kind() throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (member_ == null) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); try { return origType_.member_type(selectedMember_).kind(); } 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 null; // The compiler needs this } public synchronized boolean is_set_to_default_member() { return (defaultMember_ != -1 && selectedMember_ == defaultMember_); } // ------------------------------------------------------------------ // Internal member implementations // ------------------------------------------------------------------ synchronized void _OB_marshal(OutputStream out) { _OB_marshal(out, new DynValueWriter(orbInstance_, factory_)); } synchronized void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter) { DynAny_impl impl = (DynAny_impl) disc_; impl._OB_marshal(out); if (member_ != null) { impl = (DynAny_impl) member_; impl._OB_marshal(out, dynValueWriter); } } synchronized void _OB_unmarshal(InputStream in) { DynAny_impl impl = (DynAny_impl) disc_; impl._OB_unmarshal(in); // // The member is initialized by childModified() // org.omg.CORBA.TypeCode memberType; try { memberType = origType_.member_type(selectedMember_); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return; } catch (org.omg.CORBA.TypeCodePackage.Bounds ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return; } org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(memberType); if ((origTC.kind().value() == org.omg.CORBA.TCKind._tk_value) && (dynValueReader_ != null)) { // // Create DynValue components // org.apache.yoko.orb.OB.Assert._OB_assert(member_ == null); try { member_ = dynValueReader_.readValue(in, memberType); } catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return; } adoptChild(member_); } else if (member_ != null) { impl = (DynAny_impl) member_; impl._OB_unmarshal(in); } notifyParent(); } synchronized Any _OB_currentAny() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); DynAny_impl p = null; if (index_ == 0) // discriminator p = (DynAny_impl) disc_; else if (index_ == 1) // member { org.apache.yoko.orb.OB.Assert._OB_assert(member_ != null); p = (DynAny_impl) member_; } Any result = null; if (p != null) result = p._OB_currentAnyValue(); return result; } Any _OB_currentAnyValue() { return null; } }
6,630
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/DynamicAny/DynFixed_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; import org.omg.DynamicAny.DynAnyPackage.InvalidValue; final class DynFixed_impl extends DynAny_impl implements org.omg.DynamicAny.DynFixed { private java.math.BigDecimal value_; DynFixed_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { super(factory, orbInstance, type); value_ = new java.math.BigDecimal(0); } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return; if (!dyn_any.type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); DynFixed_impl impl = (DynFixed_impl) dyn_any; value_ = impl.value_; notifyParent(); } public synchronized void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // Convert value to an ORBacus Any - the JDK implementation // of TypeCode.equivalent() raises NO_IMPLEMENT // Any val = null; try { val = (Any) value; } catch (ClassCastException ex) { try { val = new Any(value); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } } if (!val._OB_type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); try { java.math.BigDecimal f = val.extract_fixed(); if (f == null || f.scale() > origType_.fixed_scale()) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); value_ = f; } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } catch (org.omg.CORBA.BAD_OPERATION ex) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(ex); } notifyParent(); } public synchronized org.omg.CORBA.Any to_any() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return new Any(orbInstance_, type_, value_); } public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) { return to_any(); } public synchronized boolean equal(org.omg.DynamicAny.DynAny dyn_any) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return true; if (!dyn_any.type().equivalent(type_)) return false; DynFixed_impl impl = (DynFixed_impl) dyn_any; return value_.equals(impl.value_); } public synchronized org.omg.DynamicAny.DynAny copy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); DynFixed_impl result = new DynFixed_impl(factory_, orbInstance_, type_); result.value_ = value_; return result; } public boolean seek(int index) { return false; } public void rewind() { // do nothing } public boolean next() { return false; } public int component_count() { return 0; } public org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } public synchronized String get_value() { return value_.toString(); } public synchronized boolean set_value(String val) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { String s = val.trim().toLowerCase(); if (s.endsWith("d")) s = s.substring(0, s.length() - 1); if (s.length() == 0) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); java.math.BigDecimal f = null; try { f = new java.math.BigDecimal(s); } catch (NumberFormatException ex) { throw (org.omg.DynamicAny.DynAnyPackage.TypeMismatch)new org.omg.DynamicAny.DynAnyPackage.TypeMismatch().initCause(ex); } int origDigits = 0, origScale = 0; try { origDigits = origType_.fixed_digits(); origScale = origType_.fixed_scale(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } int fDigits = 0, fScale = f.scale(); if (fScale > 0) fDigits = f.movePointRight(fScale).abs().toString().length(); else fDigits = f.abs().toString().length(); // // Raise InvalidValue if this DynFixed is incapable of // representing the value (even with a loss of precision) // if ((fDigits - fScale) > (origDigits - origScale)) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Return true if there was no loss of precision, otherwise // truncate and return false // boolean result = true; if (fScale > origScale) { value_ = f.setScale(origScale, java.math.BigDecimal.ROUND_DOWN); result = false; } else value_ = f.setScale(origScale); notifyParent(); return result; } // ------------------------------------------------------------------ // Internal member implementations // ------------------------------------------------------------------ synchronized void _OB_marshal(OutputStream out) { try { out.write_fixed(value_.movePointRight(origType_.fixed_scale())); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } synchronized void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter) { _OB_marshal(out); } synchronized void _OB_unmarshal(InputStream in) { 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); } notifyParent(); } Any _OB_currentAny() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return null; } Any _OB_currentAnyValue() { return null; } }
6,631
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/DynamicAny/DynValue_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.DynamicAny; import org.apache.yoko.orb.CORBA.Any; import org.apache.yoko.orb.CORBA.InputStream; import org.apache.yoko.orb.CORBA.OutputStream; import org.apache.yoko.orb.CORBA.TypeCode; final class DynValue_impl extends DynValueCommon_impl implements org.omg.DynamicAny.DynValue { private org.omg.DynamicAny.DynAny[] components_ = new org.omg.DynamicAny.DynAny[0]; private String[] names_; private org.omg.CORBA.TypeCode[] types_; private String[] ids_; private int index_; org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader_; DynValue_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type) { this(factory, orbInstance, type, null); } DynValue_impl(org.omg.DynamicAny.DynAnyFactory factory, org.apache.yoko.orb.OB.ORBInstance orbInstance, org.omg.CORBA.TypeCode type, org.apache.yoko.orb.DynamicAny.DynValueReader dynValueReader) { super(factory, orbInstance, type); dynValueReader_ = dynValueReader; try { // // Custom valuetypes are not supported by DynValue_impl // org.apache.yoko.orb.OB.Assert ._OB_assert(origType_.type_modifier() != org.omg.CORBA.VM_CUSTOM.value); java.util.Vector names = new java.util.Vector(); java.util.Vector types = new java.util.Vector(); getMembers(type_, names, types); names_ = new String[names.size()]; names.copyInto(names_); types_ = new org.omg.CORBA.TypeCode[types.size()]; types.copyInto(types_); // // Collect our repository IDs for marshalling purposes. If the // type is truncatable, include IDs of all base types. // java.util.Vector ids = new java.util.Vector(); ids.addElement(origType_.id()); if (origType_.kind() == org.omg.CORBA.TCKind.tk_value) { short mod = origType_.type_modifier(); if (mod == org.omg.CORBA.VM_TRUNCATABLE.value) { org.omg.CORBA.TypeCode baseType = origType_ .concrete_base_type(); // // Workaround for bug in JDK ORB, which returns a // tk_null TypeCode instead of null if there is no // concrete base type // // while(baseType != null) while (baseType != null && baseType.kind() != org.omg.CORBA.TCKind.tk_null) { org.omg.CORBA.TypeCode origBaseType = TypeCode ._OB_getOrigType(baseType); ids.addElement(origBaseType.id()); baseType = origBaseType.concrete_base_type(); } } } ids_ = new String[ids.size()]; ids.copyInto(ids_); // // Initial value is null // set_to_null(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } // ------------------------------------------------------------------ // Private and protected member implementations // ------------------------------------------------------------------ private void getMembers(org.omg.CORBA.TypeCode tc, java.util.Vector names, java.util.Vector types) { try { org.omg.CORBA.TypeCode origTC = TypeCode._OB_getOrigType(tc); org.omg.CORBA.TypeCode base = origTC.concrete_base_type(); // // Workaround for bug in JDK ORB, which returns a tk_null // TypeCode instead of null if there is no concrete base type // // if(base != null) if (base != null && base.kind() != org.omg.CORBA.TCKind.tk_null) getMembers(base, names, types); for (int i = 0; i < origTC.member_count(); i++) { names.addElement(origTC.member_name(i)); types.addElement(origTC.member_type(i)); } } 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); } } protected void createComponents() { if (components_.length == 0 && types_.length > 0) { components_ = new org.omg.DynamicAny.DynAny[types_.length]; for (int i = 0; i < types_.length; i++) { org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(types_[i]); if ((origTC.kind().value() == org.omg.CORBA.TCKind._tk_value) && (dynValueReader_ != null)) { components_[i] = null; } else { components_[i] = prepare(types_[i], dynValueReader_, true); } } index_ = 0; } } protected void destroyComponents() { if (components_.length > 0) { for (int i = 0; i < components_.length; i++) components_[i].destroy(); components_ = new org.omg.DynamicAny.DynAny[0]; } index_ = -1; } // ------------------------------------------------------------------ // Standard IDL to Java Mapping // ------------------------------------------------------------------ public synchronized void assign(org.omg.DynamicAny.DynAny dyn_any) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (this == dyn_any) return; if (!dyn_any.type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.omg.DynamicAny.DynValue dv = org.omg.DynamicAny.DynValueHelper .narrow(dyn_any); if (dv.is_null()) set_to_null(); else { set_to_value(); org.apache.yoko.orb.OB.Assert._OB_assert(components_.length == dv .component_count()); dv.rewind(); for (int i = 0; i < components_.length; i++) { components_[i].assign(dv.current_component()); dv.next(); } if (components_.length == 0) index_ = -1; else index_ = 0; } notifyParent(); } public synchronized void from_any(org.omg.CORBA.Any value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); // // Convert value to an ORBacus Any - the JDK implementation // of TypeCode.equivalent() raises NO_IMPLEMENT // Any val = null; try { val = (Any) value; } catch (ClassCastException ex) { try { val = new Any(value); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } } if (!val._OB_type().equivalent(type_)) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.omg.CORBA.portable.InputStream in = null; try { in = val.create_input_stream(); } catch (NullPointerException e) { throw (org.omg.DynamicAny.DynAnyPackage.InvalidValue)new org.omg.DynamicAny.DynAnyPackage.InvalidValue().initCause(e); } _OB_unmarshal((InputStream) in); if (is_null() || components_.length == 0) index_ = -1; else index_ = 0; notifyParent(); } public synchronized org.omg.CORBA.Any to_any() { return to_any(null); } public synchronized org.omg.CORBA.Any to_any(DynValueWriter dynValueWriter) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (is_null()) return new Any(orbInstance_, type_, null); else { org.apache.yoko.orb.OCI.Buffer buf = new org.apache.yoko.orb.OCI.Buffer(); OutputStream out = new OutputStream(buf); out._OB_ORBInstance(orbInstance_); if (dynValueWriter != null) _OB_marshal(out, dynValueWriter); else _OB_marshal(out); InputStream in = (InputStream) out.create_input_stream(); return new Any(orbInstance_, type_, in); } } public synchronized boolean equal(org.omg.DynamicAny.DynAny dyn_any) { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return (this == dyn_any); } public synchronized org.omg.DynamicAny.DynAny copy() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); return this; } public synchronized boolean seek(int index) { if (index < 0 || index >= components_.length) { index_ = -1; return false; } index_ = index; return true; } public synchronized void rewind() { seek(0); } public synchronized boolean next() { if (is_null() || index_ + 1 >= names_.length) { index_ = -1; return false; } index_++; return true; } public synchronized int component_count() { return components_.length; } public synchronized org.omg.DynamicAny.DynAny current_component() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (names_.length == 0) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ == -1) return null; return components_[index_]; } public synchronized String current_member_name() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (names_.length == 0) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ < 0) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); return names_[index_]; } public synchronized org.omg.CORBA.TCKind current_member_kind() throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (types_.length == 0) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); if (index_ < 0) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.CORBA.TypeCode origTC = TypeCode ._OB_getOrigType(types_[index_]); return origTC.kind(); } public synchronized org.omg.DynamicAny.NameValuePair[] get_members() throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (is_null()) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.DynamicAny.NameValuePair[] result = new org.omg.DynamicAny.NameValuePair[components_.length]; for (int i = 0; i < components_.length; i++) { result[i] = new org.omg.DynamicAny.NameValuePair(); result[i].id = names_[i]; result[i].value = components_[i].to_any(); } return result; } public synchronized void set_members( org.omg.DynamicAny.NameValuePair[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (value.length != names_.length) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Prior to modifying our components, validate the supplied // name-value pairs to check for matching member names and // compatible TypeCodes // Any[] values = new Any[value.length]; for (int i = 0; i < names_.length; i++) { if (value[i].id.length() > 0 && names_[i].length() > 0 && !value[i].id.equals(names_[i])) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); // // The JDK ORB's implementation of TypeCode doesn't // support equivalent(), so we need to ensure we // get an ORBacus TypeCode // try { values[i] = (Any) value[i].value; } catch (ClassCastException ex) { values[i] = new Any(value[i].value); } org.omg.CORBA.TypeCode valueType = values[i]._OB_type(); if (!valueType.equivalent(types_[i])) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } set_to_value(); for (int i = 0; i < components_.length; i++) components_[i].from_any(values[i]); if (components_.length == 0) index_ = -1; else index_ = 0; notifyParent(); } public synchronized org.omg.DynamicAny.NameDynAnyPair[] get_members_as_dyn_any() throws org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (is_null()) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); org.omg.DynamicAny.NameDynAnyPair[] result = new org.omg.DynamicAny.NameDynAnyPair[components_.length]; for (int i = 0; i < components_.length; i++) { result[i] = new org.omg.DynamicAny.NameDynAnyPair(); result[i].id = names_[i]; result[i].value = components_[i]; } return result; } public synchronized void set_members_as_dyn_any( org.omg.DynamicAny.NameDynAnyPair[] value) throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch, org.omg.DynamicAny.DynAnyPackage.InvalidValue { if (value.length != names_.length) throw new org.omg.DynamicAny.DynAnyPackage.InvalidValue(); // // Prior to modifying our components, validate the supplied // name-value pairs to check for matching member names and // compatible TypeCodes // for (int i = 0; i < names_.length; i++) { if (value[i].id.length() > 0 && names_[i].length() > 0 && !value[i].id.equals(names_[i])) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); org.omg.CORBA.TypeCode valueType = value[i].value.type(); if (!valueType.equivalent(types_[i])) throw new org.omg.DynamicAny.DynAnyPackage.TypeMismatch(); } set_to_value(); for (int i = 0; i < components_.length; i++) components_[i].assign(value[i].value); if (components_.length == 0) index_ = -1; else index_ = 0; notifyParent(); } // ------------------------------------------------------------------ // Internal member implementations // ------------------------------------------------------------------ synchronized void _OB_marshal(OutputStream out) { _OB_marshal(out, new DynValueWriter(orbInstance_, factory_)); } synchronized void _OB_marshal(OutputStream out, DynValueWriter dynValueWriter) { if (is_null()) { out.write_ulong(0); } else if (!dynValueWriter.writeIndirection(this, out)) { try { int tag; boolean chunk = false; // // Let the DynValue Marshaller know about this instance. // We need to do this here because it may be refered by // some of the components of this instance (even indirectly). // int startPos = out._OB_buffer().pos_; dynValueWriter.indexValue(this, startPos); short mod = origType_.type_modifier(); if (mod == org.omg.CORBA.VM_TRUNCATABLE.value) { chunk = true; tag = 0x7fffff06; } else tag = 0x7fffff02; out._OB_beginValue(tag, ids_, chunk); for (int i = 0; i < components_.length; i++) { DynAny_impl impl = (DynAny_impl) components_[i]; impl._OB_marshal(out, dynValueWriter); } out._OB_endValue(); } catch (org.omg.CORBA.TypeCodePackage.BadKind ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); } } } synchronized void _OB_unmarshal(InputStream in) { // // Peek at value tag // int save = in._OB_pos(); int ind = 0; int tag = in.read_long(); if (tag == 0) // null value { set_to_null(); return; } else if (tag == -1) { // // Indirection - rewind to offset // int offs = in.read_long(); ind = in._OB_pos(); // save position after offset in._OB_pos(in._OB_pos() - 4 + offs); } else in._OB_pos(save); // restore tag position set_to_value(); in._OB_beginValue(); // // Unmarshal component state // for (int i = 0; i < components_.length; i++) { org.omg.CORBA.TypeCode origTC = org.apache.yoko.orb.CORBA.TypeCode ._OB_getOrigType(types_[i]); if ((origTC.kind().value() == org.omg.CORBA.TCKind._tk_value) && (dynValueReader_ != null)) { org.apache.yoko.orb.OB.Assert ._OB_assert(components_[i] == null); try { components_[i] = dynValueReader_.readValue(in, types_[i]); } catch (org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ex) { org.apache.yoko.orb.OB.Assert._OB_assert(ex); return; } adoptChild(components_[i]); } else { DynAny_impl impl = (DynAny_impl) components_[i]; impl._OB_unmarshal(in); } } // // Compare the position of the input stream before and after the // unmarshalling of the valueType has ended. The existence of // skipped chunks indicates ValueType more derivated than this one, // and that truncation has occured // int pos_before = in._OB_pos(); in._OB_endValue(); int pos_after = in._OB_pos(); if (pos_after != pos_before && dynValueReader_ != null) { dynValueReader_.mustTruncate = true; } // // Restore position after indirection // if (ind != 0) in._OB_pos(ind); notifyParent(); } synchronized Any _OB_currentAny() { if (destroyed_) throw new org.omg.CORBA.OBJECT_NOT_EXIST(); if (index_ >= 0 && index_ <= components_.length) { DynAny_impl impl = (DynAny_impl) components_[index_]; return impl._OB_currentAnyValue(); } return null; } Any _OB_currentAnyValue() { return null; } }
6,632
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/NoSuchServer.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/NoSuchServer:1.0 // /** * * A NoSuchServer exception indicates that the server detailed in the * member <code>name</code> doesn't exist. * **/ final public class NoSuchServer extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/NoSuchServer:1.0"; public NoSuchServer() { super(_ob_id); } public NoSuchServer(String name) { super(_ob_id); this.name = name; } public NoSuchServer(String _reason, String name) { super(_ob_id + " " + _reason); this.name = name; } public String name; }
6,633
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/ServerActivationModeHolder.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/ServerActivationMode:1.0 // final public class ServerActivationModeHolder implements org.omg.CORBA.portable.Streamable { public ServerActivationMode value; public ServerActivationModeHolder() { } public ServerActivationModeHolder(ServerActivationMode initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerActivationModeHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerActivationModeHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerActivationModeHelper.type(); } }
6,634
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/ServerSeqHolder.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/ServerSeq:1.0 // final public class ServerSeqHolder implements org.omg.CORBA.portable.Streamable { public Server[] value; public ServerSeqHolder() { } public ServerSeqHolder(Server[] initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerSeqHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerSeqHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerSeqHelper.type(); } }
6,635
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/ServerAlreadyRegisteredHelper.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/ServerAlreadyRegistered:1.0 // final public class ServerAlreadyRegisteredHelper { public static void insert(org.omg.CORBA.Any any, ServerAlreadyRegistered val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ServerAlreadyRegistered 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(), "ServerAlreadyRegistered", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerAlreadyRegistered:1.0"; } public static ServerAlreadyRegistered 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); } ServerAlreadyRegistered _ob_v = new ServerAlreadyRegistered(); _ob_v.name = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ServerAlreadyRegistered val) { out.write_string(id()); out.write_string(val.name); } }
6,636
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/ServerStatusHolder.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/ServerStatus:1.0 // final public class ServerStatusHolder implements org.omg.CORBA.portable.Streamable { public ServerStatus value; public ServerStatusHolder() { } public ServerStatusHolder(ServerStatus initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerStatusHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerStatusHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerStatusHelper.type(); } }
6,637
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/ServerSeqHelper.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/ServerSeq:1.0 // final public class ServerSeqHelper { public static void insert(org.omg.CORBA.Any any, Server[] val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static Server[] 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(), "ServerSeq", orb.create_sequence_tc(0, ServerHelper.type())); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerSeq:1.0"; } public static Server[] read(org.omg.CORBA.portable.InputStream in) { Server[] _ob_v; int len0 = in.read_ulong(); _ob_v = new Server[len0]; for(int i0 = 0; i0 < len0; i0++) _ob_v[i0] = ServerHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, Server[] val) { int len0 = val.length; out.write_ulong(len0); for(int i0 = 0; i0 < len0; i0++) ServerHelper.write(out, val[i0]); } }
6,638
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/ServerActivationModeHelper.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/ServerActivationMode:1.0 // final public class ServerActivationModeHelper { public static void insert(org.omg.CORBA.Any any, ServerActivationMode val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ServerActivationMode 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[2]; members[0] = "SHARED"; members[1] = "PERSISTENT"; typeCode_ = orb.create_enum_tc(id(), "ServerActivationMode", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerActivationMode:1.0"; } public static ServerActivationMode read(org.omg.CORBA.portable.InputStream in) { ServerActivationMode _ob_v; _ob_v = ServerActivationMode.from_int(in.read_ulong()); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ServerActivationMode val) { out.write_ulong(val.value()); } }
6,639
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/ServerAlreadyRegisteredHolder.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/ServerAlreadyRegistered:1.0 // final public class ServerAlreadyRegisteredHolder implements org.omg.CORBA.portable.Streamable { public ServerAlreadyRegistered value; public ServerAlreadyRegisteredHolder() { } public ServerAlreadyRegisteredHolder(ServerAlreadyRegistered initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerAlreadyRegisteredHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerAlreadyRegisteredHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerAlreadyRegisteredHelper.type(); } }
6,640
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/ServerStatusHelper.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/ServerStatus:1.0 // final public class ServerStatusHelper { public static void insert(org.omg.CORBA.Any any, ServerStatus val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ServerStatus 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] = "FORKED"; members[1] = "STARTING"; members[2] = "RUNNING"; members[3] = "STOPPING"; members[4] = "STOPPED"; typeCode_ = orb.create_enum_tc(id(), "ServerStatus", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerStatus:1.0"; } public static ServerStatus read(org.omg.CORBA.portable.InputStream in) { ServerStatus _ob_v; _ob_v = ServerStatus.from_int(in.read_ulong()); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ServerStatus val) { out.write_ulong(val.value()); } }
6,641
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/_DomainStub.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 class _DomainStub extends org.omg.CORBA.portable.ObjectImpl implements Domain { private static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/Domain:1.0", }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = DomainOperations.class; // // IDL:orb.yoko.apache.org/IMR/Domain/registerServer:1.0 // public void registerServer(String _ob_a0, String _ob_a1, String _ob_a2) 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("registerServer", true); out.write_string(_ob_a0); out.write_string(_ob_a1); out.write_string(_ob_a2); 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(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("registerServer", _ob_opsClass); if(_ob_so == null) continue; DomainOperations _ob_self = (DomainOperations)_ob_so.servant; try { _ob_self.registerServer(_ob_a0, _ob_a1, _ob_a2); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Domain/startup:1.0 // public ActiveState startup(String _ob_a0, String _ob_a1, org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_a2, org.apache.yoko.orb.OAD.ProcessEndpointManagerHolder _ob_ah3) throws NoSuchServer, NoSuchOAD, OADNotRunning { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("startup", true); out.write_string(_ob_a0); out.write_string(_ob_a1); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write(out, _ob_a2); in = _invoke(out); ActiveState _ob_r = ActiveStateHelper.read(in); _ob_ah3.value = org.apache.yoko.orb.OAD.ProcessEndpointManagerHelper.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); if(_ob_id.equals(NoSuchOADHelper.id())) throw NoSuchOADHelper.read(in); if(_ob_id.equals(OADNotRunningHelper.id())) throw OADNotRunningHelper.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("startup", _ob_opsClass); if(_ob_so == null) continue; DomainOperations _ob_self = (DomainOperations)_ob_so.servant; try { org.omg.CORBA.portable.OutputStream _ob_out = _orb().create_output_stream(); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write(_ob_out, _ob_a2); org.omg.CORBA.portable.InputStream _ob_in = _ob_out.create_input_stream(); _ob_a2 = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read(_ob_in); return _ob_self.startup(_ob_a0, _ob_a1, _ob_a2, _ob_ah3); } finally { _servant_postinvoke(_ob_so); } } } } }
6,642
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/ActiveStateOperations.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 ActiveStateOperations { // // IDL:orb.yoko.apache.org/IMR/ActiveState/set_status:1.0 // /** * * Called to update the server status * * @param id The server id * @param status The new server status * **/ void set_status(String id, ServerStatus status); // // IDL:orb.yoko.apache.org/IMR/ActiveState/poa_create:1.0 // /** * * Called when a POA is created * * @param state The POA state * @param poa_tmpl The POAs ORT * @return The IMRs ORT * * @exception org.apache.yoko.orb.IMR._NoSuchPOA If a record for the POA does not exist * **/ org.omg.PortableInterceptor.ObjectReferenceTemplate poa_create(POAStatus state, org.omg.PortableInterceptor.ObjectReferenceTemplate poa_tmpl) throws _NoSuchPOA; // // IDL:orb.yoko.apache.org/IMR/ActiveState/poa_status_update:1.0 // /** * * Called when POA Manager changes state. * * @param poas List of affected POAs * @param state The POA Manager state * **/ void poa_status_update(String[][] poas, POAStatus state); }
6,643
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/ServerNotRunning.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/ServerNotRunning:1.0 // /** * * A ServerNotRunning exception indicates that the Server detailed in the * member <code>host</code> isn't running. * **/ final public class ServerNotRunning extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/ServerNotRunning:1.0"; public ServerNotRunning() { super(_ob_id); } public ServerNotRunning(String name) { super(_ob_id); this.name = name; } public ServerNotRunning(String _reason, String name) { super(_ob_id + " " + _reason); this.name = name; } public String name; }
6,644
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/NoSuchServerHelper.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/NoSuchServer:1.0 // final public class NoSuchServerHelper { public static void insert(org.omg.CORBA.Any any, NoSuchServer val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static NoSuchServer 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(), "NoSuchServer", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/NoSuchServer:1.0"; } public static NoSuchServer 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); } NoSuchServer _ob_v = new NoSuchServer(); _ob_v.name = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, NoSuchServer val) { out.write_string(id()); out.write_string(val.name); } }
6,645
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/OADAlreadyExistsHolder.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/OADAlreadyExists:1.0 // final public class OADAlreadyExistsHolder implements org.omg.CORBA.portable.Streamable { public OADAlreadyExists value; public OADAlreadyExistsHolder() { } public OADAlreadyExistsHolder(OADAlreadyExists initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = OADAlreadyExistsHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { OADAlreadyExistsHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return OADAlreadyExistsHelper.type(); } }
6,646
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/_ServerDomainStub.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 class _ServerDomainStub extends org.omg.CORBA.portable.ObjectImpl implements ServerDomain { private static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/ServerDomain:1.0", "IDL:orb.yoko.apache.org/IMR/Domain:1.0" }; public String[] _ids() { return _ob_ids_; } final public static java.lang.Class _ob_opsClass = ServerDomainOperations.class; // // IDL:orb.yoko.apache.org/IMR/ServerDomain/get_server_factory:1.0 // public ServerFactory get_server_factory() { 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_factory", true); in = _invoke(out); ServerFactory _ob_r = ServerFactoryHelper.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("get_server_factory", _ob_opsClass); if(_ob_so == null) continue; ServerDomainOperations _ob_self = (ServerDomainOperations)_ob_so.servant; try { return _ob_self.get_server_factory(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ServerDomain/create_oad_record:1.0 // public void create_oad_record(String _ob_a0) throws OADAlreadyExists { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("create_oad_record", true); out.write_string(_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(OADAlreadyExistsHelper.id())) throw OADAlreadyExistsHelper.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_oad_record", _ob_opsClass); if(_ob_so == null) continue; ServerDomainOperations _ob_self = (ServerDomainOperations)_ob_so.servant; try { _ob_self.create_oad_record(_ob_a0); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ServerDomain/remove_oad_record:1.0 // public void remove_oad_record(String _ob_a0) throws NoSuchOAD, OADRunning { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("remove_oad_record", true); out.write_string(_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(NoSuchOADHelper.id())) throw NoSuchOADHelper.read(in); if(_ob_id.equals(OADRunningHelper.id())) throw OADRunningHelper.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_oad_record", _ob_opsClass); if(_ob_so == null) continue; ServerDomainOperations _ob_self = (ServerDomainOperations)_ob_so.servant; try { _ob_self.remove_oad_record(_ob_a0); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ServerDomain/get_oad_record:1.0 // public OADInfo get_oad_record(String _ob_a0) throws NoSuchOAD { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("get_oad_record", true); out.write_string(_ob_a0); in = _invoke(out); OADInfo _ob_r = OADInfoHelper.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(NoSuchOADHelper.id())) throw NoSuchOADHelper.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_oad_record", _ob_opsClass); if(_ob_so == null) continue; ServerDomainOperations _ob_self = (ServerDomainOperations)_ob_so.servant; try { return _ob_self.get_oad_record(_ob_a0); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/ServerDomain/list_oads:1.0 // public OADInfo[] list_oads() { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("list_oads", true); in = _invoke(out); OADInfo[] _ob_r = OADInfoSeqHelper.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_oads", _ob_opsClass); if(_ob_so == null) continue; ServerDomainOperations _ob_self = (ServerDomainOperations)_ob_so.servant; try { return _ob_self.list_oads(); } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Domain/registerServer:1.0 // public void registerServer(String _ob_a0, String _ob_a1, String _ob_a2) 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("registerServer", true); out.write_string(_ob_a0); out.write_string(_ob_a1); out.write_string(_ob_a2); 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(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("registerServer", _ob_opsClass); if(_ob_so == null) continue; ServerDomainOperations _ob_self = (ServerDomainOperations)_ob_so.servant; try { _ob_self.registerServer(_ob_a0, _ob_a1, _ob_a2); return; } finally { _servant_postinvoke(_ob_so); } } } } // // IDL:orb.yoko.apache.org/IMR/Domain/startup:1.0 // public ActiveState startup(String _ob_a0, String _ob_a1, org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_a2, org.apache.yoko.orb.OAD.ProcessEndpointManagerHolder _ob_ah3) throws NoSuchServer, NoSuchOAD, OADNotRunning { while(true) { if(!this._is_local()) { org.omg.CORBA.portable.OutputStream out = null; org.omg.CORBA.portable.InputStream in = null; try { out = _request("startup", true); out.write_string(_ob_a0); out.write_string(_ob_a1); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write(out, _ob_a2); in = _invoke(out); ActiveState _ob_r = ActiveStateHelper.read(in); _ob_ah3.value = org.apache.yoko.orb.OAD.ProcessEndpointManagerHelper.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); if(_ob_id.equals(NoSuchOADHelper.id())) throw NoSuchOADHelper.read(in); if(_ob_id.equals(OADNotRunningHelper.id())) throw OADNotRunningHelper.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("startup", _ob_opsClass); if(_ob_so == null) continue; ServerDomainOperations _ob_self = (ServerDomainOperations)_ob_so.servant; try { org.omg.CORBA.portable.OutputStream _ob_out = _orb().create_output_stream(); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.write(_ob_out, _ob_a2); org.omg.CORBA.portable.InputStream _ob_in = _ob_out.create_input_stream(); _ob_a2 = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read(_ob_in); return _ob_self.startup(_ob_a0, _ob_a1, _ob_a2, _ob_ah3); } finally { _servant_postinvoke(_ob_so); } } } } }
6,647
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/_NoSuchPOAHelper.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 // final public class _NoSuchPOAHelper { public static void insert(org.omg.CORBA.Any any, _NoSuchPOA val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static _NoSuchPOA 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 = "poa"; members[0].type = POANameHelper.type(); typeCode_ = orb.create_exception_tc(id(), "NoSuchPOA", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/NoSuchPOA:1.0"; } public static _NoSuchPOA 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); } _NoSuchPOA _ob_v = new _NoSuchPOA(); _ob_v.poa = POANameHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, _NoSuchPOA val) { out.write_string(id()); POANameHelper.write(out, val.poa); } }
6,648
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/_NoSuchPOAHolder.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 // final public class _NoSuchPOAHolder implements org.omg.CORBA.portable.Streamable { public _NoSuchPOA value; public _NoSuchPOAHolder() { } public _NoSuchPOAHolder(_NoSuchPOA initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = _NoSuchPOAHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { _NoSuchPOAHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return _NoSuchPOAHelper.type(); } }
6,649
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/ServerRunning.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/ServerRunning:1.0 // /** * * An ServerRunning exception indicates that the Server detailed in the * member <code>name</code> is active. * **/ final public class ServerRunning extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/ServerRunning:1.0"; public ServerRunning() { super(_ob_id); } public ServerRunning(String name) { super(_ob_id); this.name = name; } public ServerRunning(String _reason, String name) { super(_ob_id + " " + _reason); this.name = name; } public String name; }
6,650
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/NoSuchServerHolder.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/NoSuchServer:1.0 // final public class NoSuchServerHolder implements org.omg.CORBA.portable.Streamable { public NoSuchServer value; public NoSuchServerHolder() { } public NoSuchServerHolder(NoSuchServer initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = NoSuchServerHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { NoSuchServerHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return NoSuchServerHelper.type(); } }
6,651
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/OADAlreadyExistsHelper.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/OADAlreadyExists:1.0 // final public class OADAlreadyExistsHelper { public static void insert(org.omg.CORBA.Any any, OADAlreadyExists val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static OADAlreadyExists 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(), "OADAlreadyExists", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/OADAlreadyExists:1.0"; } public static OADAlreadyExists 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); } OADAlreadyExists _ob_v = new OADAlreadyExists(); _ob_v.name = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, OADAlreadyExists val) { out.write_string(id()); out.write_string(val.name); } }
6,652
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/OADRunningHolder.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/OADRunning:1.0 // final public class OADRunningHolder implements org.omg.CORBA.portable.Streamable { public OADRunning value; public OADRunningHolder() { } public OADRunningHolder(OADRunning initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = OADRunningHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { OADRunningHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return OADRunningHelper.type(); } }
6,653
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/ServerIDHelper.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/ServerID:1.0 // final public class ServerIDHelper { public static void insert(org.omg.CORBA.Any any, int val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static int 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(), "ServerID", orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_long)); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerID:1.0"; } public static int read(org.omg.CORBA.portable.InputStream in) { int _ob_v; _ob_v = in.read_long(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, int val) { out.write_long(val); } }
6,654
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/OADRunning.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/OADRunning:1.0 // /** * * An OADRunning exception indicates that the OAD detailed in the * member <code>name</code> is up. * **/ final public class OADRunning extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/OADRunning:1.0"; public OADRunning() { super(_ob_id); } public OADRunning(String name) { super(_ob_id); this.name = name; } public OADRunning(String _reason, String name) { super(_ob_id + " " + _reason); this.name = name; } public String name; }
6,655
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/ServerHolder.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 // final public class ServerHolder implements org.omg.CORBA.portable.Streamable { public Server value; public ServerHolder() { } public ServerHolder(Server initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerHelper.type(); } }
6,656
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/POAAlreadyRegistered.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 // /** * * A POAAlreadyRegistered exception indicates that the POA detailed in * the member <code>poa</code> doesn't exist in the server specified * in in the member <code>name</code>. * **/ final public class POAAlreadyRegistered extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/POAAlreadyRegistered:1.0"; public POAAlreadyRegistered() { super(_ob_id); } public POAAlreadyRegistered(String name, String[] poa) { super(_ob_id); this.name = name; this.poa = poa; } public POAAlreadyRegistered(String _reason, String name, String[] poa) { super(_ob_id + " " + _reason); this.name = name; this.poa = poa; } public String name; public String[] poa; }
6,657
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/ProcessIDHelper.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/ProcessID:1.0 // final public class ProcessIDHelper { public static void insert(org.omg.CORBA.Any any, int val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static int 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(), "ProcessID", orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong)); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ProcessID:1.0"; } public static int read(org.omg.CORBA.portable.InputStream in) { int _ob_v; _ob_v = in.read_ulong(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, int val) { out.write_ulong(val); } }
6,658
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/ServerHelper.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 // final public class ServerHelper { public static void insert(org.omg.CORBA.Any any, Server val) { any.insert_Object(val, type()); } public static Server extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_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, 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_interface_tc(id(), "Server"); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/Server:1.0"; } public static Server read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (Server)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _ServerStub _ob_stub = new _ServerStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, Server val) { out.write_Object(val); } public static Server narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Server)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _ServerStub _ob_stub = new _ServerStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType), org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return null; } public static Server unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Server)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ServerStub _ob_stub = new _ServerStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
6,659
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/ServerAlreadyRegistered.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/ServerAlreadyRegistered:1.0 // /** * * A ServerAlreadyRegistered exception indicates that the server * detailed in the member <code>name</code> already exists. **/ final public class ServerAlreadyRegistered extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/ServerAlreadyRegistered:1.0"; public ServerAlreadyRegistered() { super(_ob_id); } public ServerAlreadyRegistered(String name) { super(_ob_id); this.name = name; } public ServerAlreadyRegistered(String _reason, String name) { super(_ob_id + " " + _reason); this.name = name; } public String name; }
6,660
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/OADRunningHelper.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/OADRunning:1.0 // final public class OADRunningHelper { public static void insert(org.omg.CORBA.Any any, OADRunning val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static OADRunning 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(), "OADRunning", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/OADRunning:1.0"; } public static OADRunning 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); } OADRunning _ob_v = new OADRunning(); _ob_v.name = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, OADRunning val) { out.write_string(id()); out.write_string(val.name); } }
6,661
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/ServerOperations.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 ServerOperations { // // IDL:orb.yoko.apache.org/IMR/Server/id:1.0 // /** The server id. */ int id(); // // IDL:orb.yoko.apache.org/IMR/Server/status:1.0 // /** The server status. */ ServerStatus status(); // // IDL:orb.yoko.apache.org/IMR/Server/manual:1.0 // /** Was this process manually started? */ boolean manual(); // // IDL:orb.yoko.apache.org/IMR/Server/updateTime:1.0 // /** The last update time. */ int updateTime(); // // IDL:orb.yoko.apache.org/IMR/Server/timesForked:1.0 // /** The number of times restarted. */ short timesForked(); // // IDL:orb.yoko.apache.org/IMR/Server/name:1.0 // /** The server name. */ String name(); void name(String val); // // IDL:orb.yoko.apache.org/IMR/Server/host:1.0 // /** The server host. */ String host(); void host(String val); // // IDL:orb.yoko.apache.org/IMR/Server/exec:1.0 // /** The exec string for the server. */ String exec(); void exec(String val); // // IDL:orb.yoko.apache.org/IMR/Server/args:1.0 // /** The server's command-line arguments. */ String[] args(); void args(String[] val); // // IDL:orb.yoko.apache.org/IMR/Server/directory:1.0 // /** The server's runtime directory. */ String directory(); void directory(String val); // // IDL:orb.yoko.apache.org/IMR/Server/mode:1.0 // /** The server mode */ ServerActivationMode mode(); void mode(ServerActivationMode val); // // IDL:orb.yoko.apache.org/IMR/Server/updateTimeout:1.0 // /** The update timeout. */ int updateTimeout(); void updateTimeout(int val); // // IDL:orb.yoko.apache.org/IMR/Server/failureTimeout:1.0 // /** The failure timeout. */ int failureTimeout(); void failureTimeout(int val); // // IDL:orb.yoko.apache.org/IMR/Server/maxForks:1.0 // /** The maximum number of forks. */ short maxForks(); void maxForks(short val); // // IDL:orb.yoko.apache.org/IMR/Server/activatePOAs:1.0 // /** Allow implicit POA activation. */ boolean activatePOAs(); void activatePOAs(boolean val); // // IDL:orb.yoko.apache.org/IMR/Server/create_poa_record:1.0 // /** * * Create a POA record. * * @param poa The POA to create * **/ void create_poa_record(String[] poa) throws POAAlreadyRegistered; // // IDL:orb.yoko.apache.org/IMR/Server/remove_poa_record:1.0 // /** * * Remove a POA record. * * @param poa The POA to remove * **/ void remove_poa_record(String[] poa) throws _NoSuchPOA; // // IDL:orb.yoko.apache.org/IMR/Server/get_poa_info:1.0 // /** * * Retrieve POA info record. * * @param poa The POA name * * @return The POA info record. * **/ POAInfo get_poa_info(String[] poa) throws _NoSuchPOA; // // IDL:orb.yoko.apache.org/IMR/Server/list_poas:1.0 // /** * * List the poas. * * @return A sequence of poa names. * **/ POAInfo[] list_poas(); // // IDL:orb.yoko.apache.org/IMR/Server/clear_error_state:1.0 // /** * * Clear the servers error state * **/ void clear_error_state(); // // IDL:orb.yoko.apache.org/IMR/Server/start:1.0 // /** * * Start the server, if not running. * **/ void start() throws ServerRunning; // // IDL:orb.yoko.apache.org/IMR/Server/stop:1.0 // /** * * Stop the server, if running. * **/ void stop() throws OADNotRunning, ServerNotRunning; // // IDL:orb.yoko.apache.org/IMR/Server/destroy:1.0 // /** * * Destroy the server record. * **/ void destroy() throws ServerRunning; }
6,662
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/POAInfoHolder.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 // final public class POAInfoHolder implements org.omg.CORBA.portable.Streamable { public POAInfo value; public POAInfoHolder() { } public POAInfoHolder(POAInfo initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = POAInfoHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { POAInfoHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return POAInfoHelper.type(); } }
6,663
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/ServerRunningHelper.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/ServerRunning:1.0 // final public class ServerRunningHelper { public static void insert(org.omg.CORBA.Any any, ServerRunning val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ServerRunning 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(), "ServerRunning", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerRunning:1.0"; } public static ServerRunning 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); } ServerRunning _ob_v = new ServerRunning(); _ob_v.name = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ServerRunning val) { out.write_string(id()); out.write_string(val.name); } }
6,664
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/POANameSeqHelper.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/POANameSeq:1.0 // final public class POANameSeqHelper { public static void insert(org.omg.CORBA.Any any, String[][] val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static String[][] 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(), "POANameSeq", orb.create_sequence_tc(0, POANameHelper.type())); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/POANameSeq:1.0"; } public static String[][] read(org.omg.CORBA.portable.InputStream in) { String[][] _ob_v; int len0 = in.read_ulong(); _ob_v = new String[len0][]; for(int i0 = 0; i0 < len0; i0++) { _ob_v[i0] = POANameHelper.read(in); } return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, String[][] val) { int len0 = val.length; out.write_ulong(len0); for(int i0 = 0; i0 < len0; i0++) { POANameHelper.write(out, val[i0]); } } }
6,665
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/POANameHelper.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/POAName:1.0 // final public class POANameHelper { public static void insert(org.omg.CORBA.Any any, String[] val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static String[] 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(), "POAName", org.omg.CORBA.StringSeqHelper.type()); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/POAName:1.0"; } public static String[] read(org.omg.CORBA.portable.InputStream in) { String[] _ob_v; _ob_v = org.omg.CORBA.StringSeqHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, String[] val) { org.omg.CORBA.StringSeqHelper.write(out, val); } }
6,666
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/ActiveStateHelper.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 // final public class ActiveStateHelper { public static void insert(org.omg.CORBA.Any any, ActiveState val) { any.insert_Object(val, type()); } public static ActiveState extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_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, 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_interface_tc(id(), "ActiveState"); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ActiveState:1.0"; } public static ActiveState read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (ActiveState)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _ActiveStateStub _ob_stub = new _ActiveStateStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, ActiveState val) { out.write_Object(val); } public static ActiveState narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (ActiveState)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _ActiveStateStub _ob_stub = new _ActiveStateStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType), org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return null; } public static ActiveState unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (ActiveState)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ActiveStateStub _ob_stub = new _ActiveStateStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
6,667
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/ServerNotRunningHolder.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/ServerNotRunning:1.0 // final public class ServerNotRunningHolder implements org.omg.CORBA.portable.Streamable { public ServerNotRunning value; public ServerNotRunningHolder() { } public ServerNotRunningHolder(ServerNotRunning initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerNotRunningHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerNotRunningHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerNotRunningHelper.type(); } }
6,668
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/OADInfoHolder.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/OADInfo:1.0 // final public class OADInfoHolder implements org.omg.CORBA.portable.Streamable { public OADInfo value; public OADInfoHolder() { } public OADInfoHolder(OADInfo initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = OADInfoHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { OADInfoHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return OADInfoHelper.type(); } }
6,669
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/DomainHelper.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 // final public class DomainHelper { public static void insert(org.omg.CORBA.Any any, Domain val) { any.insert_Object(val, type()); } public static Domain extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_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, 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_interface_tc(id(), "Domain"); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/Domain:1.0"; } public static Domain read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (Domain)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _DomainStub _ob_stub = new _DomainStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, Domain val) { out.write_Object(val); } public static Domain narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Domain)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _DomainStub _ob_stub = new _DomainStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType), org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return null; } public static Domain unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (Domain)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _DomainStub _ob_stub = new _DomainStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
6,670
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/ServerDomainHelper.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 // final public class ServerDomainHelper { public static void insert(org.omg.CORBA.Any any, ServerDomain val) { any.insert_Object(val, type()); } public static ServerDomain extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_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, 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_interface_tc(id(), "ServerDomain"); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerDomain:1.0"; } public static ServerDomain read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (ServerDomain)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _ServerDomainStub _ob_stub = new _ServerDomainStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, ServerDomain val) { out.write_Object(val); } public static ServerDomain narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (ServerDomain)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _ServerDomainStub _ob_stub = new _ServerDomainStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType), org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return null; } public static ServerDomain unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (ServerDomain)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ServerDomainStub _ob_stub = new _ServerDomainStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
6,671
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/OADInfo.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/OADInfo:1.0 // /** Information on an OAD. */ final public class OADInfo implements org.omg.CORBA.portable.IDLEntity { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/OADInfo:1.0"; public OADInfo() { } public OADInfo(String host, boolean up) { this.host = host; this.up = up; } public String host; public boolean up; }
6,672
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/DomainHolder.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 // final public class DomainHolder implements org.omg.CORBA.portable.Streamable { public Domain value; public DomainHolder() { } public DomainHolder(Domain initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = DomainHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { DomainHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return DomainHelper.type(); } }
6,673
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/ServerDomainHolder.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 // final public class ServerDomainHolder implements org.omg.CORBA.portable.Streamable { public ServerDomain value; public ServerDomainHolder() { } public ServerDomainHolder(ServerDomain initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerDomainHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerDomainHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerDomainHelper.type(); } }
6,674
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/ServerActivationMode.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/ServerActivationMode:1.0 // /** * * This enumeration contains the various activation modes of a server. * **/ public class ServerActivationMode implements org.omg.CORBA.portable.IDLEntity { private static ServerActivationMode [] values_ = new ServerActivationMode[2]; private int value_; public final static int _SHARED = 0; public final static ServerActivationMode SHARED = new ServerActivationMode(_SHARED); public final static int _PERSISTENT = 1; public final static ServerActivationMode PERSISTENT = new ServerActivationMode(_PERSISTENT); protected ServerActivationMode(int value) { values_[value] = this; value_ = value; } public int value() { return value_; } public static ServerActivationMode from_int(int value) { if(value < values_.length) return values_[value]; else throw new org.omg.CORBA.BAD_PARAM("Value (" + value + ") out of range", 25, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private java.lang.Object readResolve() throws java.io.ObjectStreamException { return from_int(value()); } }
6,675
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/DomainPOA.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 abstract class DomainPOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, DomainOperations { static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/Domain:1.0", }; public Domain _this() { return DomainHelper.narrow(super._this_object()); } public Domain _this(org.omg.CORBA.ORB orb) { return DomainHelper.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 = { "registerServer", "startup" }; 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: // registerServer return _OB_op_registerServer(in, handler); case 1: // startup return _OB_op_startup(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_op_registerServer(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); String _ob_a1 = in.read_string(); String _ob_a2 = in.read_string(); registerServer(_ob_a0, _ob_a1, _ob_a2); out = handler.createReply(); } catch(ServerAlreadyRegistered _ob_ex) { out = handler.createExceptionReply(); ServerAlreadyRegisteredHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_startup(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); String _ob_a1 = in.read_string(); org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_a2 = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read(in); org.apache.yoko.orb.OAD.ProcessEndpointManagerHolder _ob_ah3 = new org.apache.yoko.orb.OAD.ProcessEndpointManagerHolder(); ActiveState _ob_r = startup(_ob_a0, _ob_a1, _ob_a2, _ob_ah3); out = handler.createReply(); ActiveStateHelper.write(out, _ob_r); org.apache.yoko.orb.OAD.ProcessEndpointManagerHelper.write(out, _ob_ah3.value); } catch(NoSuchServer _ob_ex) { out = handler.createExceptionReply(); NoSuchServerHelper.write(out, _ob_ex); } catch(NoSuchOAD _ob_ex) { out = handler.createExceptionReply(); NoSuchOADHelper.write(out, _ob_ex); } catch(OADNotRunning _ob_ex) { out = handler.createExceptionReply(); OADNotRunningHelper.write(out, _ob_ex); } return out; } }
6,676
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/ServerStatus.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/ServerStatus:1.0 // /** * * This enumeration contains the various states of a server. * **/ public class ServerStatus implements org.omg.CORBA.portable.IDLEntity { private static ServerStatus [] values_ = new ServerStatus[5]; private int value_; public final static int _FORKED = 0; public final static ServerStatus FORKED = new ServerStatus(_FORKED); public final static int _STARTING = 1; public final static ServerStatus STARTING = new ServerStatus(_STARTING); public final static int _RUNNING = 2; public final static ServerStatus RUNNING = new ServerStatus(_RUNNING); public final static int _STOPPING = 3; public final static ServerStatus STOPPING = new ServerStatus(_STOPPING); public final static int _STOPPED = 4; public final static ServerStatus STOPPED = new ServerStatus(_STOPPED); protected ServerStatus(int value) { values_[value] = this; value_ = value; } public int value() { return value_; } public static ServerStatus from_int(int value) { if(value < values_.length) return values_[value]; else throw new org.omg.CORBA.BAD_PARAM("Value (" + value + ") out of range", 25, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private java.lang.Object readResolve() throws java.io.ObjectStreamException { return from_int(value()); } }
6,677
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/ServerNotRunningHelper.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/ServerNotRunning:1.0 // final public class ServerNotRunningHelper { public static void insert(org.omg.CORBA.Any any, ServerNotRunning val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static ServerNotRunning 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(), "ServerNotRunning", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerNotRunning:1.0"; } public static ServerNotRunning 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); } ServerNotRunning _ob_v = new ServerNotRunning(); _ob_v.name = in.read_string(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, ServerNotRunning val) { out.write_string(id()); out.write_string(val.name); } }
6,678
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/OADInfoHelper.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/OADInfo:1.0 // final public class OADInfoHelper { 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(); org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[2]; members[0] = new org.omg.CORBA.StructMember(); members[0].name = "host"; members[0].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_string); members[1] = new org.omg.CORBA.StructMember(); members[1].name = "up"; members[1].type = orb.get_primitive_tc(org.omg.CORBA.TCKind.tk_boolean); typeCode_ = orb.create_struct_tc(id(), "OADInfo", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/OADInfo:1.0"; } public static OADInfo read(org.omg.CORBA.portable.InputStream in) { OADInfo _ob_v = new OADInfo(); _ob_v.host = in.read_string(); _ob_v.up = in.read_boolean(); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, OADInfo val) { out.write_string(val.host); out.write_boolean(val.up); } }
6,679
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/DomainOperations.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 DomainOperations { // // IDL:orb.yoko.apache.org/IMR/Domain/registerServer:1.0 // /** * * Called for automatic server registration * * @param name The server name * @param exec The server executable path * @param host The server host name * * @return Whether an entry already existed * **/ void registerServer(String name, String exec, String host) throws ServerAlreadyRegistered; // // IDL:orb.yoko.apache.org/IMR/Domain/startup:1.0 // /** * * Called to inform the IMR that the server has been started * * @param serverId The server id * @param instance The server instance * @param root_tmpl The RootPOA ORT * @param endpoint The ProcessControllerRegistrar for the process * **/ ActiveState startup(String serverId, String instance, org.omg.PortableInterceptor.ObjectReferenceTemplate root_tmpl, org.apache.yoko.orb.OAD.ProcessEndpointManagerHolder endpoint) throws NoSuchServer, NoSuchOAD, OADNotRunning; }
6,680
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/ActiveStateHolder.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 // final public class ActiveStateHolder implements org.omg.CORBA.portable.Streamable { public ActiveState value; public ActiveStateHolder() { } public ActiveStateHolder(ActiveState initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ActiveStateHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ActiveStateHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ActiveStateHelper.type(); } }
6,681
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/POAInfoHelper.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 // final public class POAInfoHelper { public static void insert(org.omg.CORBA.Any any, POAInfo val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static POAInfo 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 = "poa"; members[0].type = POANameHelper.type(); members[1] = new org.omg.CORBA.StructMember(); members[1].name = "state"; members[1].type = POAStatusHelper.type(); typeCode_ = orb.create_struct_tc(id(), "POAInfo", members); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/POAInfo:1.0"; } public static POAInfo read(org.omg.CORBA.portable.InputStream in) { POAInfo _ob_v = new POAInfo(); _ob_v.poa = POANameHelper.read(in); _ob_v.state = POAStatusHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, POAInfo val) { POANameHelper.write(out, val.poa); POAStatusHelper.write(out, val.state); } }
6,682
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/NoSuchOAD.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 // /** * * A NoSuchOAD exception indicates that the OAD detailed in the * member <code>name</code> doesn't exist. * **/ final public class NoSuchOAD extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/NoSuchOAD:1.0"; public NoSuchOAD() { super(_ob_id); } public NoSuchOAD(String name) { super(_ob_id); this.name = name; } public NoSuchOAD(String _reason, String name) { super(_ob_id + " " + _reason); this.name = name; } public String name; }
6,683
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/ServerRunningHolder.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/ServerRunning:1.0 // final public class ServerRunningHolder implements org.omg.CORBA.portable.Streamable { public ServerRunning value; public ServerRunningHolder() { } public ServerRunningHolder(ServerRunning initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerRunningHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerRunningHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerRunningHelper.type(); } }
6,684
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/POANameSeqHolder.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/POANameSeq:1.0 // final public class POANameSeqHolder implements org.omg.CORBA.portable.Streamable { public String[][] value; public POANameSeqHolder() { } public POANameSeqHolder(String[][] initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = POANameSeqHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { POANameSeqHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return POANameSeqHelper.type(); } }
6,685
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/OADNotRunning.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 // /** * * A OADNotRunning exception indicates that the OAD detailed in the * member <code>host</code> isn't up. * **/ final public class OADNotRunning extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/OADNotRunning:1.0"; public OADNotRunning() { super(_ob_id); } public OADNotRunning(String host) { super(_ob_id); this.host = host; } public OADNotRunning(String _reason, String host) { super(_ob_id + " " + _reason); this.host = host; } public String host; }
6,686
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/POAStatus.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 // /** * * This enumeration contains the various states of a server. * **/ public class POAStatus implements org.omg.CORBA.portable.IDLEntity { private static POAStatus [] values_ = new POAStatus[5]; private int value_; public final static int _INACTIVE = 0; public final static POAStatus INACTIVE = new POAStatus(_INACTIVE); public final static int _ACTIVE = 1; public final static POAStatus ACTIVE = new POAStatus(_ACTIVE); public final static int _HOLDING = 2; public final static POAStatus HOLDING = new POAStatus(_HOLDING); public final static int _DISCARDING = 3; public final static POAStatus DISCARDING = new POAStatus(_DISCARDING); public final static int _NON_EXISTENT = 4; public final static POAStatus NON_EXISTENT = new POAStatus(_NON_EXISTENT); protected POAStatus(int value) { values_[value] = this; value_ = value; } public int value() { return value_; } public static POAStatus from_int(int value) { if(value < values_.length) return values_[value]; else throw new org.omg.CORBA.BAD_PARAM("Value (" + value + ") out of range", 25, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } private java.lang.Object readResolve() throws java.io.ObjectStreamException { return from_int(value()); } }
6,687
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/ServerFactory.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 interface ServerFactory extends ServerFactoryOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity { }
6,688
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/ServerDomainPOA.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 abstract class ServerDomainPOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, ServerDomainOperations { static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/ServerDomain:1.0", "IDL:orb.yoko.apache.org/IMR/Domain:1.0" }; public ServerDomain _this() { return ServerDomainHelper.narrow(super._this_object()); } public ServerDomain _this(org.omg.CORBA.ORB orb) { return ServerDomainHelper.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 = { "create_oad_record", "get_oad_record", "get_server_factory", "list_oads", "registerServer", "remove_oad_record", "startup" }; 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: // create_oad_record return _OB_op_create_oad_record(in, handler); case 1: // get_oad_record return _OB_op_get_oad_record(in, handler); case 2: // get_server_factory return _OB_op_get_server_factory(in, handler); case 3: // list_oads return _OB_op_list_oads(in, handler); case 4: // registerServer return _OB_op_registerServer(in, handler); case 5: // remove_oad_record return _OB_op_remove_oad_record(in, handler); case 6: // startup return _OB_op_startup(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_op_create_oad_record(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); create_oad_record(_ob_a0); out = handler.createReply(); } catch(OADAlreadyExists _ob_ex) { out = handler.createExceptionReply(); OADAlreadyExistsHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_get_oad_record(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); OADInfo _ob_r = get_oad_record(_ob_a0); out = handler.createReply(); OADInfoHelper.write(out, _ob_r); } catch(NoSuchOAD _ob_ex) { out = handler.createExceptionReply(); NoSuchOADHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_get_server_factory(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; ServerFactory _ob_r = get_server_factory(); out = handler.createReply(); ServerFactoryHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_list_oads(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; OADInfo[] _ob_r = list_oads(); out = handler.createReply(); OADInfoSeqHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_registerServer(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); String _ob_a1 = in.read_string(); String _ob_a2 = in.read_string(); registerServer(_ob_a0, _ob_a1, _ob_a2); out = handler.createReply(); } catch(ServerAlreadyRegistered _ob_ex) { out = handler.createExceptionReply(); ServerAlreadyRegisteredHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_remove_oad_record(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); remove_oad_record(_ob_a0); out = handler.createReply(); } catch(NoSuchOAD _ob_ex) { out = handler.createExceptionReply(); NoSuchOADHelper.write(out, _ob_ex); } catch(OADRunning _ob_ex) { out = handler.createExceptionReply(); OADRunningHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_startup(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); String _ob_a1 = in.read_string(); org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_a2 = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read(in); org.apache.yoko.orb.OAD.ProcessEndpointManagerHolder _ob_ah3 = new org.apache.yoko.orb.OAD.ProcessEndpointManagerHolder(); ActiveState _ob_r = startup(_ob_a0, _ob_a1, _ob_a2, _ob_ah3); out = handler.createReply(); ActiveStateHelper.write(out, _ob_r); org.apache.yoko.orb.OAD.ProcessEndpointManagerHelper.write(out, _ob_ah3.value); } catch(NoSuchServer _ob_ex) { out = handler.createExceptionReply(); NoSuchServerHelper.write(out, _ob_ex); } catch(NoSuchOAD _ob_ex) { out = handler.createExceptionReply(); NoSuchOADHelper.write(out, _ob_ex); } catch(OADNotRunning _ob_ex) { out = handler.createExceptionReply(); OADNotRunningHelper.write(out, _ob_ex); } return out; } }
6,689
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/ServerDomain.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 ServerDomain extends ServerDomainOperations, Domain, org.omg.CORBA.portable.IDLEntity { }
6,690
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/ServerFactoryPOA.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 abstract class ServerFactoryPOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, ServerFactoryOperations { static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/ServerFactory:1.0", }; public ServerFactory _this() { return ServerFactoryHelper.narrow(super._this_object()); } public ServerFactory _this(org.omg.CORBA.ORB orb) { return ServerFactoryHelper.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 = { "create_server_record", "get_server", "list_orphaned_servers", "list_servers", "list_servers_by_host" }; 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: // create_server_record return _OB_op_create_server_record(in, handler); case 1: // get_server return _OB_op_get_server(in, handler); case 2: // list_orphaned_servers return _OB_op_list_orphaned_servers(in, handler); case 3: // list_servers return _OB_op_list_servers(in, handler); case 4: // list_servers_by_host return _OB_op_list_servers_by_host(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_op_create_server_record(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); Server _ob_r = create_server_record(_ob_a0); out = handler.createReply(); ServerHelper.write(out, _ob_r); } catch(ServerAlreadyRegistered _ob_ex) { out = handler.createExceptionReply(); ServerAlreadyRegisteredHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_get_server(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { String _ob_a0 = in.read_string(); Server _ob_r = get_server(_ob_a0); out = handler.createReply(); ServerHelper.write(out, _ob_r); } catch(NoSuchServer _ob_ex) { out = handler.createExceptionReply(); NoSuchServerHelper.write(out, _ob_ex); } return out; } private org.omg.CORBA.portable.OutputStream _OB_op_list_orphaned_servers(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; Server[] _ob_r = list_orphaned_servers(); out = handler.createReply(); ServerSeqHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_list_servers(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; Server[] _ob_r = list_servers(); out = handler.createReply(); ServerSeqHelper.write(out, _ob_r); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_list_servers_by_host(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; String _ob_a0 = in.read_string(); Server[] _ob_r = list_servers_by_host(_ob_a0); out = handler.createReply(); ServerSeqHelper.write(out, _ob_r); return out; } }
6,691
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/ServerFactoryOperations.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 interface ServerFactoryOperations { // // IDL:orb.yoko.apache.org/IMR/ServerFactory/get_server:1.0 // /** * * Retrieve a server record. * * @param server The server name * * @return The server record. * **/ Server get_server(String server) throws NoSuchServer; // // IDL:orb.yoko.apache.org/IMR/ServerFactory/create_server_record:1.0 // /** * * Create server record. * * @param server The server name * * @return The ID of the created server * **/ Server create_server_record(String server) throws ServerAlreadyRegistered; // // IDL:orb.yoko.apache.org/IMR/ServerFactory/list_servers:1.0 // /** * * List all the server records. * * @return A sequence of server records. * **/ Server[] list_servers(); // // IDL:orb.yoko.apache.org/IMR/ServerFactory/list_servers_by_host:1.0 // /** * * List the server records for a particular OAD/Host. * * @return A sequence of server records. * **/ Server[] list_servers_by_host(String host); // // IDL:orb.yoko.apache.org/IMR/ServerFactory/list_orphaned_servers:1.0 // /** * * List the orphaned server records. * * @return A sequence of server records. * **/ Server[] list_orphaned_servers(); }
6,692
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/POAInfoSeqHelper.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/POAInfoSeq:1.0 // final public class POAInfoSeqHelper { public static void insert(org.omg.CORBA.Any any, POAInfo[] val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static POAInfo[] 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(), "POAInfoSeq", orb.create_sequence_tc(0, POAInfoHelper.type())); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/POAInfoSeq:1.0"; } public static POAInfo[] read(org.omg.CORBA.portable.InputStream in) { POAInfo[] _ob_v; int len0 = in.read_ulong(); _ob_v = new POAInfo[len0]; for(int i0 = 0; i0 < len0; i0++) _ob_v[i0] = POAInfoHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, POAInfo[] val) { int len0 = val.length; out.write_ulong(len0); for(int i0 = 0; i0 < len0; i0++) POAInfoHelper.write(out, val[i0]); } }
6,693
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/ServerFactoryHolder.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 // final public class ServerFactoryHolder implements org.omg.CORBA.portable.Streamable { public ServerFactory value; public ServerFactoryHolder() { } public ServerFactoryHolder(ServerFactory initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = ServerFactoryHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { ServerFactoryHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return ServerFactoryHelper.type(); } }
6,694
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/ServerFactoryHelper.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 // final public class ServerFactoryHelper { public static void insert(org.omg.CORBA.Any any, ServerFactory val) { any.insert_Object(val, type()); } public static ServerFactory extract(org.omg.CORBA.Any any) { if(any.type().equivalent(type())) return narrow(any.extract_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, 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_interface_tc(id(), "ServerFactory"); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ServerFactory:1.0"; } public static ServerFactory read(org.omg.CORBA.portable.InputStream in) { org.omg.CORBA.Object _ob_v = in.read_Object(); try { return (ServerFactory)_ob_v; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ob_impl = (org.omg.CORBA.portable.ObjectImpl)_ob_v; _ServerFactoryStub _ob_stub = new _ServerFactoryStub(); _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } public static void write(org.omg.CORBA.portable.OutputStream out, ServerFactory val) { out.write_Object(val); } public static ServerFactory narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (ServerFactory)val; } catch(ClassCastException ex) { } if(val._is_a(id())) { org.omg.CORBA.portable.ObjectImpl _ob_impl; _ServerFactoryStub _ob_stub = new _ServerFactoryStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } throw new org.omg.CORBA.BAD_PARAM(org.apache.yoko.orb.OB.MinorCodes .describeBadParam(org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType), org.apache.yoko.orb.OB.MinorCodes.MinorIncompatibleObjectType, org.omg.CORBA.CompletionStatus.COMPLETED_NO); } return null; } public static ServerFactory unchecked_narrow(org.omg.CORBA.Object val) { if(val != null) { try { return (ServerFactory)val; } catch(ClassCastException ex) { } org.omg.CORBA.portable.ObjectImpl _ob_impl; _ServerFactoryStub _ob_stub = new _ServerFactoryStub(); _ob_impl = (org.omg.CORBA.portable.ObjectImpl)val; _ob_stub._set_delegate(_ob_impl._get_delegate()); return _ob_stub; } return null; } }
6,695
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/ActiveStatePOA.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 abstract class ActiveStatePOA extends org.omg.PortableServer.Servant implements org.omg.CORBA.portable.InvokeHandler, ActiveStateOperations { static final String[] _ob_ids_ = { "IDL:orb.yoko.apache.org/IMR/ActiveState:1.0", }; public ActiveState _this() { return ActiveStateHelper.narrow(super._this_object()); } public ActiveState _this(org.omg.CORBA.ORB orb) { return ActiveStateHelper.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 = { "poa_create", "poa_status_update", "set_status" }; 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: // poa_create return _OB_op_poa_create(in, handler); case 1: // poa_status_update return _OB_op_poa_status_update(in, handler); case 2: // set_status return _OB_op_set_status(in, handler); } throw new org.omg.CORBA.BAD_OPERATION(); } private org.omg.CORBA.portable.OutputStream _OB_op_poa_create(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; try { POAStatus _ob_a0 = POAStatusHelper.read(in); org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_a1 = org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.read(in); org.omg.PortableInterceptor.ObjectReferenceTemplate _ob_r = poa_create(_ob_a0, _ob_a1); out = handler.createReply(); org.omg.PortableInterceptor.ObjectReferenceTemplateHelper.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_poa_status_update(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; String[][] _ob_a0 = POANameSeqHelper.read(in); POAStatus _ob_a1 = POAStatusHelper.read(in); poa_status_update(_ob_a0, _ob_a1); out = handler.createReply(); return out; } private org.omg.CORBA.portable.OutputStream _OB_op_set_status(org.omg.CORBA.portable.InputStream in, org.omg.CORBA.portable.ResponseHandler handler) { org.omg.CORBA.portable.OutputStream out = null; String _ob_a0 = in.read_string(); ServerStatus _ob_a1 = ServerStatusHelper.read(in); set_status(_ob_a0, _ob_a1); out = handler.createReply(); return out; } }
6,696
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/POAInfoSeqHolder.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/POAInfoSeq:1.0 // final public class POAInfoSeqHolder implements org.omg.CORBA.portable.Streamable { public POAInfo[] value; public POAInfoSeqHolder() { } public POAInfoSeqHolder(POAInfo[] initial) { value = initial; } public void _read(org.omg.CORBA.portable.InputStream in) { value = POAInfoSeqHelper.read(in); } public void _write(org.omg.CORBA.portable.OutputStream out) { POAInfoSeqHelper.write(out, value); } public org.omg.CORBA.TypeCode _type() { return POAInfoSeqHelper.type(); } }
6,697
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/ArgListHelper.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/ArgList:1.0 // final public class ArgListHelper { public static void insert(org.omg.CORBA.Any any, String[] val) { org.omg.CORBA.portable.OutputStream out = any.create_output_stream(); write(out, val); any.read_value(out.create_input_stream(), type()); } public static String[] 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(), "ArgList", org.omg.CORBA.StringSeqHelper.type()); } return typeCode_; } public static String id() { return "IDL:orb.yoko.apache.org/IMR/ArgList:1.0"; } public static String[] read(org.omg.CORBA.portable.InputStream in) { String[] _ob_v; _ob_v = org.omg.CORBA.StringSeqHelper.read(in); return _ob_v; } public static void write(org.omg.CORBA.portable.OutputStream out, String[] val) { org.omg.CORBA.StringSeqHelper.write(out, val); } }
6,698
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/OADAlreadyExists.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/OADAlreadyExists:1.0 // /** * * An OADAlreadyExists exception indicates that the OAD record * detailed in the member <code>name</code> already exists. * **/ final public class OADAlreadyExists extends org.omg.CORBA.UserException { private static final String _ob_id = "IDL:orb.yoko.apache.org/IMR/OADAlreadyExists:1.0"; public OADAlreadyExists() { super(_ob_id); } public OADAlreadyExists(String name) { super(_ob_id); this.name = name; } public OADAlreadyExists(String _reason, String name) { super(_ob_id + " " + _reason); this.name = name; } public String name; }
6,699