JNDI binding and multi-channel transmission in EJB3.0

xiaoxiao2021-03-06  38

JNDI binding and multi-channel transmission in EJB3.0

The default session bean is bound to JNDI with the full name of the path or remote interface. You can modify it by defining your own @ org.jboss.ejb3.localbinding or @ org.jboss.ejb3.remoting.Remotebinding

JNDI binding of local interface

Use org.jboss.ejb3.localbinding annotation to change the JNDI name of your local interface.

@StateLess

@Localbinding (JNDIBINDING = "Custom / MySession")

Public Class MySessionBean Implements MySession

{

}

JNDI binding of the remote interface

Use Org.jboss.ejb3.Remotebindings Annotation to change the JNDI name of your remote interface.

@StateLess

@Remotebindings ({@ remotebinding (jndiname = "custom / remote / mysession")})

Public Class MySessionBean Implements MySession

{

}

Multi-channel transmission and client interception (Multiple Transports and Client Interceptors

)

You can show a session bean remote call through multi-channel transmission through the JBoss Remoting architecture. Now just some plugins support. You can see how to define the transfer MBean in the JBoss document. To show a session bean, you need to transfer you through multi-channel you need to use a remote binding annotation.

Public @Interface remotebinding

{

String JNDibinding () Default "";

String InterceptorStack () Default "sessionbeanclientinterCeptors";

String ClientBindurl ();

Class factory () default org.jboss.ejb3.remoting.RemoteProxyFactory.class;

}

JNDI binding specifies the JNDI name that the agent will bundle.

InterceptorStack allows you to insert data into a JBoss AOP (stack structure). Session Bean Client Interceptor (SESSIONBEANCLIENTERCEPTORS) stack can be found in the EJB3-Interceptors-Aop.xml configuration file in your deployment folder.

ClientBindurl defines the JBoss remote URL that the client is bound to the server.

Factory allows you to intercept your own agent's bean. You usually do not need to touch these settings.

Here is an example:

@StateLess

@RemoteBindings ({

@Remotebinding (JNDINAME = "Custom / Remote / MySession",

InterceptorStack = "MyInterceptorStack",

ClientBindurl = "socket: //foo.jboss.org: 2222")

})

Public Class MySessionBean Implements MySession

{

}

转载请注明原文地址:https://www.9cbs.com/read-65843.html

New Post(0)