use of com.dexels.navajo.mapping.AsyncMappable in project navajo by Dexels.
the class AdminMap method getAsyncThreads.
@SuppressWarnings("rawtypes")
public AsyncProxy[] getAsyncThreads() {
Map all = com.dexels.navajo.mapping.AsyncStore.getInstance().objectStore;
Iterator iter = all.values().iterator();
List<AsyncProxy> l = new ArrayList<>();
while (iter.hasNext()) {
AsyncMappable am = (AsyncMappable) iter.next();
Access ac = com.dexels.navajo.mapping.AsyncStore.getInstance().accessStore.get(am.pointer);
AsyncProxy o = new AsyncProxy();
o.user = ac.rpcUser;
o.rpcName = ac.rpcName;
o.setPointer(am.getPointer());
o.startDate = am.getStartDate();
o.name = am.getName();
o.startTime = am.getStartTime();
o.running = am.getRunning();
o.interrupt = am.getInterrupt();
o.accessId = ac.accessID;
o.totaltime = (int) (System.currentTimeMillis() - am.getStartDate().getTime());
o.ipAddress = ac.ipAddress;
o.host = ac.hostName;
o.kill = am.kill;
o.stackTrace = am.getStackTrace();
o.lockClass = am.getLockClass();
o.lockName = am.getLockName();
o.lockOwner = am.getLockOwner();
o.waiting = am.isWaiting();
try {
o.percReady = am.getPercReady();
} catch (Exception e) {
logger.error("Error: ", e);
}
l.add(o);
}
AsyncProxy[] objects = new AsyncProxy[l.size()];
return l.toArray(objects);
}
use of com.dexels.navajo.mapping.AsyncMappable in project navajo by Dexels.
the class AsyncProxy method setInterrupt.
public void setInterrupt(boolean b) {
if (b) {
Map<String, AsyncMappable> all = com.dexels.navajo.mapping.AsyncStore.getInstance().objectStore;
Iterator<AsyncMappable> iter = all.values().iterator();
AsyncMappable am = null;
boolean found = false;
while (iter.hasNext() && !found) {
am = iter.next();
if (am.getPointer().equals(this.pointer))
found = true;
}
if (am != null) {
am.interrupt();
} else {
logger.warn("Can not interrupt: No AsyncMappable found");
}
}
}
use of com.dexels.navajo.mapping.AsyncMappable in project navajo by Dexels.
the class AsyncProxy method setKill.
public void setKill(boolean b) {
if (b) {
Map<String, AsyncMappable> all = com.dexels.navajo.mapping.AsyncStore.getInstance().objectStore;
Iterator<AsyncMappable> iter = all.values().iterator();
AsyncMappable am = null;
boolean found = false;
while (iter.hasNext() && !found) {
am = iter.next();
if (am.getPointer().equals(this.pointer))
found = true;
}
if (am != null) {
am.stop();
} else {
logger.warn("Can not stop: No AsyncMappable found");
}
com.dexels.navajo.mapping.AsyncStore.getInstance().removeInstance(pointer);
}
}
use of com.dexels.navajo.mapping.AsyncMappable in project navajo by Dexels.
the class AsyncProxy method setResume.
public void setResume(boolean b) {
if (b) {
Map<String, AsyncMappable> all = com.dexels.navajo.mapping.AsyncStore.getInstance().objectStore;
Iterator<AsyncMappable> iter = all.values().iterator();
AsyncMappable am = null;
boolean found = false;
while (iter.hasNext() && !found) {
am = iter.next();
if (am.getPointer().equals(this.pointer)) {
found = true;
}
}
if (am != null) {
am.resume();
} else {
logger.warn("Can not resume: No AsyncMappable found");
}
}
}
Aggregations