Package org.jrd.backend.communication
Class FsAgent
java.lang.Object
org.jrd.backend.communication.FsAgent
- All Implemented Interfaces:
DelegatingJrdAgent
,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
Nested classes/interfaces inherited from interface org.jrd.backend.communication.DelegatingJrdAgent
DelegatingJrdAgent.CommandDelegationOptions, DelegatingJrdAgent.DelegatingHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DelegatingJrdAgent.DelegatingHelper
This is exact oposite of how remote agent does this.private final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDelegatingAgent
(JrdAgent agent) private static void
int
private int
cleanOverrides
(Pattern pattern) static FsAgent
static FsAgent
static FsAgent
static FsAgent
static FsAgent
private String
readClasses
(boolean details) removeDelegatingAgent
(JrdAgent agent) 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
-
suffix
-
delegationCandidates
-
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
-
createAdditionalClassPathFsAgent
-
createAdditionalClassPathFsAgent
-
createAdditionalSourcePathFsAgent
-
createAdditionalSourcePathFsAgent
-
getOverrides
-
cleanOverrides
-
submitRequest
Opens a socket and sends the request to the agent via socket.- Specified by:
submitRequest
in interfaceDelegatingJrdAgent
- 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
-
addDelegatingAgent
- Specified by:
addDelegatingAgent
in interfaceDelegatingJrdAgent
-
removeDelegatingAgent
- Specified by:
removeDelegatingAgent
in interfaceDelegatingJrdAgent
-
cleanDelegatingAgents
public int cleanDelegatingAgents()- Specified by:
cleanDelegatingAgents
in interfaceDelegatingJrdAgent
-