コード例 #1
0
        public void LinkToEvent <R>(IServiceContext serviceContext, String eventProviderBeanName, Delegate handlerDelegate)
        {
            ParamChecker.AssertParamNotNull(serviceContext, "serviceContext");
            ParamChecker.AssertParamNotNull(eventProviderBeanName, "eventProviderBeanName");
            ParamChecker.AssertParamNotNull(handlerDelegate, "handlerDelegate");

            AbstractLinkContainerOld linkContainer = createLinkContainer(typeof(R), (String)null);

            linkContainer.RegistryBeanName = eventProviderBeanName;
            linkContainer.Listener         = handlerDelegate;

            serviceContext.RegisterWithLifecycle(linkContainer).Finish();
        }
コード例 #2
0
        public void LinkToEvent <R>(IServiceContext serviceContext, String eventProviderBeanName, String listenerBeanName, String methodName)
        {
            ParamChecker.AssertParamNotNull(serviceContext, "serviceContext");
            ParamChecker.AssertParamNotNull(eventProviderBeanName, "eventProviderBeanName");
            ParamChecker.AssertParamNotNull(listenerBeanName, "listenerBeanName");
            ParamChecker.AssertParamNotNull(methodName, "methodName");

            AbstractLinkContainerOld linkContainer = createLinkContainer(typeof(R), methodName);

            linkContainer.RegistryBeanName = eventProviderBeanName;
            linkContainer.ListenerBeanName = listenerBeanName;

            serviceContext.RegisterWithLifecycle(linkContainer).Finish();
        }
コード例 #3
0
        public void Link(IServiceContext serviceContext, String listenerBeanName, Type autowiredRegistryClass, Object[] arguments)
        {
            ParamChecker.AssertParamNotNull(serviceContext, "serviceContext");
            ParamChecker.AssertParamNotNull(listenerBeanName, "listenerBeanName");
            ParamChecker.AssertParamNotNull(autowiredRegistryClass, "autowiredRegistryClass");
            ParamChecker.AssertParamNotNull(arguments, "arguments");

            AbstractLinkContainerOld linkContainer = createLinkContainer(autowiredRegistryClass, arguments);

            linkContainer.RegistryBeanAutowiredType = autowiredRegistryClass;
            linkContainer.ListenerBeanName          = listenerBeanName;
            linkContainer.BeanContext = serviceContext;

            serviceContext.RegisterWithLifecycle(linkContainer).Finish();
        }