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

Cleanup!

parent 9dec26df
......@@ -45,7 +45,7 @@ final class RequestProcessor {
//
public InstrumentClassResponse process (final InstrumentClassRequest request) {
InstrumentClassResponse process (final InstrumentClassRequest request) {
final byte [] classBytes = request.getClassBytes ().toByteArray ();
final InstrClassInfo classInfo = request.getClassInfo ();
final String className = __getClassName (classInfo.getClassName (), classBytes);
......
# ShadowVM server
The original lightweight implementation of analysis server. It doesn't do
instrumentation, only the analysis is performed.
Its only functionality is to receive the analysis requests and pass them to the
shvm object model library.
# Shadow VM server
# Shadow VM object model
This is the ShadowVM object model. The core of the analysis. It only exposes
the public API defined in `src/src-server-api`
## TODO
* Move the whole implementation into new package. Current is `ch.usi.dag.dislreserver`,
which does not makes a sense, since the object model is separated from the server.
......@@ -4,7 +4,7 @@ import java.util.List;
// Each thread has dedicated queue where new tasks are submitted.
public class AnalysisDispatcher {
class AnalysisDispatcher {
// Epoch is used during object free event sending. Each task is assigned
// with current epoch number. When free event arrives it increments the
......@@ -70,7 +70,7 @@ public class AnalysisDispatcher {
ateManager.executorIsEnding(threadId);
}
public void exit() {
void exit() {
// create end of processing analysis task
AnalysisTask at = new AnalysisTask();
......
......@@ -2,8 +2,6 @@ package ch.usi.dag.dislreserver;
import java.util.List;
import ch.usi.dag.dislreserver.AnalysisInvocation;
/**
* Holds unprocessed task data for some thread
*/
......@@ -17,7 +15,7 @@ class AnalysisTask {
/**
* List of invocations in this task
*/
protected List<AnalysisInvocation> invocations;
List<AnalysisInvocation> invocations;
/**
* The epoch determined by objectFree events
......@@ -48,7 +46,7 @@ class AnalysisTask {
return signalsEnd;
}
public List<AnalysisInvocation> getInvocations() {
List<AnalysisInvocation> getInvocations() {
return invocations;
}
......
......@@ -65,7 +65,7 @@ class AnalysisTaskExecutor {
}
}
public synchronized AnalysisTask getTask() throws InterruptedException {
synchronized AnalysisTask getTask() throws InterruptedException {
// executor thread is driving whole executor from this method
// - the state of the executor epoch is updated here
......@@ -114,7 +114,7 @@ class AnalysisTaskExecutor {
}
// works with executorEpoch -> synchronized
public synchronized void globalEpochChanged(long newEpoch) {
synchronized void globalEpochChanged(long newEpoch) {
globalEpoch = newEpoch;
......@@ -123,7 +123,7 @@ class AnalysisTaskExecutor {
}
// works with executorEpoch -> synchronized
public synchronized void waitForEpochProcessing(long epochToProcess)
synchronized void waitForEpochProcessing(long epochToProcess)
throws InterruptedException {
while (true) {
......@@ -141,7 +141,7 @@ class AnalysisTaskExecutor {
}
// await for executor to finish all jobs
public void awaitTermination() throws InterruptedException {
void awaitTermination() throws InterruptedException {
executingThread.join();
}
}
......@@ -5,9 +5,9 @@ package ch.usi.dag.dislreserver;
*/
class AnalysisThread extends Thread {
final protected AnalysisTaskExecutor taskExecutor;
private final AnalysisTaskExecutor taskExecutor;
public AnalysisThread(AnalysisTaskExecutor taskHolder) {
AnalysisThread(AnalysisTaskExecutor taskHolder) {
this.taskExecutor = taskHolder;
}
......
......@@ -2,32 +2,32 @@ package ch.usi.dag.dislreserver;
class ObjectFreeTask {
protected boolean signalsEnd = false;
protected long[] objFreeIDs;
protected long closingEpoch;
private boolean signalsEnd = false;
private long[] objFreeIDs;
private long closingEpoch;
/**
* Constructed task signals end of the processing
*/
public ObjectFreeTask() {
ObjectFreeTask() {
signalsEnd = true;
}
public ObjectFreeTask(long[] objFreeIDs, long closingEpoch) {
ObjectFreeTask(long[] objFreeIDs, long closingEpoch) {
super();
this.objFreeIDs = objFreeIDs;
this.closingEpoch = closingEpoch;
}
public boolean isSignalingEnd() {
boolean isSignalingEnd() {
return signalsEnd;
}
public long[] getObjFreeIDs() {
long[] getObjFreeIDs() {
return objFreeIDs;
}
public long getClosingEpoch() {
long getClosingEpoch() {
return closingEpoch;
}
}
......@@ -14,15 +14,14 @@ import java.util.concurrent.LinkedBlockingQueue;
*/
class ObjectFreeTaskExecutor extends Thread {
final ATEManager ateManager;
private final ATEManager ateManager;
final BlockingQueue<ObjectFreeTask> taskQueue =
new LinkedBlockingQueue<ObjectFreeTask>();
private final BlockingQueue<ObjectFreeTask> taskQueue = new LinkedBlockingQueue<ObjectFreeTask>();
/**
* Current shadow VM context.
*/
final SHVMContext __shvmContext;
private final SHVMContext __shvmContext;
/**
......
......@@ -16,11 +16,11 @@ import ch.usi.dag.util.logging.Logger;
*
* Takes care of handling the requests to analysis invocations.
*/
public final class AnalysisHandler {
final class AnalysisHandler {
private AnalysisDispatcher dispatcher;
public AnalysisDispatcher getDispatcher() {
AnalysisDispatcher getDispatcher() {
return dispatcher;
}
......@@ -46,7 +46,7 @@ public final class AnalysisHandler {
* @param is Input stream with the rest of the data.
* @throws DiSLREServerException
*/
public void handle (final long orderingID, final int invocationCount, final DataInputStream is)
void handle (final long orderingID, final int invocationCount, final DataInputStream is)
throws DiSLREServerException
{
......@@ -216,7 +216,7 @@ public final class AnalysisHandler {
dispatcher.objectsFreedEvent(objFreeIDs);
}
public void exit() {
void exit() {
dispatcher.exit();
}
}
......@@ -3,7 +3,7 @@ package ch.usi.dag.dislreserver;
import java.lang.reflect.Method;
public final class AnalysisInvocation {
final class AnalysisInvocation {
private final Method __method;
private final Object __target;
......@@ -11,7 +11,7 @@ public final class AnalysisInvocation {
//
public AnalysisInvocation (
AnalysisInvocation (
final Method method, final Object target, final Object [] args
) {
__method = method;
......@@ -19,7 +19,7 @@ public final class AnalysisInvocation {
__args = args;
}
public void invoke () {
void invoke () {
try {
__method.invoke (__target, __args);
......
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