Merge pull request #7 from fourbites/master
Fix IllegalAccessError crash
This commit is contained in:
@@ -870,11 +870,7 @@ public class Client
|
|||||||
}
|
}
|
||||||
// otherwise queue this notification up to run on the run queue thread
|
// otherwise queue this notification up to run on the run queue thread
|
||||||
else {
|
else {
|
||||||
_runQueue.postRunnable(new Runnable() {
|
_runQueue.postRunnable(() -> _observers.apply(op));
|
||||||
public void run () {
|
|
||||||
_observers.apply(op);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -894,38 +890,36 @@ public class Client
|
|||||||
// CLIENT_DID_LOGOFF; that may not have been invoked yet, so we don't want to clear out our
|
// CLIENT_DID_LOGOFF; that may not have been invoked yet, so we don't want to clear out our
|
||||||
// communicator reference immediately; instead we queue up a runnable unit to do so to
|
// communicator reference immediately; instead we queue up a runnable unit to do so to
|
||||||
// ensure that it won't happen until CLIENT_DID_LOGOFF was dispatched
|
// ensure that it won't happen until CLIENT_DID_LOGOFF was dispatched
|
||||||
_runQueue.postRunnable(new Runnable() {
|
_runQueue.postRunnable(() -> {
|
||||||
public void run () {
|
// tell the object manager that we're no longer connected to the server
|
||||||
// tell the object manager that we're no longer connected to the server
|
if (_omgr instanceof ClientDObjectMgr) {
|
||||||
if (_omgr instanceof ClientDObjectMgr) {
|
((ClientDObjectMgr)_omgr).cleanup();
|
||||||
((ClientDObjectMgr)_omgr).cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear out our references
|
|
||||||
_comm = null;
|
|
||||||
_bstrap = null;
|
|
||||||
_omgr = null;
|
|
||||||
_clobj = null;
|
|
||||||
_connectionId = _cloid = -1;
|
|
||||||
_standalone = false;
|
|
||||||
|
|
||||||
// and let our invocation director know we're logged off
|
|
||||||
_invdir.cleanup();
|
|
||||||
|
|
||||||
// if we were cleaned up due to a failure to logon, we can report the logon error
|
|
||||||
// now that the communicator is cleaned up; this allows a logon failure listener to
|
|
||||||
// immediately try another logon (hopefully with something changed like the server
|
|
||||||
// or port)
|
|
||||||
notifyObservers(new ObserverOps.Client(Client.this) {
|
|
||||||
@Override protected void notify (ClientObserver obs) {
|
|
||||||
if (logonError != null) {
|
|
||||||
obs.clientFailedToLogon(_client, logonError);
|
|
||||||
} else {
|
|
||||||
obs.clientDidClear(_client);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear out our references
|
||||||
|
_comm = null;
|
||||||
|
_bstrap = null;
|
||||||
|
_omgr = null;
|
||||||
|
_clobj = null;
|
||||||
|
_connectionId = _cloid = -1;
|
||||||
|
_standalone = false;
|
||||||
|
|
||||||
|
// and let our invocation director know we're logged off
|
||||||
|
_invdir.cleanup();
|
||||||
|
|
||||||
|
// if we were cleaned up due to a failure to logon, we can report the logon error
|
||||||
|
// now that the communicator is cleaned up; this allows a logon failure listener to
|
||||||
|
// immediately try another logon (hopefully with something changed like the server
|
||||||
|
// or port)
|
||||||
|
notifyObservers(new ObserverOps.Client(Client.this) {
|
||||||
|
@Override protected void notify (ClientObserver obs) {
|
||||||
|
if (logonError != null) {
|
||||||
|
obs.clientFailedToLogon(_client, logonError);
|
||||||
|
} else {
|
||||||
|
obs.clientDidClear(_client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -234,10 +234,8 @@ public class ClientDObjectMgr
|
|||||||
_flusher.cancel();
|
_flusher.cancel();
|
||||||
_flushes.clear();
|
_flushes.clear();
|
||||||
_dead.clear();
|
_dead.clear();
|
||||||
_client.getRunQueue().postRunnable(new Runnable() {
|
_client.getRunQueue().postRunnable(() -> {
|
||||||
public void run () {
|
_ocache.clear();
|
||||||
_ocache.clear();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -282,6 +282,9 @@ public abstract class RebootManager
|
|||||||
// schedule the next warning
|
// schedule the next warning
|
||||||
final int nextLevel = level + 1;
|
final int nextLevel = level + 1;
|
||||||
final int nextMinutes = (nextLevel == warnings.length) ? 0 : warnings[nextLevel];
|
final int nextMinutes = (nextLevel == warnings.length) ? 0 : warnings[nextLevel];
|
||||||
|
if (_interval != null) {
|
||||||
|
_interval.cancel();
|
||||||
|
}
|
||||||
_interval = _omgr.newInterval(new Runnable() {
|
_interval = _omgr.newInterval(new Runnable() {
|
||||||
public void run () {
|
public void run () {
|
||||||
doWarning(nextLevel, nextMinutes);
|
doWarning(nextLevel, nextMinutes);
|
||||||
@@ -303,6 +306,9 @@ public abstract class RebootManager
|
|||||||
|
|
||||||
log.info("Reboot delayed due to outstanding locks", "locks", _rebootLocks.elements());
|
log.info("Reboot delayed due to outstanding locks", "locks", _rebootLocks.elements());
|
||||||
broadcast("m.reboot_delayed");
|
broadcast("m.reboot_delayed");
|
||||||
|
if (_interval != null) {
|
||||||
|
_interval.cancel();
|
||||||
|
}
|
||||||
(_interval = _omgr.newInterval(new Runnable() {
|
(_interval = _omgr.newInterval(new Runnable() {
|
||||||
public void run () {
|
public void run () {
|
||||||
doWarning(getWarnings().length, 0);
|
doWarning(getWarnings().length, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user