You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by "wu zhi hui (JIRA)" <hi...@jakarta.apache.org> on 2005/07/25 07:47:45 UTC

[jira] Created: (HIVEMIND-142) I can't apply interceptor to my method of serivce

I can't apply interceptor to my method of serivce
-------------------------------------------------

         Key: HIVEMIND-142
         URL: http://issues.apache.org/jira/browse/HIVEMIND-142
     Project: HiveMind
        Type: Improvement
  Components: framework  
    Versions: 1.1    
    Reporter: wu zhi hui


I found your interceptor is "assigned" to a service not method, a method of my service is called can't cause the interceptor executed twice or more ,for example ,hivemind.LoggingInterceptor is applied on service TestService
{
public void bus1();
public void bus2();
public void bus3();
public void flowBus();
}
the impl is 
  public void flowBus()
  {
  this.bus1();
 this.bus2();
 this.bus3();
 }
the LoggingInterceptor  will only log following:
TestService [DEBUG]   BEGIN flowBus()
TestService [DEBUG]   END flowBus()

but I expect it is the following :
TestService [DEBUG]   BEGIN flowBus()
TestService [DEBUG]   BEGIN bus1()
TestService [DEBUG]   BEGIN bus2()
TestService [DEBUG]   BEGIN bus3()

TestService [DEBUG]   END bus3()
TestService [DEBUG]   END bus2()
TestService [DEBUG]   END bus1()
TestService [DEBUG]   END flowBus()

if I have a business service  ,I define my  service transaction  using HaveUtil api
public void createID()           //         transaction define             :RequriesNew
public void createUser()      //         transaction define             :Requries


then ,when I call createUser() method (which call createID() internal ) the transaction interceptor only applied on createUser
not applied on createID() (in  this internal calling ), then my RequriesNew transaction defined falled 
can you give me some good idea?






-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: [jira] Created: (HIVEMIND-142) I can't apply interceptor to my method of serivce

Posted by Achim Huegen <ac...@gmx.de>.
The design of the hivemind interceptor mechanism doesn't allow the 
interception of internal service calls. The reason is that
interceptors are proxy based and the proxies work on the interface
of your service only. That is the interface which is returned by 
hivemind registry.
Since internal calls don't use the interface any longer, the won't get 
intercepted.

To intercept internal calls it would be necessary to manipulate the
bytecode of your service class and intercept class loading.
Not impossible but that's not in hivemind's scope today.

Achim

wu zhi hui (JIRA) wrote:
> I can't apply interceptor to my method of serivce
> -------------------------------------------------
> 
>          Key: HIVEMIND-142
>          URL: http://issues.apache.org/jira/browse/HIVEMIND-142
>      Project: HiveMind
>         Type: Improvement
>   Components: framework  
>     Versions: 1.1    
>     Reporter: wu zhi hui
> 
> 
> I found your interceptor is "assigned" to a service not method, a method of my service is called can't cause the interceptor executed twice or more ,for example ,hivemind.LoggingInterceptor is applied on service TestService
> {
> public void bus1();
> public void bus2();
> public void bus3();
> public void flowBus();
> }
> the impl is 
>   public void flowBus()
>   {
>   this.bus1();
>  this.bus2();
>  this.bus3();
>  }
> the LoggingInterceptor  will only log following:
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   END flowBus()
> 
> but I expect it is the following :
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   BEGIN bus1()
> TestService [DEBUG]   BEGIN bus2()
> TestService [DEBUG]   BEGIN bus3()
> 
> TestService [DEBUG]   END bus3()
> TestService [DEBUG]   END bus2()
> TestService [DEBUG]   END bus1()
> TestService [DEBUG]   END flowBus()
> 
> if I have a business service  ,I define my  service transaction  using HaveUtil api
> public void createID()           //         transaction define             :RequriesNew
> public void createUser()      //         transaction define             :Requries
> 
> 
> then ,when I call createUser() method (which call createID() internal ) the transaction interceptor only applied on createUser
> not applied on createID() (in  this internal calling ), then my RequriesNew transaction defined falled 
> can you give me some good idea?
> 
> 
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Closed: (HIVEMIND-142) I can't apply interceptor to my method of serivce

Posted by "James Carman (JIRA)" <hi...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/HIVEMIND-142?page=all ]
     
James Carman closed HIVEMIND-142:
---------------------------------


> I can't apply interceptor to my method of serivce
> -------------------------------------------------
>
>          Key: HIVEMIND-142
>          URL: http://issues.apache.org/jira/browse/HIVEMIND-142
>      Project: HiveMind
>         Type: Improvement
>   Components: framework
>     Versions: 1.1
>     Reporter: wu zhi hui

>
> I found your interceptor is "assigned" to a service not method, a method of my service is called can't cause the interceptor executed twice or more ,for example ,hivemind.LoggingInterceptor is applied on service TestService
> {
> public void bus1();
> public void bus2();
> public void bus3();
> public void flowBus();
> }
> the impl is 
>   public void flowBus()
>   {
>   this.bus1();
>  this.bus2();
>  this.bus3();
>  }
> the LoggingInterceptor  will only log following:
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   END flowBus()
> but I expect it is the following :
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   BEGIN bus1()
> TestService [DEBUG]   BEGIN bus2()
> TestService [DEBUG]   BEGIN bus3()
> TestService [DEBUG]   END bus3()
> TestService [DEBUG]   END bus2()
> TestService [DEBUG]   END bus1()
> TestService [DEBUG]   END flowBus()
> if I have a business service  ,I define my  service transaction  using HaveUtil api
> public void createID()           //         transaction define             :RequriesNew
> public void createUser()      //         transaction define             :Requries
> then ,when I call createUser() method (which call createID() internal ) the transaction interceptor only applied on createUser
> not applied on createID() (in  this internal calling ), then my RequriesNew transaction defined falled 
> can you give me some good idea?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Resolved: (HIVEMIND-142) I can't apply interceptor to my method of serivce

Posted by "James Carman (JIRA)" <hi...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/HIVEMIND-142?page=all ]
     
James Carman resolved HIVEMIND-142:
-----------------------------------

    Resolution: Invalid

This is not a bug. 

> I can't apply interceptor to my method of serivce
> -------------------------------------------------
>
>          Key: HIVEMIND-142
>          URL: http://issues.apache.org/jira/browse/HIVEMIND-142
>      Project: HiveMind
>         Type: Improvement
>   Components: framework
>     Versions: 1.1
>     Reporter: wu zhi hui

>
> I found your interceptor is "assigned" to a service not method, a method of my service is called can't cause the interceptor executed twice or more ,for example ,hivemind.LoggingInterceptor is applied on service TestService
> {
> public void bus1();
> public void bus2();
> public void bus3();
> public void flowBus();
> }
> the impl is 
>   public void flowBus()
>   {
>   this.bus1();
>  this.bus2();
>  this.bus3();
>  }
> the LoggingInterceptor  will only log following:
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   END flowBus()
> but I expect it is the following :
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   BEGIN bus1()
> TestService [DEBUG]   BEGIN bus2()
> TestService [DEBUG]   BEGIN bus3()
> TestService [DEBUG]   END bus3()
> TestService [DEBUG]   END bus2()
> TestService [DEBUG]   END bus1()
> TestService [DEBUG]   END flowBus()
> if I have a business service  ,I define my  service transaction  using HaveUtil api
> public void createID()           //         transaction define             :RequriesNew
> public void createUser()      //         transaction define             :Requries
> then ,when I call createUser() method (which call createID() internal ) the transaction interceptor only applied on createUser
> not applied on createID() (in  this internal calling ), then my RequriesNew transaction defined falled 
> can you give me some good idea?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


Re: [jira] Commented: (HIVEMIND-142) I can't apply interceptor to my method of serivce

Posted by Achim Hügen <ac...@gmx.de>.
+1

Am Thu, 11 Aug 2005 17:38:54 +0200 (CEST) schrieb James Carman (JIRA) 
<hi...@jakarta.apache.org>:

>     [ http://issues.apache.org/jira/browse/HIVEMIND-142?page=comments#action_12318501 
> ]
>
> James Carman commented on HIVEMIND-142:
> ---------------------------------------
>
> Can we close this one?
>
>> I can't apply interceptor to my method of serivce
>> -------------------------------------------------
>>
>>          Key: HIVEMIND-142
>>          URL: http://issues.apache.org/jira/browse/HIVEMIND-142
>>      Project: HiveMind
>>         Type: Improvement
>>   Components: framework
>>     Versions: 1.1
>>     Reporter: wu zhi hui
>
>>
>> I found your interceptor is "assigned" to a service not method, a 
>> method of my service is called can't cause the interceptor executed 
>> twice or more ,for example ,hivemind.LoggingInterceptor is applied on 
>> service TestService
>> {
>> public void bus1();
>> public void bus2();
>> public void bus3();
>> public void flowBus();
>> }
>> the impl is
>>   public void flowBus()
>>   {
>>   this.bus1();
>>  this.bus2();
>>  this.bus3();
>>  }
>> the LoggingInterceptor  will only log following:
>> TestService [DEBUG]   BEGIN flowBus()
>> TestService [DEBUG]   END flowBus()
>> but I expect it is the following :
>> TestService [DEBUG]   BEGIN flowBus()
>> TestService [DEBUG]   BEGIN bus1()
>> TestService [DEBUG]   BEGIN bus2()
>> TestService [DEBUG]   BEGIN bus3()
>> TestService [DEBUG]   END bus3()
>> TestService [DEBUG]   END bus2()
>> TestService [DEBUG]   END bus1()
>> TestService [DEBUG]   END flowBus()
>> if I have a business service  ,I define my  service transaction  using 
>> HaveUtil api
>> public void createID()           //         transaction 
>> define             :RequriesNew
>> public void createUser()      //         transaction define             
>> :Requries
>> then ,when I call createUser() method (which call createID() internal ) 
>> the transaction interceptor only applied on createUser
>> not applied on createID() (in  this internal calling ), then my 
>> RequriesNew transaction defined falled
>> can you give me some good idea?
>



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Commented: (HIVEMIND-142) I can't apply interceptor to my method of serivce

Posted by "James Carman (JIRA)" <hi...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/HIVEMIND-142?page=comments#action_12318501 ] 

James Carman commented on HIVEMIND-142:
---------------------------------------

Can we close this one?

> I can't apply interceptor to my method of serivce
> -------------------------------------------------
>
>          Key: HIVEMIND-142
>          URL: http://issues.apache.org/jira/browse/HIVEMIND-142
>      Project: HiveMind
>         Type: Improvement
>   Components: framework
>     Versions: 1.1
>     Reporter: wu zhi hui

>
> I found your interceptor is "assigned" to a service not method, a method of my service is called can't cause the interceptor executed twice or more ,for example ,hivemind.LoggingInterceptor is applied on service TestService
> {
> public void bus1();
> public void bus2();
> public void bus3();
> public void flowBus();
> }
> the impl is 
>   public void flowBus()
>   {
>   this.bus1();
>  this.bus2();
>  this.bus3();
>  }
> the LoggingInterceptor  will only log following:
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   END flowBus()
> but I expect it is the following :
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   BEGIN bus1()
> TestService [DEBUG]   BEGIN bus2()
> TestService [DEBUG]   BEGIN bus3()
> TestService [DEBUG]   END bus3()
> TestService [DEBUG]   END bus2()
> TestService [DEBUG]   END bus1()
> TestService [DEBUG]   END flowBus()
> if I have a business service  ,I define my  service transaction  using HaveUtil api
> public void createID()           //         transaction define             :RequriesNew
> public void createUser()      //         transaction define             :Requries
> then ,when I call createUser() method (which call createID() internal ) the transaction interceptor only applied on createUser
> not applied on createID() (in  this internal calling ), then my RequriesNew transaction defined falled 
> can you give me some good idea?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org


[jira] Commented: (HIVEMIND-142) I can't apply interceptor to my method of serivce

Posted by "Knut Wannheden (JIRA)" <hi...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/HIVEMIND-142?page=comments#action_12316648 ] 

Knut Wannheden commented on HIVEMIND-142:
-----------------------------------------

"Internal" service method calls will not be intercepted by the HiveMind interceptors. As a "workaround" you can inject the service into itself and subsequently invoke the internal calls on that. E.g.

public class MyServiceImpl implements MyService
{
  private MyService _self;

  public void setSelf(MyService service)
  {
    _self = service;
  }
}

You'll need a corresponding <set-service> in the service's <invoke-factory> constructor.

> I can't apply interceptor to my method of serivce
> -------------------------------------------------
>
>          Key: HIVEMIND-142
>          URL: http://issues.apache.org/jira/browse/HIVEMIND-142
>      Project: HiveMind
>         Type: Improvement
>   Components: framework
>     Versions: 1.1
>     Reporter: wu zhi hui

>
> I found your interceptor is "assigned" to a service not method, a method of my service is called can't cause the interceptor executed twice or more ,for example ,hivemind.LoggingInterceptor is applied on service TestService
> {
> public void bus1();
> public void bus2();
> public void bus3();
> public void flowBus();
> }
> the impl is 
>   public void flowBus()
>   {
>   this.bus1();
>  this.bus2();
>  this.bus3();
>  }
> the LoggingInterceptor  will only log following:
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   END flowBus()
> but I expect it is the following :
> TestService [DEBUG]   BEGIN flowBus()
> TestService [DEBUG]   BEGIN bus1()
> TestService [DEBUG]   BEGIN bus2()
> TestService [DEBUG]   BEGIN bus3()
> TestService [DEBUG]   END bus3()
> TestService [DEBUG]   END bus2()
> TestService [DEBUG]   END bus1()
> TestService [DEBUG]   END flowBus()
> if I have a business service  ,I define my  service transaction  using HaveUtil api
> public void createID()           //         transaction define             :RequriesNew
> public void createUser()      //         transaction define             :Requries
> then ,when I call createUser() method (which call createID() internal ) the transaction interceptor only applied on createUser
> not applied on createID() (in  this internal calling ), then my RequriesNew transaction defined falled 
> can you give me some good idea?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-dev-help@jakarta.apache.org