Archived

This forum has been archived. Please start a new discussion on GitHub.

custom meta data directives

Hi,

Is there in any support in ICE to create custom meta data directives to influence the code that is generated from the slice files?

My goal is to provide some interception capabilities to allow changes or operations to occur to the invocations both before and after they are processed by the actual object. Currently i am achieving this by creating a BlobObject that calls interception code before forwarding the actual request.

However this method prevents collocation optimizations and is becoming cumbersome to work with. Being able to add meta data directives that create interception into the generated code would seem to be a far cleaner solution.

Is there any support for custom meta data directives, or is the source available to the slice compilers such that new directives could be added?

Comments

  • marc
    marc Florida
    Why not simply use a servant locator? You can execute code before and after an operation is dispatched in the locate() and finished() methods.

    The source code of the Slice compilers is available in our Ice for C++ source distributions.
  • If i were to implement interception through the servant locator would i not bind anything to the adapter but instead make my own copy of a lookup table in my own servant locater and use that to return objects?

    Will collocated operations still get invoked through the servant locator?

    Am i right in assuming that the servant locator can not get or alter information such as method parameters, or is there a way in which we can get access to these too?

    Thanks for any help you can offer
  • marc
    marc Florida
    Greenhippo wrote: »
    If i were to implement interception through the servant locator would i not bind anything to the adapter but instead make my own copy of a lookup table in my own servant locater and use that to return objects?

    Yes, you would have to maintain your own active servant map.
    Greenhippo wrote: »
    Will collocated operations still get invoked through the servant locator?

    Yes.
    Greenhippo wrote: »
    Am i right in assuming that the servant locator can not get or alter information such as method parameters, or is there a way in which we can get access to these too?

    A servant locator cannot access or alter parameters.