?? clienttransportmodule.java
字號:
package dli2fe.helpers;
/**
* Title: Digial Library Interoperable Interface Fudan Edition
* Description: This project contains all the classes required for DLI2FE interface. Developers use these classes to implement the wrapper and client side codes. The basic functions of DLI2FE is as follows:
* Search: Search a digital library source site.
* Metadata: Fetch metadata for a site.
* ResultAccess: Get results for a given query.
* DLI2FE uses Dublin Core as the basic attribute model, DAV/DASL as the general XML-based query language and CORBA as distributed object transportation mechanism.
* Copyright: Copyright (c) 2001
* Company: Fudan University
* @author Carl Tao
* @version 1.0
*/
import dli2fe.*;
import java.util.Hashtable;
public abstract class ClientTransportModule implements Metadata, Searcher, ResultAccess{
static Hashtable tms = new Hashtable();
static boolean isInited = false;
abstract public void setLspURI(String uri) throws DLI2FEException;
static void init() {
isInited = true;
/* register handlers for http and dli2fens */
tms.put("http", "dli2fe.helpers.ClientCORBATransport");
tms.put(DLI2FE.NameServerURISchema, "dli2fe.helpers.ClientCORBATransport");
}
public static final ClientTransportModule create(String uri) throws DLI2FEException {
if (!isInited)
init();
Class cls = null;
int i = uri.indexOf(":");
if (i > 0) {
String prefix = uri.substring(0, i).toLowerCase();
String className = (String)tms.get(prefix);
if (className != null) {
try {
cls = Class.forName(className);
} catch (Exception any) {};
}
}
if (cls == null) {
throw new RuntimeException("[Client Transport] Do not know how to create transprot for " + uri);
}
try {
ClientTransportModule tm = (ClientTransportModule)cls.newInstance();
tm.setLspURI(uri);
return tm;
} catch (Exception any) {
if (any instanceof DLI2FEException)
throw (DLI2FEException)any;
else
throw new RuntimeException("[Client Transport] Can not create transport module: " + any);
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -