Beispiel #1
0
 public ConversationInterceptor(IKernel kernel,
                                IConversationalMetaInfoStore metadataStore,
                                IConversationsContainerAccessor conversationsContainerAccessor,
                                IConversationFactory conversationFactory)
     : base(metadataStore, conversationsContainerAccessor, conversationFactory)
 {
     this.kernel = kernel;
 }
		protected AbstractConversationInterceptor(IConversationalMetaInfoStore metadataStore,
			IConversationsContainerAccessor conversationsContainerAccessor,
			IConversationFactory conversationFactory)
		{
			ConversationsContainerAccessor = conversationsContainerAccessor;
			ConversationFactory = conversationFactory;
			MetadataStore = metadataStore;
		}
Beispiel #3
0
 protected AbstractConversationInterceptor(IConversationalMetaInfoStore metadataStore,
                                           IConversationsContainerAccessor conversationsContainerAccessor,
                                           IConversationFactory conversationFactory)
 {
     ConversationsContainerAccessor = conversationsContainerAccessor;
     ConversationFactory            = conversationFactory;
     MetadataStore = metadataStore;
 }
		public ConversationInterceptor(IKernel kernel,
			IConversationalMetaInfoStore metadataStore,
			IConversationsContainerAccessor conversationsContainerAccessor,
			IConversationFactory conversationFactory)
			: base(metadataStore, conversationsContainerAccessor, conversationFactory)
		{
			this.kernel = kernel;
		}
		private static void AddConversationInterceptorIfIsConversational(ComponentModel model, IConversationalMetaInfoStore store)
		{
			var meta = store.GetMetadataFor(model.Implementation);

			if (meta == null)
			{
				return;
			}

			model.Dependencies.Add(new DependencyModel(DependencyType.Service, null, typeof (ConversationInterceptor), false));
			model.Interceptors.Add(new InterceptorReference(typeof (ConversationInterceptor)));
		}
        private static void Validate(ComponentModel model, IConversationalMetaInfoStore store)
        {
            if (model.Service == null || model.Service.IsInterface)
            {
                return;
            }

            var meta = store.GetMetadataFor(model.Implementation);

            if (meta == null)
            {
                return;
            }

            var problematicMethods = new List <string>(10);

            foreach (MethodInfo method in meta.Methods)
            {
                if (!method.IsVirtual)
                {
                    problematicMethods.Add(method.Name);
                }
            }

            if (problematicMethods.Count != 0)
            {
                string[] methodNames = problematicMethods.ToArray();

                string message =
                    string.Format(
                        "The class {0} wants to use persistence-conversation interception, "
                        + "however the methods must be marked as virtual in order to do so. Please correct "
                        + "the following methods: {1}", model.Implementation.FullName, string.Join(", ", methodNames));

                throw new FacilityException(message);
            }
        }
		private static void Validate(ComponentModel model, IConversationalMetaInfoStore store)
		{
			if (model.Service == null || model.Service.IsInterface)
			{
				return;
			}

			var meta = store.GetMetadataFor(model.Implementation);

			if (meta == null)
			{
				return;
			}

			var problematicMethods = new List<string>(10);

			foreach (MethodInfo method in meta.Methods)
			{
				if (!method.IsVirtual)
				{
					problematicMethods.Add(method.Name);
				}
			}

			if (problematicMethods.Count != 0)
			{
				string[] methodNames = problematicMethods.ToArray();

				string message =
					string.Format(
						"The class {0} wants to use persistence-conversation interception, "
						+ "however the methods must be marked as virtual in order to do so. Please correct "
						+ "the following methods: {1}", model.Implementation.FullName, string.Join(", ", methodNames));

				throw new FacilityException(message);
			}
		}
Beispiel #8
0
 public ConversationalAttributeAutoProxyCreator(IConversationalMetaInfoStore store)
 {
     this.store = (ReflectionConversationalMetaInfoStore)store;
 }
        private static void AddConversationInterceptorIfIsConversational(ComponentModel model, IConversationalMetaInfoStore store)
        {
            var meta = store.GetMetadataFor(model.Implementation);

            if (meta == null)
            {
                return;
            }

            model.Dependencies.Add(new DependencyModel(DependencyType.Service, null, typeof(ConversationInterceptor), false));
            model.Interceptors.Add(new InterceptorReference(typeof(ConversationInterceptor)));
        }
Beispiel #10
0
 public ConversationInterceptor(IConversationalMetaInfoStore metadataStore,
                                IConversationsContainerAccessor conversationsContainerAccessor,
                                IConversationFactory conversationFactory)
     : base(metadataStore, conversationsContainerAccessor, conversationFactory)
 {
 }