[Design the new POJO MicroContainer] - InterceptorSimpleIfaceDeploymentTestCase
by scott.stark@jboss.org
I added a test of intercepting a bean which implements an interface, but I can't get the exact behavior I'm looking for. I want to only intercept the iPOJO interface methods on beans implementing iPOJO. To get interception I had to specify all methods on beans implementation iPOJO. The commented out interceptor element fails:
| <deployment xmlns="urn:jboss:bean-deployer:2.0">
|
| <bean name="AspectManager" class="org.jboss.aop.AspectManager">
| <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
| </bean>
|
| <interceptor xmlns="urn:jboss:aop-beans:1.0" class="org.jboss.test.microcontainer.beans.TestInterceptor"/>
| <!-- This works -->
| <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* $instanceof{org.jboss.test.microcontainer.beans.iPOJO}->*(..))">
| <interceptor-ref name="org.jboss.test.microcontainer.beans.TestInterceptor"/>
| </bind>
| <!-- This does not work?
| <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* $instanceof{org.jboss.test.microcontainer.beans.iPOJO}->$implements(org.jboss.test.microcontainer.beans.iPOJO))">
| <interceptor-ref name="org.jboss.test.microcontainer.beans.TestInterceptor"/>
| </bind>
| -->
|
| <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
|
| </deployment>
|
I'm following the syntax from the ref guide:
http://www.jboss.org/jbossaop/docs/2.0.0.GA/docs/aspect-framework/referen...
What's wrong with that expression or this usage?
The test is in the jboss-aop-mc-int project as org.jboss.test.microcontainer.beans.test.InterceptorSimpleIfaceDeploymentTestCase
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192337#4192337
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192337
15 years, 7 months
[Design of POJO Server] - DU cannot supply own demands?
by ALRubinger
I've got https://jira.jboss.org/jira/browse/EJBTHREE-1603.
The construct is:
@Stateless
| @Remote(SelfDependencyRemoteBusiness.class)
| @Local(SelfDependencyLocalBusiness.class)
| public class SelfDependencyBean implements SelfDependencyLocalBusiness, SelfDependencyRemoteBusiness
| {
| @EJB
| private SelfDependencyLocalBusiness local;
|
| ...
| }
...so the EJB both supplies and demands the local view.
22:04:16,092 INFO [JBossASKernel] Created KernelDeployment for: ejbthree1603.jar
| 22:04:16,093 INFO [JBossASKernel] installing bean: jboss.j2ee:jar=ejbthree1603.jar,name=SelfDependencyBean,service=EJB3
| 22:04:16,093 INFO [JBossASKernel] with dependencies:
| 22:04:16,093 INFO [JBossASKernel] and demands:
| 22:04:16,093 INFO [JBossASKernel] jndi:SelfDependencyBean/local-org.jboss.ejb3.test.ejbthree1603.SelfDependencyLocalBusiness
| 22:04:16,093 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
| 22:04:16,093 INFO [JBossASKernel] and supplies:
| 22:04:16,094 INFO [JBossASKernel] jndi:SelfDependencyBean/remote-org.jboss.ejb3.test.ejbthree1603.SelfDependencyRemoteBusiness
| 22:04:16,094 INFO [JBossASKernel] jndi:SelfDependencyBean/local-org.jboss.ejb3.test.ejbthree1603.SelfDependencyLocalBusiness
| 22:04:16,094 INFO [JBossASKernel] Class:org.jboss.ejb3.test.ejbthree1603.SelfDependencyLocalBusiness
| 22:04:16,094 INFO [JBossASKernel] jndi:SelfDependencyBean/remote
| 22:04:16,094 INFO [JBossASKernel] Class:org.jboss.ejb3.test.ejbthree1603.SelfDependencyRemoteBusiness
| 22:04:16,094 INFO [JBossASKernel] jndi:SelfDependencyBean/local
| 22:04:16,094 INFO [JBossASKernel] Added bean(jboss.j2ee:jar=ejbthree1603.jar,name=SelfDependencyBean,service=EJB3) to KernelDeployment of: ejbthree1603.jar
Yet we get:
22:04:16,155 WARN [MainDeployer] Failed to deploy: file:/home/alrubinger/business/jboss/wc/jbossas/projects/ejb3/trunk/testsuite/target/test-lib/ejbthree1603.jar
| org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
|
| *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
|
| jboss.j2ee:jar=ejbthree1603.jar,name=SelfDependencyBean,service=EJB3
| -> <UNKNOWN jboss.j2ee:jar=ejbthree1603.jar,name=SelfDependencyBean,service=EJB3>{Described:** UNRESOLVED Demands 'jndi:SelfDependencyBean/local-org.jboss.ejb3.test.ejbthree1603.SelfDependencyLocalBusiness' **}
|
|
| *** CONTEXTS IN ERROR: Name -> Error
|
| <UNKNOWN jboss.j2ee:jar=ejbthree1603.jar,name=SelfDependencyBean,service=EJB3> -> ** UNRESOLVED Demands 'jndi:SelfDependencyBean/local-org.jboss.ejb3.test.ejbthree1603.SelfDependencyLocalBusiness' **
S,
ALR
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192327#4192327
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192327
15 years, 7 months