public virtual void PersistenceGroupItemScanned(Net.Vpc.Upa.ScanEvent @event)
 {
     if (listener != null)
     {
         listener.PersistenceGroupItemScanned(@event);
     }
     Net.Vpc.Upa.PersistenceGroup persistenceGroup = @event.GetPersistenceGroup();
     System.Type t = @event.GetVisitedType();
     if (@event.GetContract().Equals(typeof(Net.Vpc.Upa.Callbacks.PersistenceUnitDefinitionListener)))
     {
         object i = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <System.Type, object>(instances, t);
         if (i == null)
         {
             i            = persistenceGroup.GetFactory().GetSingleton <object>(t);
             instances[t] = i;
         }
         persistenceGroup.AddPersistenceUnitDefinitionListener((Net.Vpc.Upa.Callbacks.PersistenceUnitDefinitionListener)i);
     }
     if (@event.GetContract().Equals(typeof(Net.Vpc.Upa.PersistenceGroupSecurityManager)))
     {
         object i = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <System.Type, object>(instances, t);
         if (i == null)
         {
             i            = persistenceGroup.GetFactory().GetSingleton <object>(t);
             instances[t] = i;
         }
         persistenceGroup.SetPersistenceGroupSecurityManager((Net.Vpc.Upa.PersistenceGroupSecurityManager)i);
     }
 }
示例#2
0
 public ScanEvent(Net.Vpc.Upa.UPAContext context, Net.Vpc.Upa.PersistenceGroup persistenceGroup, Net.Vpc.Upa.PersistenceUnit persistenceUnit, System.Type contract, System.Type type, object instance)
 {
     this.context          = context;
     this.persistenceGroup = persistenceGroup;
     this.persistenceUnit  = persistenceUnit;
     this.contract         = contract;
     this.visitedType      = type;
     this.userObject       = instance;
 }
示例#3
0
 public virtual void SetSession(Net.Vpc.Upa.PersistenceGroup persistenceGroup, Net.Vpc.Upa.Session session)
 {
     if (session == null)
     {
         GetMap().Remove(persistenceGroup);
     }
     else
     {
         GetMap()[persistenceGroup] = session;
     }
 }
示例#4
0
 public ScanEvent(Net.Vpc.Upa.UPAContext context, Net.Vpc.Upa.PersistenceGroup persistenceGroup, Net.Vpc.Upa.PersistenceUnit persistenceUnit, System.Type contract, System.Type type, System.Reflection.MethodInfo method, Net.Vpc.Upa.Field field, Net.Vpc.Upa.Config.Decoration decoration, object instance)
 {
     this.context           = context;
     this.persistenceGroup  = persistenceGroup;
     this.persistenceUnit   = persistenceUnit;
     this.contract          = contract;
     this.visitedType       = type;
     this.visitedMethod     = method;
     this.visitedField      = field;
     this.visitedDecoration = decoration;
     this.userObject        = instance;
 }
        public virtual void SetPersistenceUnit(Net.Vpc.Upa.PersistenceGroup persistenceGroup, Net.Vpc.Upa.PersistenceUnit persistenceUnit)
        {
            string k = System.Convert.ToString(System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(persistenceGroup));

            if (persistenceUnit == null)
            {
                GetMap().Remove(k);
            }
            else
            {
                GetMap()[k] = persistenceUnit;
            }
        }
示例#6
0
 public override System.Collections.Generic.IEnumerable <System.Type> ToIterable(object context)
 {
     System.Collections.Generic.IList <Net.Vpc.Upa.Config.ScanFilter> _filters = new System.Collections.Generic.List <Net.Vpc.Upa.Config.ScanFilter>();
     if (context is Net.Vpc.Upa.UPAContext)
     {
         Net.Vpc.Upa.UPAContext pg = (Net.Vpc.Upa.UPAContext)context;
         Net.Vpc.Upa.Impl.FwkConvertUtils.ListAddRange(_filters, new System.Collections.Generic.List <Net.Vpc.Upa.Config.ScanFilter>(pg.GetContextAnnotationStrategyFilters()));
     }
     else if (context is Net.Vpc.Upa.PersistenceGroup)
     {
         Net.Vpc.Upa.PersistenceGroup pg = (Net.Vpc.Upa.PersistenceGroup)context;
         foreach (Net.Vpc.Upa.Config.ScanFilter filter in pg.GetContext().GetContextAnnotationStrategyFilters())
         {
             if (filter.IsPropagate())
             {
                 _filters.Add(filter);
             }
         }
         Net.Vpc.Upa.Impl.FwkConvertUtils.ListAddRange(_filters, new System.Collections.Generic.List <Net.Vpc.Upa.Config.ScanFilter>(pg.GetContextAnnotationStrategyFilters()));
     }
     else if (context is Net.Vpc.Upa.PersistenceUnit)
     {
         Net.Vpc.Upa.PersistenceUnit pu = (Net.Vpc.Upa.PersistenceUnit)context;
         foreach (Net.Vpc.Upa.Config.ScanFilter filter in pu.GetPersistenceGroup().GetContext().GetContextAnnotationStrategyFilters())
         {
             if (filter.IsPropagate())
             {
                 _filters.Add(filter);
             }
         }
         foreach (Net.Vpc.Upa.Config.ScanFilter filter in pu.GetPersistenceGroup().GetContextAnnotationStrategyFilters())
         {
             if (filter.IsPropagate())
             {
                 _filters.Add(filter);
             }
         }
         foreach (Net.Vpc.Upa.Config.ScanFilter filter in pu.GetContextAnnotationStrategyFilters())
         {
             _filters.Add(filter);
         }
     }
     else
     {
         throw new System.ArgumentException("Unsupported context " + context);
     }
     return(new Net.Vpc.Upa.Impl.Util.Classpath.URLClassIterable(Net.Vpc.Upa.Impl.Util.Classpath.ClassPathUtils.ResolveClassPathLibs(), new Net.Vpc.Upa.Impl.Util.Classpath.DefaultConfigFilter(_filters.ToArray()), null));
 }
示例#7
0
 public virtual void Init(Net.Vpc.Upa.PersistenceGroup manager)
 {
     session.Init(manager);
 }
示例#8
0
 public virtual Net.Vpc.Upa.Session GetSession(Net.Vpc.Upa.PersistenceGroup persistenceGroup)
 {
     return(Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <Net.Vpc.Upa.PersistenceGroup, Net.Vpc.Upa.Session>(GetMap(), persistenceGroup));
 }
示例#9
0
 public virtual void Init(Net.Vpc.Upa.PersistenceGroup manager)
 {
 }
 public virtual Net.Vpc.Upa.PersistenceUnit GetPersistenceUnit(Net.Vpc.Upa.PersistenceGroup persistenceGroup)
 {
     return(Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <string, Net.Vpc.Upa.PersistenceUnit>(GetMap(), System.Convert.ToString(System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(persistenceGroup))));
 }
示例#11
0
 public virtual void SetPersistenceGroup(Net.Vpc.Upa.PersistenceGroup current)
 {
     this.persistenceGroup = current;
 }
示例#12
0
 public PersistenceGroupListenerManager(Net.Vpc.Upa.PersistenceGroup group)
 {
     this.group = group;
 }
 public virtual bool IsAllowedKey(Net.Vpc.Upa.PersistenceGroup g, string key) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     Net.Vpc.Upa.PersistenceGroupSecurityManager s = g.GetPersistenceGroupSecurityManager();
     return(s == null ? true : s.IsAllowedKey(key));
 }
示例#14
0
 public virtual void SetPersistenceGroup(Net.Vpc.Upa.PersistenceGroup persistenceGroup)
 {
     this.persistenceGroup = persistenceGroup;
 }
示例#15
0
 public PersistenceGroupEvent(Net.Vpc.Upa.PersistenceGroup persistenceGroup, Net.Vpc.Upa.UPAContext context)
 {
     this.persistenceGroup = persistenceGroup;
     this.context          = context;
 }
示例#16
0
 public PersistenceUnitEvent(Net.Vpc.Upa.PersistenceUnit persistenceUnit, Net.Vpc.Upa.PersistenceGroup persistenceGroup, Net.Vpc.Upa.EventPhase phase)
 {
     this.persistenceUnit  = persistenceUnit;
     this.persistenceGroup = persistenceGroup;
     this.phase            = phase;
 }