/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (LoadByName(kernel)) { try { return(kernel.Resolve(componentName, componentType, additionalArguments, scope)); } catch (ComponentNotFoundException e) { if (actualSelectorType == typeof(DefaultDelegateComponentSelector) && fallbackToResolveByTypeIfNameNotFound == false) { e.Data["breakingChangeId"] = "typedFactoryFallbackToResolveByTypeIfNameNotFound"; e.Data["breakingChange"] = "This exception may have been caused by a breaking change between Windsor 2.5 and 3.0 See breakingchanges.txt for more details."; } throw; } } // Ignore thread-static parent context call stack tracking. Factory-resolved components // are already tracked by the factory itself and should not be added as burdens just because // we happen to be resolving in the call stack of some random component’s constructor. // Specifically, act the same as we would if the timing was slightly different and we were not // resolving within the call stack of the random component’s constructor. return(kernel.Resolve(componentType, additionalArguments, scope, ignoreParentContext: true)); }
/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (ComponentName != null && kernel.LoadHandlerByKey(ComponentName, ComponentType, AdditionalArguments) != null) { return kernel.Resolve(ComponentName, ComponentType, AdditionalArguments, scope); } return kernel.Resolve(ComponentType, AdditionalArguments, scope); }
/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (LoadByName(kernel)) { return(kernel.Resolve(componentName, componentType, additionalArguments, scope)); } return(kernel.Resolve(componentType, additionalArguments, scope)); }
/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (LoadByName(kernel)) { return kernel.Resolve(componentName, componentType, additionalArguments, scope); } return kernel.Resolve(componentType, additionalArguments, scope); }
/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (ComponentName != null && kernel.LoadHandlerByKey(ComponentName, ComponentType, AdditionalArguments) != null) { return(kernel.Resolve(ComponentName, ComponentType, AdditionalArguments, scope)); } return(kernel.Resolve(ComponentType, AdditionalArguments, scope)); }
/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (kernel.HasComponent(ComponentName) == false) { return kernel.Resolve(ComponentType, AdditionalArguments, scope); } return kernel.Resolve(ComponentName, ComponentType, AdditionalArguments, scope); }
public WcfClientActivator(ComponentModel model, IKernelInternal kernel, ComponentInstanceDelegate onCreation, ComponentInstanceDelegate onDestruction) : base(model, kernel, onCreation, onDestruction) { clients = kernel.Resolve <WcfClientExtension>(); proxyFactory = new WcfProxyFactory(clients.ProxyGenerator, clients); }
public object Resolve(Type serviceType) { if (_kernel.LoadHandlerByType(null, serviceType, null) != null) { return(_kernel.Resolve(serviceType)); } return(null); }
public object GetService(Type serviceType) { if (kernel.LoadHandlerByType(null, serviceType, null) == null) { return(kernel.Resolve(serviceType)); } return(null); }
/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (LoadByName(kernel)) { try { return kernel.Resolve(componentName, componentType, additionalArguments, scope); } catch (ComponentNotFoundException e) { if (actualSelectorType == typeof(DefaultDelegateComponentSelector) && fallbackToResolveByTypeIfNameNotFound == false) { e.Data["breakingChangeId"] = "typedFactoryFallbackToResolveByTypeIfNameNotFound"; e.Data["breakingChange"] = "This exception may have been caused by a breaking change between Windsor 2.5 and 3.0 See breakingchanges.txt for more details."; } throw; } } return kernel.Resolve(componentType, additionalArguments, scope); }
/// <summary> /// Resolves the component(s) from given kernel. /// </summary> /// <param name = "kernel"></param> /// <param name = "scope"></param> /// <returns>Resolved component(s).</returns> public virtual object Resolve(IKernelInternal kernel, IReleasePolicy scope) { if (LoadByName(kernel)) { try { return(kernel.Resolve(componentName, componentType, additionalArguments, scope)); } catch (ComponentNotFoundException e) { if (actualSelectorType == typeof(DefaultDelegateComponentSelector) && fallbackToResolveByTypeIfNameNotFound == false) { e.Data["breakingChangeId"] = "typedFactoryFallbackToResolveByTypeIfNameNotFound"; e.Data["breakingChange"] = "This exception may have been caused by a breaking change between Windsor 2.5 and 3.0 See breakingchanges.txt for more details."; } throw; } } return(kernel.Resolve(componentType, additionalArguments, scope)); }
protected override IDictionary GetArguments(MethodInfo method, object[] arguments) { var generics = method.GetGenericArguments(); if (generics.Length != 2 || generics.First() != typeof(IUnitOfWork) || !method.Name.Equals("create", StringComparison.InvariantCultureIgnoreCase)) { return(base.GetArguments(method, arguments)); } var uow = new Arguments { { "session", _kernel.Resolve(generics.Last()) }, { "isolationLevel", arguments[0] }, { "sessionOnlyForThisUnitOfWork", true } }; return(uow); }
public override object Resolve(IKernelInternal kernel, IReleasePolicy scope) { var manager = kernel.Resolve <WindsorDependencyResolver>().Resolve <IConnectionManager>(); return(manager.GetHubContext(additionalArguments["hubname"].ToString())); }