Using interceptors in WebSphere AS - Websphere

This is a discussion on Using interceptors in WebSphere AS - Websphere ; Hello! I want to intercept method invocations to EJB components. Is there any mechanism which allows to check and control the data passed through the invocation? In JBoss, for instance, there is a stack of interceptors, and every invocation is ...

+ Reply to Thread
Results 1 to 16 of 16

Thread: Using interceptors in WebSphere AS

  1. Using interceptors in WebSphere AS

    Hello!
    I want to intercept method invocations to EJB components.
    Is there any mechanism which allows to check and control the data passed through the invocation? In JBoss, for instance, there is a stack of interceptors, and every invocation is passing through it.
    I want to intercept not just some methods of my component, but all method invocations in the container. Where can I configure stack of interceptors for the EJB container?

  2. Re: Using interceptors in WebSphere AS

    This will be supported to some extent in WebSphere's implementation of the EJB 3.0 spec, which provides a standardized interceptor model.

    mutilin@ispras.ru wrote:
    > Hello!
    > I want to intercept method invocations to EJB components.
    > Is there any mechanism which allows to check and control the data passed through the invocation? In JBoss, for instance, there is a stack of interceptors, and every invocation is passing through it.
    > I want to intercept not just some methods of my component, but all method invocations in the container. Where can I configure stack of interceptors for the EJB container?


  3. WAS v6

    Are there any such mechanism in WAS v6?

    As for EJB 3.0, adding interceptors requires annotations that is modification of source code, while I need mechanism without modification of component source code.

  4. Re: WAS v6

    mutilin@ispras.ru wrote:
    > Are there any such mechanism in WAS v6?


    No
    >
    > As for EJB 3.0, adding interceptors requires annotations that is
    > modification of source code, while I need mechanism without
    > modification of component source code.


    What are you trying to achieve with these interceptors? Maybe we can
    propose an alternative solution if we know why you think you need this
    non-standard feature.


  5. Re: WAS v6

    >What are you trying to achieve with these interceptors? Maybe we can
    >propose an alternative solution if we know why you think you need this
    >non-standard feature.

    It would be great! I want to suspend certains invocations of EJB components to test defferent interleavings of these invocations. To check that component works fine regardless of thread/process schedulling and network delays.

    To accomplish this, I need to pass the control before execution of invocation of EJB method to my method, in which I can suspend or continue invocation.

  6. Re: WAS v6

    Adding interceptors in EJB 3.0 does not require modification of source code -- interceptors can be defined using XML instead. Or you may use a combination of both. In general, all EJB3 functions that can be defined using annotations can alternately be defined using XML.

    mutilin@ispras.ru wrote:
    > Are there any such mechanism in WAS v6?
    >
    > As for EJB 3.0, adding interceptors requires annotations that is modification of source code, while I need mechanism without modification of component source code.


  7. Re: WAS v6

    mutilin@ispras.ru wrote:
    >> What are you trying to achieve with these interceptors? Maybe we
    >> can propose an alternative solution if we know why you think you
    >> need this non-standard feature.


    > It would be great! I want to suspend certains invocations of EJB
    > components to test defferent interleavings of these invocations. To
    > check that component works fine regardless of thread/process
    > schedulling and network delays.


    I don't understand why you would want to do this. Are you testing to see
    if the container actually works? That is guaranteed by compliance to the
    J2EE specification, and if you find problems you can report them to IBM
    through normal support channels. It would seem to be more productive for
    you to test your own code, rather than our code ...

  8. Re: WAS v6

    >I don't understand why you would want to do this. Are you testing to see
    >if the container actually works? That is guaranteed by compliance to the
    >J2EE specification, and if you find problems you can report them to IBM
    >through normal support channels. It would seem to be more productive for
    >you to test your own code, rather than our code ...


    I don't want to test IBM container implementation. I want to test concurrent issues of my application. It is true that container do much work to control the concurrency, but there is still a room for errors.
    I found at least three sources of errors:
    1. If I do some synchronization to shared data manually, I can do something wrong.
    2. The incorrect settings of transaction context (Required, ...)
    3. Wrong database isolation level (Read uncommited, ...)



  9. Re: WAS v6

    >Adding interceptors in EJB 3.0 does not require modification of source code --
    >interceptors can be defined using XML instead. Or you may use a combination
    >of both. In general, all EJB3 functions that can be defined using annotations
    >can alternately be defined using XML.

    It is good, that there is no need to modify the code.
    Are you planning to make some mechanism for configuration the containers of all aplications working in the same profile? For instance, suppose that I need to add some extra security checks for each incoming call, how can I do that?



  10. Re: WAS v6

    mutilin@ispras.ru wrote:
    >> I don't understand why you would want to do this. Are you testing to see
    >> if the container actually works? That is guaranteed by compliance to the
    >> J2EE specification, and if you find problems you can report them to IBM
    >> through normal support channels. It would seem to be more productive for
    >> you to test your own code, rather than our code ...


    > I don't want to test IBM container implementation. I want to test concurrent issues of my application. It is true that container do much work to control the concurrency, but there is still a room for errors.
    > I found at least three sources of errors:
    > 1. If I do some synchronization to shared data manually, I can do something wrong.
    > 2. The incorrect settings of transaction context (Required, ...)
    > 3. Wrong database isolation level (Read uncommited, ...)
    >


    You can test this without needing interceptors. Lots of people already
    do. You just need good test tools.

  11. Re: WAS v6

    mutilin@ispras.ru wrote:
    >> Adding interceptors in EJB 3.0 does not require modification of
    >> source code -- interceptors can be defined using XML instead. Or
    >> you may use a combination of both. In general, all EJB3 functions
    >> that can be defined using annotations can alternately be defined
    >> using XML.


    > It is good, that there is no need to modify the code. Are you
    > planning to make some mechanism for configuration the containers of
    > all aplications working in the same profile? For instance, suppose
    > that I need to add some extra security checks for each incoming call,
    > how can I do that?
    >

    You can do that now, using JAAS login modules.

  12. Re: WAS v6

    >You can test this without needing interceptors. Lots of people already
    >do. You just need good test tools.

    Please, could you recommend good tools for testing concurrency issues?

  13. Re: WAS v6

    mutilin@ispras.ru wrote:
    >> You can test this without needing interceptors. Lots of people already
    >> do. You just need good test tools.

    > Please, could you recommend good tools for testing concurrency issues?


    Well, you can use any performance test tool to hit your application with
    load and then you can use a tool like ITCAM for WebSphere to see where
    you are bottlenecking and to drill down into any specifics of where the
    app is locking.

  14. Re: Interceptors

    While I can't commit to any specific future functions, I do feel that a "system-level interceptor" capability for administrators to configure default EJB3-style interceptors that apply to all applications running within a given server configuration would be a very useful feature.

    Randy

    mutilin@ispras.ru wrote:
    >> Adding interceptors in EJB 3.0 does not require modification of source code --
    >> interceptors can be defined using XML instead. Or you may use a combination
    >> of both. In general, all EJB3 functions that can be defined using annotations
    >> can alternately be defined using XML.

    > It is good, that there is no need to modify the code.
    > Are you planning to make some mechanism for configuration the containers of all aplications working in the same profile? For instance, suppose that I need to add some extra security checks for each incoming call, how can I do that?
    >
    >


  15. Re: Using interceptors in WebSphere AS

    Will Websphere support EJB3 soon??

    > This will be supported to some extent in WebSphere's
    > implementation of the EJB 3.0 spec, which provides a
    > standardized interceptor model.
    >
    > mutilin@ispras.ru wrote:
    > > Hello!
    > > I want to intercept method invocations to EJB

    > components.
    > > Is there any mechanism which allows to check and

    > control the data passed through the invocation? In
    > JBoss, for instance, there is a stack of
    > interceptors, and every invocation is passing through
    > it.
    > > I want to intercept not just some methods of my

    > component, but all method invocations in the
    > container. Where can I configure stack of
    > interceptors for the EJB container?




  16. Re: Using interceptors in WebSphere AS

    There's already an Alpha version of the WebSphere 6.1 Feature Pack for EJB3 available at https://www14.software.ibm.com/iwm/w...ere/was61ejb3/ . Beta and GA versions are planned but no dates have been announced.

    Randy

    thiago@softplan.com.br wrote:
    > Will Websphere support EJB3 soon??
    >
    >> This will be supported to some extent in WebSphere's
    >> implementation of the EJB 3.0 spec, which provides a
    >> standardized interceptor model.
    >>
    >> mutilin@ispras.ru wrote:
    >>> Hello!
    >>> I want to intercept method invocations to EJB

    >> components.
    >>> Is there any mechanism which allows to check and

    >> control the data passed through the invocation? In
    >> JBoss, for instance, there is a stack of
    >> interceptors, and every invocation is passing through
    >> it.
    >>> I want to intercept not just some methods of my

    >> component, but all method invocations in the
    >> container. Where can I configure stack of
    >> interceptors for the EJB container?

    >
    >


+ Reply to Thread