📄 bbsclient.java
字号:
/**
* Client.java Created on 2003-12-8
*
*/
package com.liuyang.ejb.cmp.bbs.client;
/**
* @author liuyang
*
*/
public class BBSClient {
public static void main(String[] args) throws Exception {
/*Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL,"localhost");
Context iniCtx = new InitialContext(env);
Object objRef = iniCtx.lookup("cmp/BBS");
BBSHome home = (BBSHome)PortableRemoteObject.narrow(objRef, BBSHome.class);
Collection col = home.findALLOrderByTime();
if((col!=null)&&(!col.isEmpty())){
Iterator it = col.iterator();
while(it.hasNext()){
BBS bbs = (BBS) (it.next());
System.out.println("time = "+bbs.getTime()+" text = "+bbs.getText());
}
}else{
for(int i=0;i<100;i++){
boolean v = false;
while(!v){
long t1 = System.currentTimeMillis();
Collection bss = home.findByTime(new Long(t1));
if((bss!=null)&&(!bss.isEmpty())){
System.out.println("wait for "+t1);
}else{
home.create(new Long(System.currentTimeMillis()),"hello");
v = true;
}
}
}
}*/
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -