private IConfiguration DataConfiguration(CustomReflector reflector)
        {
            var config = Db4oFactory.NewConfiguration();

            config.ReflectWith(reflector);
            ConfigureCustomClasses(config, reflector);
            return(config);
        }
        private void ConfigureCustomClasses(IConfiguration config, CustomReflector reflector
                                            )
        {
            var classes = reflector.CustomClasses();

            while (classes.MoveNext())
            {
                var cc = (CustomClass)classes.Current;
                ConfigureFields(config, cc);
            }
        }
 // TODO Auto-generated method stub
 public virtual void InitContext(PersistenceContext context)
 {
     LogMethodCall("initContext", context);
     var metadata = OpenMetadata(context.Url());
     try
     {
         var repository = InitializeClassRepository(metadata);
         var reflector = new CustomReflector(repository);
         var data = OpenData(reflector, context.Url());
         context.SetProviderContext(new MyContext(repository, metadata
             , data));
     }
     catch (Exception e)
     {
         Runtime.PrintStackTrace(e);
         // make sure metadata container is not left open
         // in case something goes wrong with the setup
         CloseIgnoringExceptions(metadata);
         // cant use exception chaining here because the
         // test must run in jdk 1.1
         throw new Db4oException(e);
     }
 }
        // TODO Auto-generated method stub
        public virtual void InitContext(PersistenceContext context)
        {
            LogMethodCall("initContext", context);
            var metadata = OpenMetadata(context.Url());

            try
            {
                var repository = InitializeClassRepository(metadata);
                var reflector  = new CustomReflector(repository);
                var data       = OpenData(reflector, context.Url());
                context.SetProviderContext(new MyContext(repository, metadata
                                                         , data));
            }
            catch (Exception e)
            {
                Runtime.PrintStackTrace(e);
                // make sure metadata container is not left open
                // in case something goes wrong with the setup
                CloseIgnoringExceptions(metadata);
                // cant use exception chaining here because the
                // test must run in jdk 1.1
                throw new Db4oException(e);
            }
        }
Exemple #5
0
 public virtual void Initialize(CustomReflector reflector)
 {
     _reflector = reflector;
 }
 private IObjectContainer OpenData(CustomReflector reflector, string fname)
 {
     return(Db4oFactory.OpenFile(DataConfiguration(reflector), fname));
 }
 private IObjectContainer OpenData(CustomReflector reflector, string fname)
 {
     return Db4oFactory.OpenFile(DataConfiguration(reflector), fname);
 }
 private void ConfigureCustomClasses(IConfiguration config, CustomReflector reflector
     )
 {
     var classes = reflector.CustomClasses();
     while (classes.MoveNext())
     {
         var cc = (CustomClass) classes.Current;
         ConfigureFields(config, cc);
     }
 }
 private IConfiguration DataConfiguration(CustomReflector reflector)
 {
     var config = Db4oFactory.NewConfiguration();
     config.ReflectWith(reflector);
     ConfigureCustomClasses(config, reflector);
     return config;
 }
 public virtual void Initialize(CustomReflector reflector)
 {
     _reflector = reflector;
 }