Juni 27th, 2006

MBean per JNDI zur Verfügung stellen

Posted by frank in Java, J2EE

Um ein MBean, wie z.B. einen TreeCache, auch per JNDI zur Verfügung zu stellen, muss lediglich ein weiteres MBean erstellt werden. Dazu wird in die entsprechende Service.xml-Datei folgender Code am Ende eingefügt:

<?xml version=”1.0″ encoding=“UTF-8″?>
<server><mbean
          code=org.jboss.invocation.jrmp.server.JRMPProxyFactory

          name=mydomain:service=proxyFactory,type=jrmp,target=factory>
          <attribute name=InvokerName>jboss:service=invoker,type=jrmp</attribute>

          <attribute name=TargetName>jboss.cache:service=MyTreeCache</attribute>
          <attribute name=JndiName>MyCache</attribute>

          <attribute name=InvokeTargetMethod>true</attribute>
          <attribute name=ExportedInterface>org.jboss.cache.TreeCacheMBean</attribute>

          <attribute name=ClientInterceptors>
              <iterceptors>
                    <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>

                    <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
                  <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
              </iterceptors>
          </attribute>

          <depends>jboss:service=invoker,type=jrmp</depends>
          <depends>jboss.cache:service=MyTreeCache</depends>
    </mbean> 

</server>

Es wird dazu die JrmpProxyFactory verwendet um den Zugriff zu ermöglichen.

No Responses to ' MBean per JNDI zur Verfügung stellen '

Subscribe to comments with RSS or TrackBack to ' MBean per JNDI zur Verfügung stellen '.

Leave a reply

:mrgreen: :neutral: :twisted: :shock: :smile: :???: :cool: :evil: :grin: :oops: :razz: :roll: :wink: :cry: :eek: :lol: :mad: :sad: