Package org.jrd.backend.communication
Class FsAgent
java.lang.Object
org.jrd.backend.communication.FsAgent
- All Implemented Interfaces:
JrdAgent
This class is doing agent-like based operations on filesystem
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interface
private static class
private static class
private static class
private static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
private int
cleanOverrides
(Pattern pattern) static FsAgent
private String
readClasses
(boolean details) private static String
private String
sendByteCode
(String clazz) submitRequest
(String request) Opens a socket and sends the request to the agent via socket.static String
private Void
uploadByteCode
(String clazz, String body)
-
Field Details
-
AGENTS
-
cp
-
originals
This is exact oposite of how remote agent does this. Remote agent keeps all overrides, because when new class defintion is laoded original is plled, and is modifed (overvritten) by new deffnitio.On contrary, in FS, the class is after writing immediately overriden in file FileSystem. So we keep original, saved during first override. If we keep original, we know class was overwritten. The removal of of override == restore of original (and remvoal of original from map
In addition, insted of byte[] we store base64 encoded String
-
-
Constructor Details
-
FsAgent
-
-
Method Details
-
get
-
getOverrides
-
cleanOverrides
-
submitRequest
Opens a socket and sends the request to the agent via socket.- Specified by:
submitRequest
in interfaceJrdAgent
- Parameters:
request
- either "CLASSES" or "BYTES \n className", other formats are refused- Returns:
- agents response or null
-
uploadByteCode
-
sendByteCode
-
readClasses
- Throws:
IOException
-
addJustClass
-
toClass
-
sanitize
-