Codota Logo
ClockType
Code IndexAdd Codota to your IDE (free)

How to use
ClockType
in
org.drools

Best Java code snippets using org.drools.ClockType (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public static ClockType resolveClockType( String id ) {
  if( PSEUDO_CLOCK.getId().equalsIgnoreCase( id ) ) {
    return PSEUDO_CLOCK;
  } else if( REALTIME_CLOCK.getId().equalsIgnoreCase( id ) ) {
    return REALTIME_CLOCK;
  }
  throw new IllegalArgumentException( "Illegal enum value '" + id + "' for ClockType" );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

public String getProperty(String name) {
  name = name.trim();
  if ( StringUtils.isEmpty( name ) ) {
    return null;
  }
  if ( name.equals( KeepReferenceOption.PROPERTY_NAME ) ) {
    return Boolean.toString( this.keepReference );
  } else if ( name.equals( ClockTypeOption.PROPERTY_NAME ) ) {
    return this.clockType.toExternalForm();
  } else if ( name.equals( TimerJobFactoryOption.PROPERTY_NAME ) ) {
    return this.timerJobFactoryType.toExternalForm();
  } else if ( name.equals( QueryListenerOption.PROPERTY_NAME ) ) {
    return this.queryListener.getAsString();
  }
  return null;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

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() ) ) );
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

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 );
  }
}
origin: org.drools/drools-spring

if (e != null && StringUtils.hasText(e.getAttribute("type"))) {
  rbaseConfBuilder.addPropertyValue("clockType",
      ClockType.resolveClockType(e.getAttribute("type")));
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

if (e != null && StringUtils.hasText(e.getAttribute("type"))) {
  rbaseConfBuilder.addPropertyValue("clockType",
      ClockType.resolveClockType(e.getAttribute("type")));
origin: org.switchyard.components/switchyard-component-common-rules

/**
 * Creates a new KnowledgeSessionConfiguration given the specified component implementation config.
 * @param cic the component implementation config
 * @return the config
 */
public static KnowledgeSessionConfiguration getSessionConfiguration(ComponentImplementationConfig cic) {
  KnowledgeSessionConfiguration ksessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(getProperties(cic));
  ClockType clock = cic.getModel().getClock();
  if (clock != null) {
    switch (clock) {
      case REALTIME:
        ksessionConfig.setOption(ClockTypeOption.get(org.drools.ClockType.REALTIME_CLOCK.getId()));
        break;
      case PSEUDO:
        ksessionConfig.setOption(ClockTypeOption.get(org.drools.ClockType.PSEUDO_CLOCK.getId()));
        break;
    }
  }
  return ksessionConfig;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

@SuppressWarnings("unchecked")
public <T extends SingleValueKnowledgeSessionOption> T getOption(Class<T> option) {
  if ( ClockTypeOption.class.equals( option ) ) {
    return (T) ClockTypeOption.get( getClockType().toExternalForm() );
  } else if ( KeepReferenceOption.class.equals( option ) ) {
    return (T) (this.keepReference ? KeepReferenceOption.YES : KeepReferenceOption.NO);
  } else if ( TimerJobFactoryOption.class.equals( option ) ) {
    return (T) TimerJobFactoryOption.get( getTimerJobFactoryType().toExternalForm() );
  } else if ( QueryListenerOption.class.equals( option ) ) {
    return (T) this.queryListener;
  }
  return null;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools

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;
  }
}
org.droolsClockType

Javadoc

This enum represents all engine supported clocks

Most used methods

  • getId
  • resolveClockType
  • toExternalForm

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now