public class Hotswaper extends Object
Modifier and Type | Class and Description |
---|---|
class |
Hotswaper.ClassFileInfo
Class 文件信息
|
Constructor and Description |
---|
Hotswaper()
构造函数
|
Hotswaper(String agentJarPath)
构造函数
|
Modifier and Type | Method and Description |
---|---|
void |
autoReload(int intervals)
自动热加载 Class
|
void |
cancelAutoReload()
取消自动热加载操作
|
List<Hotswaper.ClassFileInfo> |
getClassFileInfos() |
int |
getReloadIntervals()
获取当前自动热部署间隔事件
|
void |
reloadClass(List<Hotswaper.ClassFileInfo> changedFiles)
重新热加载Class
|
static void |
reloadClass(Map<Class,byte[]> clazzDefines)
重新热加载Class
|
void |
setClassFileInfos(List<Hotswaper.ClassFileInfo> classFileInfos) |
public Hotswaper() throws IOException, com.sun.tools.attach.AgentInitializationException, com.sun.tools.attach.AgentLoadException, com.sun.tools.attach.AttachNotSupportedException
IOException
- IO 异常com.sun.tools.attach.AttachNotSupportedException
- 附加指定进程失败com.sun.tools.attach.AgentLoadException
- Agent 加载异常com.sun.tools.attach.AgentInitializationException
- Agent 初始化异常public Hotswaper(String agentJarPath) throws IOException, com.sun.tools.attach.AttachNotSupportedException, com.sun.tools.attach.AgentLoadException, com.sun.tools.attach.AgentInitializationException
agentJarPath
- AgentJar 文件IOException
- IO 异常com.sun.tools.attach.AttachNotSupportedException
- 附加指定进程失败com.sun.tools.attach.AgentLoadException
- Agent 加载异常com.sun.tools.attach.AgentInitializationException
- Agent 初始化异常public static void reloadClass(Map<Class,byte[]> clazzDefines) throws UnmodifiableClassException, ClassNotFoundException
clazzDefines
- 有过变更的文件信息UnmodifiableClassException
- 不可修改的 Class 异常ClassNotFoundException
- Class未找到异常public void reloadClass(List<Hotswaper.ClassFileInfo> changedFiles) throws UnmodifiableClassException, ClassNotFoundException
changedFiles
- 有过变更的文件信息UnmodifiableClassException
- 不可修改的 Class 异常ClassNotFoundException
- Class未找到异常public int getReloadIntervals()
public void autoReload(int intervals) throws UnmodifiableClassException, ClassNotFoundException
intervals
- 自动重读的时间间隔, 单位: 秒UnmodifiableClassException
- 不可修改的 Class 异常ClassNotFoundException
- Class未找到异常public void cancelAutoReload()
public List<Hotswaper.ClassFileInfo> getClassFileInfos()
public void setClassFileInfos(List<Hotswaper.ClassFileInfo> classFileInfos)
Copyright © 2020 Voovan. All rights reserved.