Package org.openiaml.model.tests.CachedModelLoader

Examples of org.openiaml.model.tests.CachedModelLoader.IModelReloader


    })) {
     
      // try loading the file
      try {
        System.out.println("Loading " + modelFile + "...");
        IModelReloader reloader = new IModelReloader() {

          @Override
          public EObject reload() throws InferenceException,
              ModelLoadException {
            return ModelLoader.load(modelFile);
View Full Code Here


  public void test() throws Exception {
   
    for (int i = 0; i < 90000; i += 300) {
      final int i_copy = i;

      IModelReloader reloader = new IModelReloader() {
        @Override
        public EObject reload() throws InferenceException {
          try {
            InternetApplication root = (InternetApplication) DroolsPerformanceTest.this.reload();
            ICreateElementsFactory factory = CachedModelInferer.getInstance().createCreateElementsFactory();
            EcoreCreateElementsHelper handler = (EcoreCreateElementsHelper) factory.createHandler(root);
           
            // add the pages etc
            for (int j = 0; j < i_copy; j++) {
              Frame page = handler.createFrame(root);
              page.setName("test page " + j);
             
              /*
              Button button = (Button) handler.createElement(page, VisualPackage.eINSTANCE.getButton(), ModelPackage.eINSTANCE.getInternetApplication_Children());
              button.setName("test button " + j);
              */
             
              InputTextField text = (InputTextField) handler.createElement(page, VisualPackage.eINSTANCE.getInputTextField(), VisualPackage.eINSTANCE.getFrame_Children());
              text.setName("test field " + j);
             
            }
           
            return root;
          } catch (ModelLoadException e) {
            throw new InferenceException(e);
          }
        }
      };
     
      InternetApplication root = (InternetApplication) reloader.reload();
     
      infer(root, false, reloader);
    }
   
  }
View Full Code Here

      if (resource == null) {
        throw new IllegalArgumentException("EObject '" + root + "' has a null resource.");
      }
     
      ICreateElementsFactory handler = createCreateElementsFactory();
      CreateMissingElementsWithDrools ce = provider.getInferenceEngine(handler, false, new IModelReloader() {

        @Override
        public EObject reload() throws InferenceException {
          try {
            return loader.loadDirectly(loadClass, logRuleSource);
View Full Code Here

   * @throws FileNotFoundException
   */
  public InternetApplication loadAndInfer(IProvidesInferenceEngine provider,
      final String filename, boolean logRuleSource) throws ModelLoadException, FileNotFoundException, InferenceException, IOException {
    return infer(provider, (InternetApplication) loader.loadModelDirectly(filename), logRuleSource,
        new IModelReloader() {

          @Override
          public EObject reload() throws InferenceException {
            try {
              return loader.loadModelDirectly(filename);
View Full Code Here

   * @throws InferenceException
   * @throws FileNotFoundException
   */
  public InternetApplication loadAndInfer(IProvidesInferenceEngine provider, final String modelFile) throws ModelLoadException, FileNotFoundException, InferenceException, IOException {
    InternetApplication root = (InternetApplication) loader.loadModelDirectly(modelFile);
    return infer(provider, root, false, new IModelReloader() {

      @Override
      public EObject reload() throws InferenceException {
        try {
          return loader.loadModelDirectly(modelFile);
View Full Code Here

TOP

Related Classes of org.openiaml.model.tests.CachedModelLoader.IModelReloader

Copyright © 2018 www.massapicom. 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.