日期:2014-05-16 浏览次数:20910 次
String page = ServerContextFactory.get().getContextPath() + "[发送的页面]";
Browser.withPage(page,new Runnable(){
public void run() {}
});
final String page = ServerContextFactory.get().getContextPath() + "[发送的页面]";
ScriptSessionFilter attributeFilter = new AttributeScriptSessionFilter(SCRIPT_SESSION_ATTR);
Browser.withPageFiltered(page, attributeFilter, new Runnable(){public void run() {}
});
Browser.withSession(session.getId(), new Runnable(){
public void run() {
Collection<ScriptSession> coll = TaskDispatcherFactory.get().getTargetSessions();
for(ScriptSession s : coll){
s.addScript(new ScriptBuffer().appendScript("receiveMsg(").appendData(message).appendScript(")"));
}
}
});
ScriptSessions.addFunctionCall("[javascript方法]", "[参数]");public class DaemonThreadFactory implements ThreadFactory {
private static final DaemonThreadFactory daemonThreadFactory =new DaemonThreadFactory();
public static DaemonThreadFactory getInstance(){
return daemonThreadFactory;
}
public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setDaemon(true);
return t;
}
}