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 interfaceprivate static classprivate static classprivate static final classprivate static classNested classes/interfaces inherited from interface DelegatingJrdAgent
DelegatingJrdAgent.CommandDelegationOptions, DelegatingJrdAgent.DelegatingHelper -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DelegatingJrdAgent.DelegatingHelperThis is exact oposite of how remote agent does this.private final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDelegatingAgent(JrdAgent agent) private static voidintprivate intcleanOverrides(Pattern pattern) static FsAgentstatic FsAgentstatic FsAgentstatic FsAgentstatic FsAgentprivate StringreadClasses(boolean details) removeDelegatingAgent(JrdAgent agent) 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
-
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:
submitRequestin interfaceDelegatingJrdAgent- 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
-
addDelegatingAgent
- Specified by:
addDelegatingAgentin interfaceDelegatingJrdAgent
-
removeDelegatingAgent
- Specified by:
removeDelegatingAgentin interfaceDelegatingJrdAgent
-
cleanDelegatingAgents
public int cleanDelegatingAgents()- Specified by:
cleanDelegatingAgentsin interfaceDelegatingJrdAgent
-