private void modifyEndpointChannelProperties(CFEndPoint endPoint, Class<?> channelFactoryClass,
                                                 Map properties, boolean overwriteExisting)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "modifyEndpointChannelProperties",
                        new Object[]
                        {
                         endPoint,
                         channelFactoryClass,
                         properties,
                         "" + overwriteExisting
                        });

        // Romil libertry changes convert list to array
        OutboundChannelDefinition[] outboundChannelDefs = (OutboundChannelDefinition[]) endPoint.getOutboundChannelDefs().toArray();

        Class factoryClass = null;
        OutboundChannelDefinition existingChannelDef = null;
        int index = 0;
        boolean foundChannel = false;
        // Loop through each channel in the outbound chain represented by this endpoint
        for (index = 0; index < outboundChannelDefs.length; index++)
        {
            // Attempt to identify the channel factory we are interested in.
            existingChannelDef = outboundChannelDefs[index];
            factoryClass = outboundChannelDefs[index].getOutboundFactory();
            if (channelFactoryClass.isAssignableFrom(factoryClass))
            {
                foundChannel = true;
                break;
            }
        }

        if (foundChannel)
        {
            // Create a new OutboundChannelDefintion with new properties.
            OutboundChannelDefinition newChannelDef =
                            new JFapOutboundChannelDefinitionImpl(existingChannelDef,
                                            properties,
                                            overwriteExisting);

            // Overlay the new definition into the array managed by this endpoint. 
            outboundChannelDefs[index] = newChannelDef;
        }
        else
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "Did not find desired channel");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "modifyEndpointChannelProperties");
    }
private void modifyEndpointChannelProperties ( CFEndPoint endPoint , Class < ? > channelFactoryClass , Map properties , boolean overwriteExisting ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "modifyEndpointChannelProperties" , new Object [ ] { endPoint , channelFactoryClass , properties , "" + overwriteExisting } ) ; OutboundChannelDefinition [ ] outboundChannelDefs = ( OutboundChannelDefinition [ ] ) endPoint . getOutboundChannelDefs ( ) . toArray ( ) ; Class factoryClass = null ; OutboundChannelDefinition existingChannelDef = null ; int index = 0 ; boolean foundChannel = false ; for ( index = 0 ; index < outboundChannelDefs . length ; index ++ ) { existingChannelDef = outboundChannelDefs [ index ] ; factoryClass = outboundChannelDefs [ index ] . getOutboundFactory ( ) ; if ( channelFactoryClass . isAssignableFrom ( factoryClass ) ) { foundChannel = true ; break ; } } if ( foundChannel ) { OutboundChannelDefinition newChannelDef = new JFapOutboundChannelDefinitionImpl ( existingChannelDef , properties , overwriteExisting ) ; outboundChannelDefs [ index ] = newChannelDef ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Did not find desired channel" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "modifyEndpointChannelProperties" ) ; }
Modifies the properties associated with a specific channel in a channel framework endpoint.
This is a temporary work around until the Channel Framework implements similar functionality
itself. Most of the code for this method was taken from
com.ibm.ws.channel.framework.impl.CFEndPointImpl#getOutboundVCFactory(Map, boolean)

@param endPoint
The endpoint to modify
@param channelFactoryClass
The channel in the endpoint to modify
@param properties
The new properties to associate with the channel.
@param overwriteExisting
Should we overwrite existing properties?