private static void loadStrategiesIndex(MarshallerReaderContext context, ProtobufMessages.Header _header) throws IOException, ClassNotFoundException { for ( ProtobufMessages.Header.StrategyIndex _entry : _header.getStrategyList() ) { ObjectMarshallingStrategy strategyObject = context.resolverStrategyFactory.getStrategyObject( _entry.getName() ); if ( strategyObject == null ) { throw new IllegalStateException( "No strategy of type " + _entry.getName() + " available." ); } context.usedStrategies.put( _entry.getId(), strategyObject ); Context ctx = strategyObject.createContext(); context.strategyContexts.put( strategyObject, ctx ); if( _entry.hasData() && ctx != null ) { ClassLoader classLoader = null; if (context.classLoader != null ){ classLoader = context.classLoader; } else if(context.ruleBase != null){ classLoader = context.ruleBase.getRootClassLoader(); } ctx.read( new DroolsObjectInputStream( _entry.getData().newInput(), classLoader) ); } } }
public Builder mergeFrom(org.drools.marshalling.impl.ProtobufMessages.Header.StrategyIndex other) { if (other == org.drools.marshalling.impl.ProtobufMessages.Header.StrategyIndex.getDefaultInstance()) return this; if (other.hasId()) { setId(other.getId()); } if (other.hasName()) { bitField0_ |= 0x00000002; name_ = other.name_; onChanged(); } if (other.hasData()) { setData(other.getData()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>optional bytes data = 3;</code> */ public Builder clearData() { bitField0_ = (bitField0_ & ~0x00000004); data_ = getDefaultInstance().getData(); onChanged(); return this; }