Exemplo n.º 1
0
        private IConfiguration DataConfiguration(CustomReflector reflector)
        {
            var config = Db4oFactory.NewConfiguration();

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

            while (classes.MoveNext())
            {
                var cc = (CustomClass)classes.Current;
                ConfigureFields(config, cc);
            }
        }
Exemplo n.º 3
0
 // 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);
     }
 }
Exemplo n.º 4
0
        // 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);
            }
        }
Exemplo n.º 5
0
 public virtual void Initialize(CustomReflector reflector)
 {
     _reflector = reflector;
 }
Exemplo n.º 6
0
 private IObjectContainer OpenData(CustomReflector reflector, string fname)
 {
     return(Db4oFactory.OpenFile(DataConfiguration(reflector), fname));
 }
Exemplo n.º 7
0
 private IObjectContainer OpenData(CustomReflector reflector, string fname)
 {
     return Db4oFactory.OpenFile(DataConfiguration(reflector), fname);
 }
Exemplo n.º 8
0
 private void ConfigureCustomClasses(IConfiguration config, CustomReflector reflector
     )
 {
     var classes = reflector.CustomClasses();
     while (classes.MoveNext())
     {
         var cc = (CustomClass) classes.Current;
         ConfigureFields(config, cc);
     }
 }
Exemplo n.º 9
0
 private IConfiguration DataConfiguration(CustomReflector reflector)
 {
     var config = Db4oFactory.NewConfiguration();
     config.ReflectWith(reflector);
     ConfigureCustomClasses(config, reflector);
     return config;
 }
Exemplo n.º 10
0
 public virtual void Initialize(CustomReflector reflector)
 {
     _reflector = reflector;
 }