Commit e8bb5cb9 authored by Vít Kabele's avatar Vít Kabele

Resolving discussion

parent 2f196f12
Pipeline #3507 passed with stages
in 3 minutes and 19 seconds
......@@ -96,7 +96,7 @@ final class ConnectionHandler implements Runnable {
.setSessionInitResponse (
SessionInitResponse
.newBuilder()
.setSessionId(credentials.session_id)
.setSessionId(credentials.sessionId)
).build ();
sendMessage (response, timer);
break;
......@@ -109,10 +109,10 @@ final class ConnectionHandler implements Runnable {
byte[] bytes = new byte[ delivery.getSizes(i) ];
delivery.getInstrumentation ().copyTo (bytes, off, 0, delivery.getSizes (i));
off += delivery.getSizes (i);
credentials.Instrumentations.add (bytes);
credentials.instrumentationJars.add (bytes);
}
credentials.Processor = RequestProcessor.newInstance (credentials.Instrumentations);
credentials.State = SessionCredentials.SessionState.READY;
credentials.processor = RequestProcessor.newInstance (credentials.instrumentationJars);
credentials.state = SessionCredentials.SessionState.READY;
response = ServerMessage
.newBuilder ()
......@@ -136,7 +136,7 @@ final class ConnectionHandler implements Runnable {
response = ServerMessage
.newBuilder ()
.setInstrumentClassResponse (
credentials.Processor.process (request.getInstrumentClassRequest ())
credentials.processor.process (request.getInstrumentClassRequest ())
).build ();
timer.mark (DiSLServer.ElapsedTime.PROCESS);
......@@ -153,8 +153,8 @@ final class ConnectionHandler implements Runnable {
int session_id = request.getSessionId ();
credentials = __server.getSession (session_id);
if(credentials == null) throw new DiSLServerException ("Invalid session id received");
credentials.Processor.terminate ();
credentials.State = SessionCredentials.SessionState.CLOSED;
credentials.processor.terminate ();
credentials.state = SessionCredentials.SessionState.CLOSED;
case REQUEST_NOT_SET:
default:
break REQUEST_LOOP;
......
......@@ -169,7 +169,7 @@ final class RequestProcessor {
//
public void terminate () {
void terminate () {
__disl.terminate ();
}
......@@ -179,17 +179,17 @@ final class RequestProcessor {
/**
* Creates new instance of RequestProcessor class.
*
* @param Instrumentations List of bytearrays representing instrumentation jars.
* @param instrumentationJars List of bytearrays representing instrumentation jars.
* @return New instance of RequestProcessor
* @throws DiSLException
*/
static RequestProcessor newInstance (List<byte[]> Instrumentations) throws DiSLException {
static RequestProcessor newInstance (final List<byte[]> instrumentationJars) throws DiSLException {
// TODO LB: Configure bypass on a per-request basis.
if (disableBypass) {
System.setProperty ("disl.disablebypass", "true");
}
final DiSL disl = new DiSL(System.getProperties (), Instrumentations);
final DiSL disl = new DiSL(System.getProperties (), instrumentationJars);
return new RequestProcessor (disl);
}
......
......@@ -18,7 +18,7 @@ public class SessionCredentials {
/**
* Session identifier
*/
public final int session_id;
public final int sessionId;
/**
* Available states of the session.
......@@ -46,24 +46,24 @@ public class SessionCredentials {
/**
* State of the session.
*/
public SessionState State = SessionState.INITIALIZED;
public SessionState state = SessionState.INITIALIZED;
/**
* Byte arrays representing files with instrumentation.
*/
List<byte[]> Instrumentations = new ArrayList<>();
List<byte[]> instrumentationJars = new ArrayList<>();
/**
* A request processor to handle the instrumentation requests.
*/
RequestProcessor Processor;
RequestProcessor processor;
/**
* Construct the class
* @param session_id Session identifier.
* @param sessionId Session identifier.
*/
SessionCredentials(int session_id){
this.session_id = session_id;
SessionCredentials(int sessionId){
this.sessionId = sessionId;
}
}
......@@ -93,19 +93,15 @@ public enum ContextKind {
*/
public static ContextKind forType(final Type type, final java.lang.ClassLoader classLoader){
if( ContextKind.CLASS.matches (type) ){
if ( ContextKind.CLASS.matches (type) ) {
return ContextKind.CLASS;
}
else if( ContextKind.ARGUMENT.matches (type) ){
} else if( ContextKind.ARGUMENT.matches (type) ) {
return ContextKind.ARGUMENT;
}
else if( ContextKind.ARGUMENT_PROCESSOR.matches (type)){
} else if( ContextKind.ARGUMENT_PROCESSOR.matches (type)) {
return ContextKind.ARGUMENT_PROCESSOR;
}
else if( ContextKind.DYNAMIC.matches (type) ){
} else if( ContextKind.DYNAMIC.matches (type) ) {
return ContextKind.DYNAMIC;
}
else {
} else {
Class <?> typeClass = ReflectionHelper.tryResolveClass (type, classLoader);
if (typeClass != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment