Examples of RuleStore


Examples of org.apache.log4j.joran.spi.RuleStore

    return getExecutionContext().getErrorList();
  }


  protected void selfInitialize(LoggerRepository repository) {
    RuleStore rs = new SimpleRuleStore(repository);
    rs.addRule(new Pattern("configuration"), new ConfigurationAction());
    rs.addRule(
      new Pattern("configuration/substitutionProperty"),
      new SubstitutionPropertyAction());
    rs.addRule(
      new Pattern("configuration/repositoryProperty"),
      new RepositoryPropertyAction());
    rs.addRule(
        new Pattern("configuration/conversionRule"),
        new ConversionRuleAction());
    rs.addRule(new Pattern("configuration/plugin"), new PluginAction());
    rs.addRule(new Pattern("configuration/logger"), new LoggerAction());
    rs.addRule(
      new Pattern("configuration/logger/level"), new LevelAction());
    rs.addRule(
      new Pattern("configuration/logger/priority"), new PriorityAction());
    rs.addRule(
      new Pattern("configuration/root"), new RootLoggerAction());
    rs.addRule(
      new Pattern("configuration/root/level"), new LevelAction());
    rs.addRule(
      new Pattern("configuration/root/priority"), new PriorityAction());
    rs.addRule(
      new Pattern("configuration/logger/appender-ref"),
      new AppenderRefAction());
    rs.addRule(
      new Pattern("configuration/root/appender-ref"),
      new AppenderRefAction());
    rs.addRule(
      new Pattern("configuration/appender"), new AppenderAction());
    rs.addRule(new Pattern("configuration/appender/appender-ref"),
        new AppenderRefAction());
    rs.addRule(
      new Pattern("configuration/appender/layout"), new LayoutAction());
    rs.addRule(
         new Pattern("configuration/jndiSubstitutionProperty"),
         new JndiSubstitutionPropertyAction());
    rs.addRule(
      new Pattern("configuration/newRule"), new NewRuleAction());
    rs.addRule(new Pattern("*/param"), new ParamAction());

    joranInterpreter = new Interpreter(rs);
    joranInterpreter.setLoggerRepository(repository);
   
    // The following line adds the capability to parse nested components
View Full Code Here

Examples of org.apache.log4j.joran.spi.RuleStore

*/
public class HelloWorld {
  public static void main(String[] args) throws Exception {
    // Create a simple rule store where pattern and action associations will
    // be kept.
    RuleStore ruleStore = new SimpleRuleStore();

    // Associate "hello-world" pattern with  HelloWorldAction
    ruleStore.addRule(new Pattern("hello-world"), new HelloWorldAction());

    // Create a new Joran Interpreter and hand it our simple rule store.
    Interpreter ji = new Interpreter(ruleStore);

    // Create a SAX parser
View Full Code Here

Examples of org.apache.log4j.joran.spi.RuleStore

    // Uncomment the following line in order to enable log statements generated
    // from joran itself.
   
    // org.apache.log4j.BasicConfigurator.configure();
   
    RuleStore ruleStore = new SimpleRuleStore();

    // we start with the rule for the top-most (root) element
    ruleStore.addRule(new Pattern("*/foo"), new NOPAction());


    // Create a new Joran Interpreter and hand it our simple rule store.
    Interpreter ji = new Interpreter(ruleStore);

View Full Code Here

Examples of org.apache.log4j.joran.spi.RuleStore

    // Uncomment the following line in order to enable log statements generated
    // from joran itself.
    // org.apache.log4j.BasicConfigurator.configure();
   
    // As usual, we create a simple rule store.
    RuleStore ruleStore = new SimpleRuleStore();

    // we start with the rule for the top-most (root) element
    ruleStore.addRule(new Pattern("*/computation"), new ComputationAction2());

    // Associate "/new-rule" pattern with NewRuleAction from the
    // org.apache.joran.action package.
    //
    // We will let the XML file to teach the Joran interpreter about new rules
    ruleStore.addRule(
      new Pattern("/computation/new-rule"), new NewRuleAction());

    // Create a new Joran Interpreter and hand it our simple rule store.
    Interpreter ji = new Interpreter(ruleStore);

View Full Code Here

Examples of org.apache.log4j.joran.spi.RuleStore

 
 
  public static void main(String[] args) throws Exception {
    // Create a simple rule store where pattern and action associations will
    // be kept. This is a basic requirement before invoking a Joran Interpreter.
    RuleStore ruleStore = new SimpleRuleStore();

    // Associate "/computation" pattern with  ComputationAction1
    ruleStore.addRule(new Pattern("/computation"), new ComputationAction1());

    // Other associations
    ruleStore.addRule(new Pattern("/computation/literal"), new LiteralAction());
    ruleStore.addRule(new Pattern("/computation/add"), new AddAction());
    ruleStore.addRule(new Pattern("/computation/multiply"), new MultiplyAction());
   
    // Create a new Joran Interpreter and hand it our simple rule store.
    Interpreter ji = new Interpreter(ruleStore);

    // Create a SAX parser
View Full Code Here

Examples of org.apache.log4j.joran.spi.RuleStore

* @author Ceki Güulcü
*/
public class Calculator2 {
  public static void main(String[] args) throws Exception {

    RuleStore ruleStore = new SimpleRuleStore();

    // Note the wild card character '*', in the paterns, signifying any level
    // of nesting.
    ruleStore.addRule(new Pattern("*/computation"), new ComputationAction2());

    ruleStore.addRule(new Pattern("*/computation/literal"), new LiteralAction());
    ruleStore.addRule(new Pattern("*/computation/add"), new AddAction());
    ruleStore.addRule(new Pattern("*/computation/multiply"), new MultiplyAction());
   
    // Create a new Joran Interpreter and hand it our simple rule store.
    Interpreter ji = new Interpreter(ruleStore);

    // Create a SAX parser
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleStore

        WeightedTcProvider wtcp = new SimpleTcProvider();
        TcManager tcm = new SpecialTcManager(qe, wtcp);

        Dictionary<String,Object> configuration = new Hashtable<String,Object>();
        RuleAdaptersFactory ruleAdaptersFactory = new RuleAdaptersFactoryImpl();
        RuleStore ruleStore = new ClerezzaRuleStore(configuration, tcm);
       
        ruleAdapter = new ClerezzaAdapter(configuration, ruleStore, ruleAdaptersFactory);
    }
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleStore

        mgr = OWLManager.createOWLOntologyManager();
        mgr.addIRIMapper(map1);

        ontology = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(ontologyStream);

        ruleStore = new RuleStore() {

            @Override
            public void setStore(OWLOntology owl) {
                // TODO Auto-generated method stub
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleStore

    public void testKReSLoadRuleFile() throws OWLOntologyStorageException {
        Dictionary<String,Object> configuration = new Hashtable<String,Object>();
        Dictionary<String,Object> configuration2 = new Hashtable<String,Object>();
        // configuration2.put(RuleStoreImpl.RULE_ONTOLOGY, "");
        configuration2.put(RuleStore.RULE_NAMESPACE, "http://kres.iks-project.eu/ontology/meta/rmi.owl#");
        RuleStore store = new RuleStoreImpl(configuration2,
                "./src/main/resources/RuleOntology/TestKReSOntologyRules.owl");
        RuleStore newstore = new RuleStoreImpl(configuration2, store.getOntology());
        // Load the example file
        LoadRuleFile load = new LoadRuleFile("./src/main/resources/RuleOntology/TestRuleFileExample.txt",
                store);
        OWLOntology result = load.getStore().getOntology();

        // //////////////////////////////////////////////////////////////////
        // Create ontology
        OWLOntologyManager owlmanager = OWLManager.createOWLOntologyManager();
        OWLOntology owlmodel = newstore.getOntology();
        OWLDataFactory factory = owlmanager.getOWLDataFactory();
        String ID = owlmodel.getOntologyID().toString().replace("<", "").replace(">", "") + "#";
       
        log.debug(ID);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.