我们正在使用webservice(通过websphere)来提高性能,我们相信我们可以缓存servicedelegate.getport(..)创建的代理,因为每次创建代理都很昂贵。
现在,我们的问题是,它是否安全?只是图像,我们有10个线程同时运行,他们将获取相同的代理,并同时使用它。
THX
答案 0 :(得分:0)
不要让你的应用程序缓存它,只需使用WebServiceRef注入它,让容器为你管理它。
答案 1 :(得分:0)
端口不是线程安全的。它们保持状态,如true
。但是端口对象可以在以后安全地重用!
在调用之前将端口缓存在collectionView.isUserInteractionEnabled = true
和year1<-c("2001","2002","2003")
countries1<-c("Canada","USA","Mexico")
color1<-c("black","red","blue")
year2<-c("2010","2011","2012")
countries2<-c("France","Germany","Japan")
color2<-c("white","yellow","green")
df1<-data.frame(year1,countries1,color1)
df2<-data.frame(year2,countries2,color2)
for (i in c(df1,df2))
{
nb<-nrow(i)
print(nb)
}
中,然后在返回javax.xml.ws.handler.MessageContext
之后返回。
在以下实现中,LinkedBlockingQueue
对象不会从peek
代码中泄漏出来,因此可以安全地重用它:
offer