package com.youthlin.javaee.ejb.stateless;
import javax.ejb.Remote;
/**
* Created by lin on 2016-05-19-019.
* 无状态会话 Bean 接口
*/@Remote
public interface SayHello {
String sayHello(String name);
}
package com.youthlin.javaee.ejb.stateless.impl;
import com.youthlin.javaee.ejb.stateless.SayHello;
import javax.ejb.Stateless;
/**
* Created by lin on 2016-05-19-019.
* 接口实现类
*/@Stateless
public class SayHelloImpl implements SayHello {
@Override
public String sayHello(String name) {
return"Hello, "+ name;
}
}
端口用8080
Here we are listing 2 connections named "one" and "two". Ultimately, each of the connections will map to a EJB receiver. So if you have 2 connections, that will setup 2 EJB receivers that will be added to the EJB client context. Each of these connections will be configured with the connection specific properties as follows:
remote.connection.default.host=10.20.30.40
remote.connection.default.port = 8080
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
As you can see we are using the "remote.connection.." prefix for specifying the connection specific property. The connection name here is "default" and we are setting the "host" property of that connection to point to 10.20.30.40. Similarly we set the "port" for that connection to 4447.参见:http://bbs.csdn.net/topics/390798267#post-398647327
Reader Echoes
4 comments