6,787
社区成员
发帖
与我相关
我的任务
分享
//初始化context
Properties ejbCCProperties=new Properties();
ejbCCProperties.put("remote.connections","default");
ejbCCProperties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED","false");
ejbCCProperties.put("remote.connection.default.username",userName);
ejbCCProperties.put("remote.connection.default.password",passWd);
ejbCCProperties.put("remote.connection.default.host",host);
ejbCCProperties.put("remote.connection.default.port",port);
final EJBClientConfiguration ejbClientConfiguration=new PropertiesBasedEJBClientConfiguration(ejbCCProperties);
final ContextSelector<EJBClientContext> ejbClientContextSelector=new ConfigBasedEJBClientContextSelector(ejbClientConfiguration);
final ContextSelector<EJBClientContext> previousSelector=EJBClientContext.setSelector(ejbClientContextSelector);
Properties jndiEnvironmentProperties=new Properties();
jndiEnvironmentProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.ejb.client.naming");
return new InitialContext(jndiEnvironmentProperties);