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 interfaceprivate static classprivate static classprivate static classprivate static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidprivate intcleanOverrides(Pattern pattern) static FsAgentprivate StringreadClasses(boolean details) private static Stringprivate StringsendByteCode(String clazz) submitRequest(String request) Opens a socket and sends the request to the agent via socket.static Stringprivate VoiduploadByteCode(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:
submitRequestin 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
-