EJB Remote/Local 绑定和JNDI Lookup
来源:互联网 发布:linux vi退出保存 编辑:程序博客网 时间:2024/05/17 18:16
这样在注入的时候直接public interface RemoteTest {
public static final String NAME = "Test/RemoteTest";
public static final String JNDI_NAME = "Test/RemoteTest/remote";
public String getTest();
/**
* Local interface for session bean
*/
public static interface Local extends RemoteTest{}
/**
* Remote interface for session bean
*/
public static interface Remote extends RemoteTest{}
}
Get EJB instance by lookup global in java: Namespace.
Syntax: java:global/<ear-name>/<jar-name>/<bean-name>[!<fully-qualified-interface-name>]
Sample:
SampleBean implements SampleBeanRemote
interface SampleBeanRemote
{
JNDI_NAME="SampleBean";
}
sampleBeanInstance = (SampleBeanRemote)lookupByGlobal(SampleBeanLocal.JNDI_NAME);
Get EJB instance by lookup app in java: Namespace.
Note: Only effect when the expect bean is in the same ear file with the POJO calling this method.
Syntax: java:app/<jar-name>/<bean-name>[!<fully-qualified-interface-name>]
Sample:
SampleBean implements SampleBeanLocal
interface SampleBeanLocal
{
NAME="SampleBean";
}
sampleBeanInstance = (SampleBeanLocal)lookupByApp(SampleBeanLocal.NAME);
Get EJB instance by lookup module in java: Namespace.
Note: Only effect when the expect bean is in the same jar file with the POJO calling this method.
Syntax: java:module/<bean-name>[!<fully-qualified-interface-name>]
Sample:
SampleBean implements SampleBeanLocal
SampleBeanLocal
{
NAME="SampleBean";
}
sampleBeanInstance = (SampleBeanLocal)lookupByModule(SampleBeanLocal.NAME);
方便快捷。RemoteTest rt = (RemoteTest)ctx.lookup(RemoteTest.JNDI_NAME);
- EJB Remote/Local 绑定和JNDI Lookup
- EJB的Remote访问方式和Local访问方式
- 解读Ejb中Local与Remote项目
- EJB Local与Remote接口区别
- 菜鸟学EJB(二)——在同一个SessionBean中使用@Remote和@Local
- EJB invocations from a remote client using JNDI
- EJB invocations from a remote client using JNDI
- EJB invocations from a remote client using JNDI
- local和remote的区别
- local和remote的区别
- remote和local 的区别
- Tomcat web工程 调用 JBOSS EJB local及remote
- EJB学习笔记四((@Remote与@Local的差异)
- Binding & Remote Lookup of Custom Objects in JNDI tree of JBoss AS7.1.1
- 绑定Lookup
- WebLogic v9.2 EJB和JNDI Demo
- jndi(是什么)和ejb容器的关系
- remote和local servi的区别
- JMX 使用(原创)
- EJB3 事务管理(转)
- 验证IP和HostName
- 给Jboss配置 remote data source生成表
- Git同时使用多个ssh(转)
- EJB Remote/Local 绑定和JNDI Lookup
- android opensource
- 解决死锁问题。。。
- Axis2传递date类型参数丢失时分秒
- Jboss的server.log时间跟系统时间不一致
- Manifesto for Software Craftsmanship
- Maven download javadoc or source code
- 分析Java 死锁以及MemoryLeak问题
- 学习wordPress