static private StringBuilder serializeChannel ( StringBuilder buffer , OutboundChannelDefinition ocd , int order ) throws NotSerializableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Serializing channel: " + order + " " + ocd . getOutboundFactory ( ) . getName ( ) ) ; } buffer . append ( " <channel order=\"" ) ; buffer . append ( order ) ; buffer . append ( "\" factory=\"" ) ; buffer . append ( ocd . getOutboundFactory ( ) . getName ( ) ) ; buffer . append ( "\">\n" ) ; Map < Object , Object > props = ocd . getOutboundChannelProperties ( ) ; if ( null != props ) { for ( Entry < Object , Object > entry : props . entrySet ( ) ) { if ( null == entry . getValue ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Property value [" + entry . getKey ( ) + "] is null, " + ocd . toString ( ) ) ; } throw new NotSerializableException ( "Property value for [" + entry . getKey ( ) + "] is null" ) ; } // TODO should pass around the one big stringbuffer instead // of creating all these intermediate ones StringBuilder kBuff = determineType ( "key" , entry . getKey ( ) ) ; if ( null != kBuff ) { StringBuilder vBuff = determineType ( "value" , entry . getValue ( ) ) ; if ( null != vBuff ) { buffer . append ( " <property " ) ; buffer . append ( kBuff ) ; buffer . append ( " " ) ; buffer . append ( vBuff ) ; buffer . append ( "/>\n" ) ; } } } } buffer . append ( " </channel>\n" ) ; return buffer ; }
Method to serialize a given channel object into the overall output buffer .