}
private static void writeStrategiesIndex(MarshallerWriteContext context,
ProtobufMessages.Header.Builder _header) throws IOException {
for( Entry<ObjectMarshallingStrategy,Integer> entry : context.usedStrategies.entrySet() ) {
Builder _strat = ProtobufMessages.Header.StrategyIndex.newBuilder()
.setId( entry.getValue().intValue() )
.setName( entry.getKey().getClass().getName() );
Context ctx = context.strategyContext.get( entry.getKey() );
if( ctx != null ) {
Output os = ByteString.newOutput();
ctx.write( new DroolsObjectOutputStream( os ) );
_strat.setData( os.toByteString() );
os.close();
}
_header.addStrategy( _strat.build() );
}
}