GithubHelp home page GithubHelp logo

kingaop's Introduction

:octocat: My profile

{
    "First Name": "Anton"
    "Last Name": "Moldovan"
    "Interests": ["Functional Programming", "Distributed Systems", "Databases"]    
}

๐Ÿ”ญ OSS Projects

  • NBomber - Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
  • NBomber.Http - NBomber plugin for defining HTTP scenarios
  • NBomber.Sinks.InfluxDB - NBomber sink that writes statistics to InfluxDB
  • NBomber.Grafana - NBomber Grafana dashboard

๐ŸŒฑ Blog

kingaop's People

Contributors

antyadev avatar tmpreston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kingaop's Issues

IronPython exposed class integration doesn't work?

I'm trying to intercept the method calls to a ironpython exposed c# object.For whatever reason this doesn't quite work. I'm trying to find out why but so far no success. Maybe there is some apparent reason why this is the case?

Internal methods marked for logging do not get called

It would appear that to invoke logging for a method even if its decorated with a logging aspect attribute has to be called externally via the instance of the dynamic object reference. This would be a huge limitation as it appears that internal method call that take place within the class itself never get their respective aspect invoked and thus never get logged as part of a call start. Or whatever other functionality you might introduce other than logging. This would mean that in order to use this framework one would have to change their architecture so that every single method gets called in reference to the dynamic instance of an object and can not call methods internally if they are expecting aspect based behavior to execute.

Static methods marked for logging do not get called

It would appear that to invoke logging for a method even if its decorated with a logging aspect attribute has to be called externally via the instance of the dynamic object reference.
static method never gets logged.

Not able to invoke OnEntry and OnSucess method

I am using KingAOP for caching purpose. so I am creating a CustomAttribue class and override the OnEntry and OnSucess method.

I am sharing codes we have used in our application. Can you please suggest me how can invoke these methods.

[Serializable]
[AttributeUsage(AttributeTargets.Method)]
public class CacheAttribute : OnMethodBoundaryAspect
{
// This field will be set by CompileTimeInitialize and serialized at build time, then deserialized at runtime.
private string cacheKey;
private List dependentTableNames;
private static readonly ConcurrentDictionary<string, object> wosDataCache = new ConcurrentDictionary<string, object>();

    public CacheAttribute(WOSDbTable dependentTableName, params WOSDbTable[] dependentTableNames)
    {
        this.dependentTableNames = new List<WOSDbTable>();
        this.dependentTableNames.Add(dependentTableName);
        this.dependentTableNames.AddRange(dependentTableNames.Select(tableName => tableName));
    }

      public override void OnEntry(MethodExecutionArgs args)
    {
        object readValue;
        wosDataCache.TryGetValue(cacheKey, out readValue);
        if (readValue != null)
        {
            args.ReturnValue = readValue;
            args.FlowBehavior = FlowBehavior.Return;
        }
    }
    
    public override void OnSuccess(MethodExecutionArgs args)
    {
        if (new DBConnectionCore().RegisterSqlDependency(SqlDependencyChanged, dependentTableNames).Result)
        {
            wosDataCache.TryAdd(cacheKey, args.ReturnValue);
        }
    }

}

public class StaticDataContext : IStaticDataContext, IDynamicMetaObjectProvider where T : IStaticDataModel
{
[Cache(WOSDbTable.LanguageMaster, WOSDbTable.TranslationKeyMaster, WOSDbTable.TranslationMaster)]
public async Task<List> GetStaticDataAsync()
{
DBConnectionCore dbConnectionCore = new DBConnectionCore();
using (IDataReader dataReader = await dbConnectionCore.ExecuteReaderAsync(WOSDbStoredProc.USP_GetStaticData).ConfigureAwait(false))
{
return await dataReader.ToFlatModelAsync().ConfigureAwait(false);
}
}

    public DynamicMetaObject GetMetaObject(Expression parameter)
    {
        return new AspectWeaver(parameter, this);
    }
}

Interception logic is incorrect

PostSharp
https://doc.postsharp.net/m_postsharp_aspects_methodinterceptionargs_proceed

Proceeds with invocation of the method that has been intercepted by calling the next node in the chain of invocation.....

Castle.Core
IInvocation.Proceed

Proceeds the call to the next interceptor in line, and ultimately to the target method.

KingAOP

Each MethodInterceptionAspect has OnInvoke invoked regardless of MethodInterceptionArgs.Proceed.

If n MethodInterceptionAspect invoke Proceed then the statically bound method is invoked n times.

"An entry with the same key already exists."

When creating two attributes it generates an "An entry with the same key already exists."

Ex: I have a method that add user and for this method I created two attributes one that authorization and another that time of excution both work but when set together it generates the error: "An entry with the same key already exists."

LogAspect not working on asp.net web service (asmx)

Hi, I used LogginAspect attribute on web service method call. The first call of the web service for each method logged true. But other calls logged with the first call args. Args not changed between calls like static variable. So LoggingAspect not work on asp.net webservice truely.

I find a bug

When i called the same method twice,it still use the first time arguments,how to fix it ?

Not All Tests are Passing

Just downloaded the code and ran the test and one test fails (OnEntry_ShouldNotChange_StringArgument_PassedAsRef())

attribute based authorisation

pls add standard aspects like attribute based authorisation:

example:

class hello {
[Role("Admin")]
public string l {get;set;}
}

Why should we inherit from : IDynamicMetaObjectProvider

Why are we inheriting from : IDynamicMetaObjectProvider and the object should be type of dynamic. Is it not possible to make it work without changing the object to dynamic type and inheriting from the above Interface ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.