Home

Castle Stronghold

Aspect# Integration Facility

The Aspect# Integration Facility enables AOP capabilities for components.

Facility Summary
Uses ProxyYes
Requires configurationYes
Uses attributeNo
VersionBeta 3
Maturity levelLow

Introduction

By using this facility you can apply Aspect#'s aspect definitions on your components.

It is important to define the configuration for the facility. The contents of the node should be a CDATA section holding the aspect definitions. You can check Aspect# site for more details about the configuration language.

Please note that your implementations of IMethodInterceptor may be registered on the container as well.

Quick start

Just register the facility and add the configuration. Each component registered from now on will be checked against the aspect definitions. If some aspect match, the definition will be associated with it, and once you request the component, you will receive the result of the aspects applied to it.


WindsorContainer container = new WindsorContainer(new XmlInterpreter());
container.AddFacility("aop", new AspectSharpFacility());

Configuration Schema


<configuration>

  <facilities>
    <facility id="aspectsharp">
[CDATA[
import AspectSharp.Tests.Components in AspectSharp.Tests 
import AspectSharp.Tests.Interceptors in AspectSharp.Tests 

interceptors [ "key" : LoggerTraceInterceptor ] 
mixins [ "key" : SecurityMixin  ] 

aspect ProtocolHandlerLogger for [ assignableFrom(IProtocolHandler) ]  
    include "key" 

    pointcut method(*) 
        advice("key") 
    end 
end 
]]
    </facility>
  </facilities>

</configuration>
Google
Search WWW Search castleproject.org