You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by ri...@apache.org on 2007/01/17 18:36:46 UTC

svn commit: r497118 - in /incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb: CORBA/ OB/ OBCORBA/ OBPortableServer/ OCI/ OCI/IIOP/ PortableInterceptor/

Author: rickmcguire
Date: Wed Jan 17 10:36:43 2007
New Revision: 497118

URL: http://svn.apache.org/viewvc?view=rev&rev=497118
Log:
YOKO-276 Add a Policy for controlling the zeroing of the IOR IIOP profile port for CSIv2 compliance.


Added:
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZERO_PORT_POLICY_ID.java   (with props)
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy.java   (with props)
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHelper.java   (with props)
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHolder.java   (with props)
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyOperations.java   (with props)
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyValue.java   (with props)
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy_impl.java   (with props)
Modified:
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/CORBA/ORBPolicyFactory_impl.java
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBCORBA/ORB_impl.java
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POAPolicies.java
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/AcceptorOperations.java
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java
    incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/IORInfo_impl.java

Modified: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/CORBA/ORBPolicyFactory_impl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/CORBA/ORBPolicyFactory_impl.java?view=diff&rev=497118&r1=497117&r2=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/CORBA/ORBPolicyFactory_impl.java (original)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/CORBA/ORBPolicyFactory_impl.java Wed Jan 17 10:36:43 2007
@@ -31,6 +31,10 @@
                 boolean b = any.extract_boolean();
                 return new org.apache.yoko.orb.OB.ConnectionReusePolicy_impl(b);
             }
+            case org.apache.yoko.orb.OB.ZERO_PORT_POLICY_ID.value: {
+                boolean b = any.extract_boolean();
+                return new org.apache.yoko.orb.OB.ZeroPortPolicy_impl(b);
+            }
 
             case org.apache.yoko.orb.OB.PROTOCOL_POLICY_ID.value: {
                 String[] seq = org.apache.yoko.orb.OCI.PluginIdSeqHelper

Added: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZERO_PORT_POLICY_ID.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZERO_PORT_POLICY_ID.java?view=auto&rev=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZERO_PORT_POLICY_ID.java (added)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZERO_PORT_POLICY_ID.java Wed Jan 17 10:36:43 2007
@@ -0,0 +1,33 @@
+/*
+ *  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.OB;
+
+//
+// IDL:orb.yoko.apache.org/OB/ZERO_PORT_POLICY_ID:1.0
+//
+/**
+ *
+ * This policy type identifies the zero port policy.
+ *
+ **/
+
+public interface ZERO_PORT_POLICY_ID
+{
+    int value = (int)(1330577419L);
+}
+

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZERO_PORT_POLICY_ID.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZERO_PORT_POLICY_ID.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZERO_PORT_POLICY_ID.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy.java?view=auto&rev=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy.java (added)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy.java Wed Jan 17 10:36:43 2007
@@ -0,0 +1,34 @@
+/*
+ *  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.OB;
+
+//
+// IDL:orb.yoko.apache.org/OB/ZeroPortPolicy:1.0
+//
+/**
+ *
+ * The zero port policy. This policy determines whether
+ * object IORs will have a zero port number in the IIOP profile. 
+ *
+ **/
+
+public interface ZeroPortPolicy extends ZeroPortPolicyOperations,
+                                               org.omg.CORBA.Policy
+{
+}
+

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHelper.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHelper.java?view=auto&rev=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHelper.java (added)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHelper.java Wed Jan 17 10:36:43 2007
@@ -0,0 +1,86 @@
+/*
+ *  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.OB;
+
+//
+// IDL:orb.yoko.apache.org/OB/ZeroPortPolicy:1.0
+//
+final public class ZeroPortPolicyHelper
+{
+    public static void
+    insert(org.omg.CORBA.Any any, ZeroPortPolicy val)
+    {
+        any.insert_Object(val, type());
+    }
+
+    public static ZeroPortPolicy
+    extract(org.omg.CORBA.Any any)
+    {
+        if(any.type().equivalent(type()))
+            return narrow(any.extract_Object());
+
+        throw new org.omg.CORBA.BAD_OPERATION();
+    }
+
+    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(), "ZeroPortPolicy");
+        }
+
+        return typeCode_;
+    }
+
+    public static String
+    id()
+    {
+        return "IDL:orb.yoko.apache.org/OB/ZeroPortPolicy:1.0";
+    }
+
+    public static ZeroPortPolicy
+    read(org.omg.CORBA.portable.InputStream in)
+    {
+        throw new org.omg.CORBA.MARSHAL();
+    }
+
+    public static void
+    write(org.omg.CORBA.portable.OutputStream out, ZeroPortPolicy val)
+    {
+        throw new org.omg.CORBA.MARSHAL();
+    }
+
+    public static ZeroPortPolicy
+    narrow(org.omg.CORBA.Object val)
+    {
+        try
+        {
+            return (ZeroPortPolicy)val;
+        }
+        catch(ClassCastException ex)
+        {
+        }
+
+        throw new org.omg.CORBA.BAD_PARAM();
+    }
+}
+

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHelper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHelper.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHelper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHolder.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHolder.java?view=auto&rev=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHolder.java (added)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHolder.java Wed Jan 17 10:36:43 2007
@@ -0,0 +1,56 @@
+/*
+ *  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.OB;
+
+//
+// IDL:orb.yoko.apache.org/OB/ZeroPortPolicy:1.0
+//
+final public class ZeroPortPolicyHolder implements org.omg.CORBA.portable.Streamable
+{
+    public ZeroPortPolicy value;
+
+    public
+    ZeroPortPolicyHolder()
+    {
+    }
+
+    public
+    ZeroPortPolicyHolder(ZeroPortPolicy initial)
+    {
+        value = initial;
+    }
+
+    public void
+    _read(org.omg.CORBA.portable.InputStream in)
+    {
+        value = ZeroPortPolicyHelper.read(in);
+    }
+
+    public void
+    _write(org.omg.CORBA.portable.OutputStream out)
+    {
+        ZeroPortPolicyHelper.write(out, value);
+    }
+
+    public org.omg.CORBA.TypeCode
+    _type()
+    {
+        return ZeroPortPolicyHelper.type();
+    }
+}
+

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHolder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHolder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyHolder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyOperations.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyOperations.java?view=auto&rev=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyOperations.java (added)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyOperations.java Wed Jan 17 10:36:43 2007
@@ -0,0 +1,45 @@
+/*
+ *  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.OB;
+
+//
+// IDL:orb.yoko.apache.org/OB/ZeroPortPolicy:1.0
+//
+/**
+ *
+ * The connection reuse policy. This policy determines whether
+ * connections may be reused or are private to specific objects.
+ *
+ **/
+
+public interface ZeroPortPolicyOperations extends org.omg.CORBA.PolicyOperations
+{
+    //
+    // IDL:orb.yoko.apache.org/OB/ZeroPortPolicy/value:1.0
+    //
+    /**
+     *
+     * If an object has a <code>ZeroPortPolicy</code> set with
+     * <code>value</code> set to <code>TRUE</code>, then the IOR 
+     * will have a zero value encoded in the IIOP profile.            
+     *
+     **/
+
+    boolean value();
+}
+

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyOperations.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyOperations.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyOperations.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyValue.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyValue.java?view=auto&rev=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyValue.java (added)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyValue.java Wed Jan 17 10:36:43 2007
@@ -0,0 +1,64 @@
+/*
+ *  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.OB;
+
+//
+// IDL:orb.yoko.apache.org/OB/ZeroPortPolicyValue:1.0
+//
+/***/
+
+public class ZeroPortPolicyValue implements org.omg.CORBA.portable.IDLEntity
+{
+    private boolean value_;
+
+    public final static boolean _ZERO_PORT = true;
+    public final static ZeroPortPolicyValue ZERO_PORT = new ZeroPortPolicyValue(_ZERO_PORT);
+    public final static boolean _NONZERO_PORT = false;
+    public final static ZeroPortPolicyValue NONZERO_PORT = new ZeroPortPolicyValue(_NONZERO_PORT);
+
+    protected
+    ZeroPortPolicyValue(boolean value)
+    {
+        value_ = value;
+    }
+
+    public boolean
+    value()
+    {
+        return value_;
+    }
+
+    public static ZeroPortPolicyValue
+    from_boolean(boolean value)
+    {
+        if (value) {
+            return ZERO_PORT; 
+        }
+        else {
+            return NONZERO_PORT; 
+        }
+    }
+
+    private java.lang.Object
+    readResolve()
+        throws java.io.ObjectStreamException
+    {
+        return from_boolean(value());
+    }
+}
+

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyValue.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyValue.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicyValue.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy_impl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy_impl.java?view=auto&rev=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy_impl.java (added)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy_impl.java Wed Jan 17 10:36:43 2007
@@ -0,0 +1,50 @@
+/*
+ *  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.OB;
+
+import org.apache.yoko.orb.OB.ZERO_PORT_POLICY_ID;
+import org.apache.yoko.orb.OB.ZeroPortPolicy;
+
+final public class ZeroPortPolicy_impl extends org.omg.CORBA.LocalObject
+        implements ZeroPortPolicy {
+    private boolean value_;
+
+    // ------------------------------------------------------------------
+    // Standard IDL to Java Mapping
+    // ------------------------------------------------------------------
+
+    public boolean value() {
+        return value_;
+    }
+
+    public int policy_type() {
+        return ZERO_PORT_POLICY_ID.value;
+    }
+
+    public org.omg.CORBA.Policy copy() {
+        return this;
+    }
+
+    public void destroy() {
+    }
+
+    public ZeroPortPolicy_impl(boolean r) {
+        value_ = r;
+    }
+}
+

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy_impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy_impl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OB/ZeroPortPolicy_impl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBCORBA/ORB_impl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBCORBA/ORB_impl.java?view=diff&rev=497118&r1=497117&r2=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBCORBA/ORB_impl.java (original)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBCORBA/ORB_impl.java Wed Jan 17 10:36:43 2007
@@ -478,6 +478,23 @@
                 org.apache.yoko.orb.OB.ConnectionReusePolicy_impl p = new org.apache.yoko.orb.OB.ConnectionReusePolicy_impl(
                         b);
                 policies_.addElement(p);
+            } else if (key.equals("yoko.orb.policy.zero_port")) {
+                boolean b;
+                if (value.equals("true"))
+                    b = true;
+                else if (value.equals("false"))
+                    b = false;
+                else {
+                    String err = "ORB.init: invalid value for "
+                            + "yoko.orb.policy.zero_port: `" + value
+                            + "'";
+                    logger.error(err);
+                    throw new org.omg.CORBA.INITIALIZE(err);
+                }
+
+                org.apache.yoko.orb.OB.ZeroPortPolicy_impl p = new org.apache.yoko.orb.OB.ZeroPortPolicy_impl(
+                        b);
+                policies_.addElement(p);
             } else if (key.equals("yoko.orb.policy.retry")
                     || key.equals("yoko.orb.policy.retry.max")
                     || key.equals("yoko.orb.policy.retry.interval")
@@ -692,6 +709,9 @@
         org.omg.PortableInterceptor.PolicyFactory factory = new org.apache.yoko.orb.CORBA.ORBPolicyFactory_impl();
         pfm.registerPolicyFactory(
                 org.apache.yoko.orb.OB.CONNECTION_REUSE_POLICY_ID.value,
+                factory, true);
+        pfm.registerPolicyFactory(
+                org.apache.yoko.orb.OB.ZERO_PORT_POLICY_ID.value,
                 factory, true);
         pfm.registerPolicyFactory(
                 org.apache.yoko.orb.OB.PROTOCOL_POLICY_ID.value, factory, true);

Modified: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POAPolicies.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POAPolicies.java?view=diff&rev=497118&r1=497117&r2=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POAPolicies.java (original)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POAPolicies.java Wed Jan 17 10:36:43 2007
@@ -33,6 +33,10 @@
 import org.apache.yoko.orb.OBPortableServer.SynchronizationPolicy;
 import org.apache.yoko.orb.OBPortableServer.SynchronizationPolicyHelper;
 import org.apache.yoko.orb.OBPortableServer.SynchronizationPolicyValue;
+import org.apache.yoko.orb.OB.ZERO_PORT_POLICY_ID;
+import org.apache.yoko.orb.OB.ZeroPortPolicy;
+import org.apache.yoko.orb.OB.ZeroPortPolicyHelper;
+import org.apache.yoko.orb.OB.ZeroPortPolicyValue;
 
 final public class POAPolicies {
     private boolean interceptorCallPolicyValue_;
@@ -40,6 +44,8 @@
     private SynchronizationPolicyValue synchronizationPolicyValue_;
 
     private org.apache.yoko.orb.OB.DispatchStrategy dispatchStrategyPolicyValue_;
+    
+    private boolean zeroPortPolicyValue_;
 
     private org.omg.PortableServer.LifespanPolicyValue lifespanPolicyValue_;
 
@@ -62,6 +68,7 @@
         //
         interceptorCallPolicyValue_ = true;
         synchronizationPolicyValue_ = SynchronizationPolicyValue.NO_SYNCHRONIZATION;
+        zeroPortPolicyValue_ = false;
         lifespanPolicyValue_ = org.omg.PortableServer.LifespanPolicyValue.TRANSIENT;
         idUniquenessPolicyValue_ = org.omg.PortableServer.IdUniquenessPolicyValue.UNIQUE_ID;
         idAssignmentPolicyValue_ = org.omg.PortableServer.IdAssignmentPolicyValue.SYSTEM_ID;
@@ -123,6 +130,10 @@
                 InterceptorCallPolicy policy = InterceptorCallPolicyHelper
                         .narrow(policies[i]);
                 interceptorCallPolicyValue_ = policy.value();
+            } else if (policyType == ZERO_PORT_POLICY_ID.value) {
+                ZeroPortPolicy policy = ZeroPortPolicyHelper
+                        .narrow(policies[i]);
+                zeroPortPolicyValue_ = policy.value();
             }
 
             //
@@ -140,6 +151,10 @@
 
     public boolean interceptorCallPolicy() {
         return interceptorCallPolicyValue_;
+    }
+
+    public boolean zeroPortPolicy() {
+        return zeroPortPolicyValue_;
     }
 
     public SynchronizationPolicyValue synchronizationPolicy() {

Modified: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java?view=diff&rev=497118&r1=497117&r2=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java (original)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OBPortableServer/POA_impl.java Wed Jan 17 10:36:43 2007
@@ -404,7 +404,7 @@
         // Create the IORInfo for this POA
         //
         org.apache.yoko.orb.PortableInterceptor.IORInfo_impl iorInfoImpl = new org.apache.yoko.orb.PortableInterceptor.IORInfo_impl(
-                orbInstance_, acceptors, rawPolicies_, m._OB_getAdapterManagerId(), m
+                orbInstance_, acceptors, rawPolicies_, policies_, m._OB_getAdapterManagerId(), m
                         ._OB_getAdapterState());
         iorInfo_ = iorInfoImpl;
 

Modified: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/AcceptorOperations.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/AcceptorOperations.java?view=diff&rev=497118&r1=497117&r2=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/AcceptorOperations.java (original)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/AcceptorOperations.java Wed Jan 17 10:36:43 2007
@@ -168,7 +168,7 @@
      **/
 
     void
-    add_profiles(ProfileInfo profile_info,
+    add_profiles(ProfileInfo profile_info, org.apache.yoko.orb.OBPortableServer.POAPolicies policies, 
                  org.omg.IOP.IORHolder ref);
 
     //

Modified: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java?view=diff&rev=497118&r1=497117&r2=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java (original)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/OCI/IIOP/Acceptor_impl.java Wed Jan 17 10:36:43 2007
@@ -241,6 +241,7 @@
     }
 
     public void add_profiles(org.apache.yoko.orb.OCI.ProfileInfo profileInfo,
+            org.apache.yoko.orb.OBPortableServer.POAPolicies policies, 
             org.omg.IOP.IORHolder ior) {
         if (port_ == 0)
             throw new RuntimeException();
@@ -269,10 +270,16 @@
                 body.iiop_version = new org.omg.IIOP.Version(profileInfo.major,
                         profileInfo.minor);
                 body.host = hosts_[i];
-                if (port_ >= 0x8000)
-                    body.port = (short) (port_ - 0xffff - 1);
-                else
-                    body.port = (short) port_;
+                // the CSIv2 policy may require zeroing the port in the IOR. 
+                if (policies.zeroPortPolicy()) {
+                    body.port = 0; 
+                }
+                else {
+                    if (port_ >= 0x8000)
+                        body.port = (short) (port_ - 0xffff - 1);
+                    else
+                        body.port = (short) port_;
+                }
                 body.object_key = profileInfo.key;
 
                 int len = ior.value.profiles.length + 1;
@@ -303,10 +310,16 @@
                     body.iiop_version = new org.omg.IIOP.Version(
                             profileInfo.major, profileInfo.minor);
                     body.host = hosts_[i];
-                    if (port_ >= 0x8000)
-                        body.port = (short) (port_ - 0xffff - 1);
-                    else
-                        body.port = (short) port_;
+                    // the CSIv2 policy may require zeroing the port in the IOR. 
+                    if (policies.zeroPortPolicy()) {
+                        body.port = 0; 
+                    }
+                    else {
+                        if (port_ >= 0x8000)
+                            body.port = (short) (port_ - 0xffff - 1);
+                        else
+                            body.port = (short) port_;
+                    }
                     body.object_key = profileInfo.key;
                     body.components = new org.omg.IOP.TaggedComponent[components
                             .size()];
@@ -339,10 +352,15 @@
                 body.iiop_version = new org.omg.IIOP.Version(profileInfo.major,
                         profileInfo.minor);
                 body.host = hosts_[0];
-                if (port_ >= 0x8000)
-                    body.port = (short) (port_ - 0xffff - 1);
-                else
-                    body.port = (short) port_;
+                if (policies.zeroPortPolicy()) {
+                    body.port = 0; 
+                }
+                else {
+                    if (port_ >= 0x8000)
+                        body.port = (short) (port_ - 0xffff - 1);
+                    else
+                        body.port = (short) port_;
+                }
                 body.object_key = profileInfo.key;
 
                 for (int i = 1; i < hosts_.length; i++) {

Modified: incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/IORInfo_impl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/IORInfo_impl.java?view=diff&rev=497118&r1=497117&r2=497118
==============================================================================
--- incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/IORInfo_impl.java (original)
+++ incubator/yoko/trunk/core/src/main/java/org/apache/yoko/orb/PortableInterceptor/IORInfo_impl.java Wed Jan 17 10:36:43 2007
@@ -16,6 +16,8 @@
  */
 
 package org.apache.yoko.orb.PortableInterceptor;
+ 
+import org.apache.yoko.orb.OBPortableServer.POAPolicies; 
 
 final public class IORInfo_impl extends org.omg.CORBA.LocalObject implements
         org.omg.PortableInterceptor.IORInfo {
@@ -26,6 +28,8 @@
     private java.util.Vector all_;
 
     private org.omg.CORBA.Policy[] policies_;
+    
+    private org.apache.yoko.orb.OBPortableServer.POAPolicies poaPolicies_; 
 
     private org.omg.PortableInterceptor.ObjectReferenceTemplate adapterTemplate_;
 
@@ -42,13 +46,14 @@
 
     public IORInfo_impl(org.apache.yoko.orb.OB.ORBInstance orbInstance,
             org.apache.yoko.orb.OCI.Acceptor[] acceptors,
-            org.omg.CORBA.Policy[] policies, String id, short state) {
+            org.omg.CORBA.Policy[] policies, POAPolicies poaPolicies, String id, short state) {
         table_ = new java.util.Hashtable();
         all_ = new java.util.Vector();
 
         orbInstance_ = orbInstance;
         acceptors_ = acceptors;
         policies_ = policies;
+        poaPolicies_ = poaPolicies; 
         id_ = id;
         state_ = state;
 
@@ -171,7 +176,7 @@
                             .elementAt(j);
             }
 
-            acceptors_[i].add_profiles(profileInfo, ior);
+            acceptors_[i].add_profiles(profileInfo, poaPolicies_, ior);
         }
     }
 }