📄 factorizationimpl.java
字号:
package factorization.service.impl;/** * <p>Title: Factorization Library</p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @author Vladimir Silva * @version 1.0 */import org.globus.ogsa.impl.ogsi.GridServiceImpl;import factorization.service.Factorization.FactorizationPortType;import java.rmi.RemoteException;import javax.math.factorization.Factorizer;/** * Factorization service Implementation */public class FactorizationImpl extends GridServiceImpl implements FactorizationPortType{ public FactorizationImpl() { super("Factorization Service"); } /** * Factorization Method * @param bigNum Number to factor * @param outFile Full path to the server side Output file (Contains factors pd(1)^ exp(1) * ..... * @param options Use "-verbose" to display fac output in the GT server log */ public String factorize(String bigNum, String outFile, String options) throws RemoteException { String[] args = {"-n", bigNum, "-out", outFile, options}; try { Factorizer f = new Factorizer(args); // dump output: to the console or a file f.dumpOutput(); return buildXML(false, "Out in: " + outFile); } catch (Exception ex) { return buildXML(true, ex.getClass().getName() + ": " + ex.getMessage()); } } /* * An XML string is returned w/ service status */ private String buildXML(boolean error, String text) { return "<xml><error>" + error + "</error><text>" + text + "</text></xml>"; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -