EJBFactory3
来源:互联网 发布:图纸打印软件 编辑:程序博客网 时间:2024/05/17 05:18
private void getInitialContext(String url) throws Exception
{
try
{
Properties properties = new Properties();
if (isWeblogicVersion)
{
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
this.INITIAL_CONTEXT_FACTORY_WEBLOGIC);
properties.setProperty(Context.PROVIDER_URL, url);
}
else
{
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
this.INITIAL_CONTEXT_FACTORY_WEBSPHERE);
properties.setProperty(Context.PROVIDER_URL, url);
properties.setProperty("com.ibm.ws.orb.transport.ConnectionInterceptorName",
"com.ibm.ws.orb.transport.DefaultConnectionInterceptor");
}
initContext = new InitialContext(properties);
}
catch (Exception e)
{
e.printStackTrace();
throw new Exception(e);
}
}