public void setProperty(String name, String value) { name = name.trim(); if ( StringUtils.isEmpty( name ) ) { return; } if ( name.equals( KeepReferenceOption.PROPERTY_NAME ) ) { setKeepReference( StringUtils.isEmpty(value) || Boolean.parseBoolean(value) ); } else if ( name.equals( ClockTypeOption.PROPERTY_NAME ) ) { setClockType( ClockType.resolveClockType( StringUtils.isEmpty( value ) ? "realtime" : value ) ); } else if ( name.equals( TimerJobFactoryOption.PROPERTY_NAME ) ) { setTimerJobFactoryType(TimerJobFactoryType.resolveTimerJobFactoryType(StringUtils.isEmpty(value) ? "default" : value)); } else if ( name.equals( QueryListenerOption.PROPERTY_NAME ) ) { setQueryListenerClass( StringUtils.isEmpty( value ) ? QueryListenerOption.STANDARD.getAsString() : value ); } }
if (e != null && StringUtils.hasText(e.getAttribute("type"))) { rbaseConfBuilder.addPropertyValue("clockType", ClockType.resolveClockType(e.getAttribute("type")));
if (e != null && StringUtils.hasText(e.getAttribute("type"))) { rbaseConfBuilder.addPropertyValue("clockType", ClockType.resolveClockType(e.getAttribute("type")));
public <T extends KnowledgeSessionOption> void setOption(T option) { if ( option instanceof ClockTypeOption ) { setClockType( ClockType.resolveClockType( ((ClockTypeOption) option).getClockType() ) ); } else if ( option instanceof TimerJobFactoryOption ) { setTimerJobFactoryType(TimerJobFactoryType.resolveTimerJobFactoryType(((TimerJobFactoryOption) option).getTimerJobType())); } else if ( option instanceof KeepReferenceOption ) { setKeepReference(((KeepReferenceOption) option).isKeepReference()); } else if ( option instanceof WorkItemHandlerOption ) { getWorkItemHandlers().put( ((WorkItemHandlerOption) option).getName(), ((WorkItemHandlerOption) option).getHandler() ); } else if ( option instanceof QueryListenerOption ) { this.queryListener = (QueryListenerOption) option; } }
private void init(Properties properties, ClassLoader... classLoader) { this.classLoader = ClassLoaderUtil.getClassLoader( classLoader, getClass(), false ); this.immutable = false; this.chainedProperties = new ChainedProperties( "session.conf", this.classLoader ); if ( properties != null ) { this.chainedProperties.addProperties( properties ); } setKeepReference( Boolean.valueOf( this.chainedProperties.getProperty( KeepReferenceOption.PROPERTY_NAME, "true" ) ).booleanValue() ); setBeliefSystemType( BeliefSystemType.resolveBeliefSystemType( this.chainedProperties.getProperty( BeliefSystemTypeOption.PROPERTY_NAME, BeliefSystemType.SIMPLE.getId())) ); setClockType( ClockType.resolveClockType( this.chainedProperties.getProperty( ClockTypeOption.PROPERTY_NAME, ClockType.REALTIME_CLOCK.getId() ) ) ); setQueryListenerClass( this.chainedProperties.getProperty( QueryListenerOption.PROPERTY_NAME, QueryListenerOption.STANDARD.getAsString() ) ); setTimerJobFactoryType( TimerJobFactoryType.resolveTimerJobFactoryType( this.chainedProperties.getProperty( TimerJobFactoryOption.PROPERTY_NAME, TimerJobFactoryType.DEFUALT.getId() ) ) ); }