📄 service.java
字号:
/* * Service.java * * Created on Apr 29, 2004 * */package gov.nist.security.bcs;/** * @author Jean Deruelle <jean.deruelle@nist.gov> * * <a href="{@docRoot}/uncopyright.html">This code is in the public domain.</a> */public class Service { /**process which is the service running in another JVM*/ private Process process; /**the main class' fully qualified name of the service*/ private String mainClass = null; /**the name of the file which has been uplaoded (either a jar file or .class file)*/ private String fileName = null; /**lag to know if the RewriterProcessor must * rewrite the bytecode before executing the service or if it has already been rewritten*/ private boolean toRewrite = false; /**The type of service uploaded (Actually only support Java or SLEE)*/ protected String serviceType=null; /** * */ public Service(String mainClass, String fileName, boolean toRewrite, String serviceType) { this.mainClass=mainClass; this.fileName=fileName; this.toRewrite=toRewrite; this.serviceType=serviceType; } /** * Retrieve the process representing the service * @return process which is the service running in another JVM */ public Process getProcess(){ return process; } /** * Set the process representing the service * @param process - process which is the service running in another JVM */ public void setProcess(Process process){ this.process=process; } /** * check if the process is still running * @return true if the process is running */ public boolean isRunning(){ if(process==null) return false; try{ process.exitValue(); return false; } catch(IllegalThreadStateException itse){ return true; } } /** * Retrieve the uploaded file name of the service * @return the uploaded file name of the service */ public String getFileName() { return fileName; } /** * Set the uploaded file name of the service * @param fileName - the uploaded file name of the service */ public void setFileName(String fileName) { this.fileName=fileName; } /** * Retrieve the main class' fully qualified name of the service * @return the main class' fully qualified name of the service */ public String getMainClass() { return mainClass; } /** * Set the main class' fully qualified name of the service * @param mainClass - the main class' fully qualified name of the service */ public void setMainClass(String mainClass) { this.mainClass=mainClass; } /** * Retrieve the flag to know if the RewriterProcessor must * rewrite the bytecode before executing the service or if it has already been rewritten * @return flag to know if the RewriterProcessor must * rewrite the bytecode before executing the service or if it has already been rewritten */ public boolean getToRewrite() { return toRewrite; } /** * Set the flag to know if the RewriterProcessor must * rewrite the bytecode before executing the service or if it has already been rewritten * @param toRewrite - the flag to know if the RewriterProcessor must * rewrite the bytecode before executing the service or if it has already been rewritten */ public void setToRewrite(boolean toRewrite) { this.toRewrite=toRewrite; } /** * Retrieve the type of service which is gonna be uploaded * @return the type of service which is gonna be uploaded */ public String getServiceType() { return serviceType; } /** * Set the type of service which is gonna be uploaded * @param serviceType - the type of service which is gonna be uploaded */ public void setServiceType(String serviceType) { this.serviceType = serviceType; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -