Announcement Announcement Module
Collapse
No announcement yet.
Proxied object export problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Proxied object export problem

    Hello, dear community.

    I have a proxied object with transaction management advices applied to it. I am trying to get the target from it:

    Code:
    myProxiedObject.getTargetSource().getTarget()
    and publish the resulting target with MBeanExporter:

    Code:
    <bean class="org.springframework.jmx.export.MBeanExporter">
        <property name="beans">
          <map>
            <entry key="Systems:someName" value-ref="target" />
          </map>
        </property>
      </bean>
    but in jconsole I still see a bulk of methods and fields from proxy and more - I can invoke them! But i'd like to have only business logic methods from the target (as I see in jconsole when not applying any advice) and not aop-proxy related stuff.

    What wrong am I doing?
    Last edited by Bohtvaroh; Jan 13th, 2008, 01:29 AM.

  • #2
    As debugger says:

    target.getClass().getName() -xxxxxx.somesystem.solution1.service1.service.Servi ce1Impl

    proxy.getClass().getName() - $Proxy9

    But it looks like $Proxy9 is exported anyway. :-S

    Comment


    • #3
      This helps, but it's not right problem solution.

      Code:
        <!-- Register Service as MBean -->
        <bean class="org.springframework.jmx.export.MBeanExporter">
          <property name="beans">
            <map>
              <entry key="Systems:name=somename" value-ref="myObjectProxy" />
            </map>
          </property>
          <property name="assembler" ref="serviceMBeanInfoAssembler" />
        </bean>
      
        <bean name="serviceMBeanInfoAssembler" class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
          <property name="managedInterfaces">
            <list>
              <value>myBusinessObjectInterface</value>
            </list>
          </property>
        </bean>

      Comment

      Working...
      X