Пример #1
0
 public CallbackConfig(object instance, System.Reflection.MethodInfo method, Net.Vpc.Upa.CallbackType callbackType, Net.Vpc.Upa.EventPhase phase)
 {
     this.instance     = instance;
     this.method       = method;
     this.phase        = phase;
     this.callbackType = callbackType;
 }
Пример #2
0
 public virtual void FireOnDropPersistenceUnit(Net.Vpc.Upa.Callbacks.PersistenceUnitEvent @event)
 {
     Net.Vpc.Upa.EventPhase phase = @event.GetPhase();
     Net.Vpc.Upa.Callbacks.PersistenceUnitDefinitionListener[] interceptorList = GetPersistenceUnitDefinitionListeners();
     if (phase == Net.Vpc.Upa.EventPhase.BEFORE)
     {
         foreach (Net.Vpc.Upa.Callbacks.PersistenceUnitDefinitionListener listener in interceptorList)
         {
             listener.OnPreDropPersistenceUnit(@event);
         }
         foreach (Net.Vpc.Upa.Callback callback in GetCallbackPreInvokers(Net.Vpc.Upa.CallbackType.ON_DROP, Net.Vpc.Upa.ObjectType.PERSISTENCE_GROUP, @event.GetPersistenceGroup().GetName(), DEFAULT_SYSTEM))
         {
             callback.Invoke(@event);
         }
     }
     else
     {
         foreach (Net.Vpc.Upa.Callbacks.PersistenceUnitDefinitionListener listener in interceptorList)
         {
             listener.OnDropPersistenceUnit(@event);
         }
         foreach (Net.Vpc.Upa.Callback callback in GetCallbackPostInvokers(Net.Vpc.Upa.CallbackType.ON_DROP, Net.Vpc.Upa.ObjectType.PERSISTENCE_GROUP, @event.GetPersistenceGroup().GetName(), DEFAULT_SYSTEM))
         {
             callback.Invoke(@event);
         }
     }
 }
Пример #3
0
 public CallbackConfig(object instance, System.Reflection.MethodInfo method, Net.Vpc.Upa.CallbackType callbackType, Net.Vpc.Upa.EventPhase phase, System.Collections.Generic.IDictionary <string, object> configuration)
 {
     this.instance      = instance;
     this.method        = method;
     this.callbackType  = callbackType;
     this.phase         = phase;
     this.configuration = configuration;
 }
Пример #4
0
 public DefaultCallback(object o, System.Reflection.MethodInfo m, Net.Vpc.Upa.CallbackType callbackType, Net.Vpc.Upa.EventPhase phase, Net.Vpc.Upa.ObjectType objectType, Net.Vpc.Upa.Impl.Config.Callback.MethodArgumentsConverter converter, System.Collections.Generic.IDictionary <string, object> configuration)
 {
     this.converter     = converter;
     this.instance      = o;
     this.method        = m;
     this.objectType    = objectType;
     this.callbackType  = callbackType;
     this.configuration = configuration;
     this.phase         = phase;
 }
Пример #5
0
 public EntityEvent(Net.Vpc.Upa.Persistence.EntityExecutionContext context, Net.Vpc.Upa.EventPhase phase)
 {
     this.context         = context;
     this.entity          = context.GetEntity();
     this.parent          = entity.GetParent();
     this.persistenceUnit = context.GetPersistenceUnit();
     this.index           = -1;
     this.oldIndex        = -1;
     this.phase           = phase;
 }
Пример #6
0
 public PackageEvent(Net.Vpc.Upa.Package item, Net.Vpc.Upa.PersistenceUnit persistenceUnit, Net.Vpc.Upa.Package parent, int index, Net.Vpc.Upa.Package oldParent, int oldIndex, Net.Vpc.Upa.EventPhase phase)
 {
     this.persistenceUnit = persistenceUnit;
     this.item            = item;
     this.parent          = parent;
     this.index           = index;
     this.oldParent       = oldParent;
     this.oldIndex        = oldIndex;
     this.phase           = phase;
 }
Пример #7
0
 public EntityEvent(Net.Vpc.Upa.Entity entity, Net.Vpc.Upa.PersistenceUnit persistenceUnit, Net.Vpc.Upa.Package parent, int index, Net.Vpc.Upa.Package oldParent, int oldIndex, Net.Vpc.Upa.EventPhase phase)
 {
     this.persistenceUnit = persistenceUnit;
     this.entity          = entity;
     this.parent          = parent;
     this.index           = index;
     this.oldParent       = oldParent;
     this.oldIndex        = oldIndex;
     this.phase           = phase;
 }
Пример #8
0
 public SectionEvent(Net.Vpc.Upa.Section item, Net.Vpc.Upa.PersistenceUnit persistenceUnit, Net.Vpc.Upa.Entity entity, Net.Vpc.Upa.Section parent, int index, Net.Vpc.Upa.Section oldParent, int oldIndex, Net.Vpc.Upa.EventPhase phase)
 {
     this.persistenceUnit = persistenceUnit;
     this.item            = item;
     this.parent          = parent;
     this.index           = index;
     this.oldParent       = oldParent;
     this.oldIndex        = oldIndex;
     this.entity          = entity;
     this.phase           = phase;
 }
Пример #9
0
 public FieldEvent(Net.Vpc.Upa.Field field, Net.Vpc.Upa.PersistenceUnit persistenceUnit, Net.Vpc.Upa.Entity entity, Net.Vpc.Upa.EntityPart parent, int index, Net.Vpc.Upa.EntityPart oldParent, int oldIndex, Net.Vpc.Upa.EventPhase phase)
 {
     this.persistenceUnit = persistenceUnit;
     this.field           = field;
     this.parent          = parent;
     this.index           = index;
     this.oldParent       = oldParent;
     this.oldIndex        = oldIndex;
     this.entity          = entity;
     this.phase           = phase;
 }
 public virtual System.Collections.Generic.IList <Net.Vpc.Upa.Callback> GetCallbacks(Net.Vpc.Upa.CallbackType callbackType, Net.Vpc.Upa.ObjectType objectType, string nameFilter, bool system, bool preparedOnly, Net.Vpc.Upa.EventPhase phase)
 {
     return(callbackManager.GetCallbacks(callbackType, objectType, nameFilter, system, preparedOnly, phase));
 }
Пример #11
0
 public TriggerEvent(Net.Vpc.Upa.Callbacks.Trigger trigger, Net.Vpc.Upa.Entity entity, Net.Vpc.Upa.EventPhase phase)
 {
     this.entity  = entity;
     this.trigger = trigger;
     this.phase   = phase;
 }
Пример #12
0
 public UpdateEvent(Net.Vpc.Upa.Record updatesRecord, Net.Vpc.Upa.Expressions.Expression filterExpression, Net.Vpc.Upa.Persistence.EntityExecutionContext entityExecutionContext, Net.Vpc.Upa.EventPhase phase)  : base(entityExecutionContext, phase)
 {
     this.updatesRecord    = updatesRecord;
     this.filterExpression = filterExpression;
 }
Пример #13
0
 public RelationshipEvent(Net.Vpc.Upa.Relationship relation, Net.Vpc.Upa.PersistenceUnit persistenceUnit, Net.Vpc.Upa.EventPhase phase)
 {
     this.persistenceUnit = persistenceUnit;
     this.relationship    = relation;
     this.phase           = phase;
 }
Пример #14
0
 public UpdateObjectEvent(object objectId, Net.Vpc.Upa.Record updatesRecord, Net.Vpc.Upa.Expressions.Expression filterExpression, Net.Vpc.Upa.Persistence.EntityExecutionContext entityExecutionContext, Net.Vpc.Upa.EventPhase phase)  : base(updatesRecord, filterExpression, entityExecutionContext, phase)
 {
     this.objectId = objectId;
 }
Пример #15
0
 public virtual Net.Vpc.Upa.Callback[] GetCallbacks(Net.Vpc.Upa.CallbackType nameFilter, Net.Vpc.Upa.ObjectType objectType, string name, bool system, bool preparedOnly, Net.Vpc.Upa.EventPhase phase)
 {
     System.Collections.Generic.IList <Net.Vpc.Upa.Callback> callbackInvokers = listeners.GetCallbacks(nameFilter, objectType, name, system, preparedOnly, phase);
     return(callbackInvokers.ToArray());
 }
Пример #16
0
 public IndexEvent(Net.Vpc.Upa.Index index, Net.Vpc.Upa.PersistenceUnit persistenceUnit, Net.Vpc.Upa.EventPhase phase)
 {
     this.persistenceUnit = persistenceUnit;
     this.index           = index;
     this.phase           = phase;
 }
Пример #17
0
 public virtual System.Collections.Generic.IList <Net.Vpc.Upa.Callback> GetCallbackEffectiveInvokers(Net.Vpc.Upa.CallbackType callbackType, Net.Vpc.Upa.ObjectType objectType, string nameFilter, bool system, Net.Vpc.Upa.EventPhase phase)
 {
     System.Collections.Generic.IList <Net.Vpc.Upa.Callback> allCallbacks = callbackManager.GetCallbacks(callbackType, objectType, nameFilter, system, false, phase);
     Net.Vpc.Upa.Impl.FwkConvertUtils.ListAddRange(allCallbacks, new System.Collections.Generic.List <Net.Vpc.Upa.Callback>(group.GetContext().GetCallbacks(callbackType, objectType, nameFilter, system, false, phase)));
     return(allCallbacks);
 }
Пример #18
0
 public static void ConfigureMethodCallback(System.Type type, System.Reflection.MethodInfo method, Net.Vpc.Upa.Config.Decoration methodDecoration, Net.Vpc.Upa.PersistenceUnit persistenceUnit)
 {
     Net.Vpc.Upa.CallbackType callbackType  = Net.Vpc.Upa.Impl.Util.PlatformUtils.GetUndefinedValue <Net.Vpc.Upa.CallbackType>(typeof(Net.Vpc.Upa.CallbackType));
     Net.Vpc.Upa.EventPhase   callbackPhase = Net.Vpc.Upa.Impl.Util.PlatformUtils.GetUndefinedValue <Net.Vpc.Upa.EventPhase>(typeof(Net.Vpc.Upa.EventPhase));
     System.Collections.Generic.IDictionary <string, object> conf = new System.Collections.Generic.Dictionary <string, object>();
     if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPreAlter)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_ALTER;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnAlter)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_ALTER;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPreCreate)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_CREATE;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnCreate)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_CREATE;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPreDrop)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_DROP;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnDrop)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_DROP;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPrePersist)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_PERSIST;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPersist)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_PERSIST;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPreUpdate)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_UPDATE;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnUpdate)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_UPDATE;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPreRemove)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_REMOVE;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnRemove)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_REMOVE;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPreReset)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_RESET;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnReset)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_RESET;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPreInitialize)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_INITIALIZE;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnInitialize)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_INITIALIZE;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnPreUpdateFormula)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_UPDATE_FORMULAS;
         callbackPhase = Net.Vpc.Upa.EventPhase.BEFORE;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.OnUpdateFormula)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_UPDATE_FORMULAS;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         conf["trackSystemObjects"] = methodDecoration.GetBoolean("trackSystemObjects");
     }
     else if (methodDecoration.IsName(typeof(Net.Vpc.Upa.Config.Function)))
     {
         callbackType  = Net.Vpc.Upa.CallbackType.ON_EVAL;
         callbackPhase = Net.Vpc.Upa.EventPhase.AFTER;
         string      functionName = methodDecoration.GetString("name");
         System.Type returnType   = methodDecoration.GetType("returnType");
         if (!Net.Vpc.Upa.Impl.Util.StringUtils.IsNullOrEmpty(functionName))
         {
             conf["functionName"] = functionName;
         }
         if (returnType != null && !Net.Vpc.Upa.Impl.Util.PlatformUtils.IsVoid(returnType))
         {
             conf["returnType"] = returnType;
         }
     }
     if (callbackType != default(Net.Vpc.Upa.CallbackType))
     {
         object instance = null;
         if (!Net.Vpc.Upa.Impl.Util.PlatformUtils.IsStatic(method))
         {
             instance = persistenceUnit.GetFactory().GetSingleton <object>(type);
         }
         persistenceUnit.AddCallback(new Net.Vpc.Upa.CallbackConfig(instance, method, callbackType, callbackPhase, conf));
     }
 }
Пример #19
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;
 }
Пример #20
0
 public PersistEvent(object persistedId, Net.Vpc.Upa.Record persistedRecord, Net.Vpc.Upa.Persistence.EntityExecutionContext entityExecutionContext, Net.Vpc.Upa.EventPhase phase)  : base(entityExecutionContext, phase)
 {
     this.persistedId     = persistedId;
     this.persistedRecord = persistedRecord;
 }
Пример #21
0
 public virtual System.Collections.Generic.IList <Net.Vpc.Upa.PreparedCallback> GetPostPreparedCallbacks(Net.Vpc.Upa.CallbackType callbackType, Net.Vpc.Upa.ObjectType objectType, string nameFilter, bool system, Net.Vpc.Upa.EventPhase phase)
 {
     Net.Vpc.Upa.Impl.Util.CallbackInvokerKey k = new Net.Vpc.Upa.Impl.Util.CallbackInvokerKey(callbackType, objectType, nameFilter, system);
     System.Collections.Generic.IList <Net.Vpc.Upa.PreparedCallback> found = new System.Collections.Generic.List <Net.Vpc.Upa.PreparedCallback>();
     System.Collections.Generic.IDictionary <Net.Vpc.Upa.Impl.Util.CallbackInvokerKey, System.Collections.Generic.IList <Net.Vpc.Upa.PreparedCallback> > list = this.preparedAfter;
     System.Collections.Generic.IList <Net.Vpc.Upa.PreparedCallback> ss = Net.Vpc.Upa.Impl.FwkConvertUtils.GetMapValue <Net.Vpc.Upa.Impl.Util.CallbackInvokerKey, System.Collections.Generic.IList <Net.Vpc.Upa.PreparedCallback> >(list, k);
     if (ss != null)
     {
         Net.Vpc.Upa.Impl.FwkConvertUtils.ListAddRange(found, ss);
     }
     if (nameFilter != null)
     {
         Net.Vpc.Upa.Impl.FwkConvertUtils.ListAddRange(found, GetPostPreparedCallbacks(callbackType, objectType, null, system, phase));
     }
     if (!system)
     {
         Net.Vpc.Upa.Impl.FwkConvertUtils.ListAddRange(found, GetPostPreparedCallbacks(callbackType, objectType, null, true, phase));
     }
     return(found);
 }
Пример #22
0
 public PersistObjectEvent(object objectId, Net.Vpc.Upa.Record objectRecord, Net.Vpc.Upa.Persistence.EntityExecutionContext entityExecutionContext, Net.Vpc.Upa.EventPhase phase)  : base(entityExecutionContext, phase)
 {
     this.objectId     = objectId;
     this.objectRecord = objectRecord;
 }
Пример #23
0
 public RemoveEvent(Net.Vpc.Upa.Expressions.Expression filterExpression, Net.Vpc.Upa.Persistence.EntityExecutionContext entityExecutionContext, Net.Vpc.Upa.EventPhase phase)  : base(entityExecutionContext, phase)
 {
     this.filterExpression = filterExpression;
 }
 public virtual void ItemMoved(Net.Vpc.Upa.UPAObject @object, int position, int toPosition, Net.Vpc.Upa.EventPhase eventPhase)
 {
 }
 public virtual void ItemAdded(Net.Vpc.Upa.UPAObject @object, int position, Net.Vpc.Upa.UPAObject parent, Net.Vpc.Upa.EventPhase eventPhase)
 {
     if (eventPhase == Net.Vpc.Upa.EventPhase.BEFORE)
     {
         entity.BeforePartAdded((Net.Vpc.Upa.EntityPart)parent, (Net.Vpc.Upa.EntityPart)@object, position);
     }
     else
     {
         entity.AfterPartAdded((Net.Vpc.Upa.EntityPart)parent, (Net.Vpc.Upa.EntityPart)@object, position);
     }
 }
 public UpdateObjectEventCallback(object o, System.Reflection.MethodInfo m, Net.Vpc.Upa.CallbackType callbackType, Net.Vpc.Upa.EventPhase phase, Net.Vpc.Upa.ObjectType objectType, Net.Vpc.Upa.Impl.Config.Callback.MethodArgumentsConverter converter, System.Collections.Generic.IDictionary <string, object> configuration)  : base(o, m, callbackType, phase, objectType, converter, configuration)
 {
 }
Пример #27
0
 public RemoveObjectEvent(object objectId, Net.Vpc.Upa.Expressions.Expression filterExpression, Net.Vpc.Upa.Persistence.EntityExecutionContext entityExecutionContext, Net.Vpc.Upa.EventPhase phase)  : base(filterExpression, entityExecutionContext, phase)
 {
     this.objectId = objectId;
 }