Activation.java revision 4105
325N/A new ConcurrentHashMap<>();
325N/A new ConcurrentHashMap<>();
325N/A private transient int groupSemaphore;
325N/A private transient int groupCounter;
325N/A private transient int numUpdates;
325N/A private static final long groupTimeout =
325N/A private static final int snapshotInterval =
325N/A private static final long execTimeout =
325N/A private transient volatile boolean shuttingDown = false;
325N/A private Activation() {}
325N/A } catch (UnknownGroupException e) {
325N/A e.printStackTrace();
325N/A throws RemoteException
325N/A return systemStub;
325N/A throw new AccessException(
325N/A throw new AccessException(
325N/A throw new AccessException(
325N/A throws RemoteException
325N/A implements ActivationMonitor
325N/A throws RemoteException
325N/A } catch (ActivationException e) {
325N/A } catch (ActivationException e) {
325N/A long incarnation)
325N/A } catch (ActivationException e) {
325N/A class ActivationSystemImpl
325N/A extends RemoteServer
325N/A implements ActivationSystem
325N/A throws RemoteException
325N/A long incarnation)
325N/A throw new ActivationException(
325N/A synchronized (Activation.this) {
325N/A if (!shuttingDown) {
325N/A shuttingDown = true;
325N/A if (shuttingDown == true) {
325N/A throw new ActivationException(
synchronized (log) {
} catch (IOException e) {
ShutdownHook() {
public void run() {
synchronized (Activation.this) {
shuttingDown = true;
throws UnknownObjectException
return groupID;
throws UnknownGroupException
if (rm) {
return entry;
throws UnknownGroupException
throws UnknownGroupException
throws UnknownObjectException
return entry;
transient boolean removed = false;
void restartServices() {
} catch (Exception e) {
if (shuttingDown) {
e.printStackTrace();
long instIncarnation)
notifyAll();
if (removed) {
throws UnknownObjectException
if (removed) {
return objEntry;
boolean addRecord)
checkRemoved();
if (addRecord) {
if (addRecord) {
checkRemoved();
removed = true;
reset();
childGone();
if (addRecord) {
boolean addRecord)
if (addRecord) {
return oldDesc;
boolean addRecord)
checkRemoved();
if (addRecord) {
return oldDesc;
throws UnknownGroupException
checkRemoved();
reset();
if (failure) {
terminate();
throws UnknownObjectException
throws UnknownObjectException
private synchronized void reset() {
private void childGone() {
notifyAll();
private void terminate() {
notifyAll();
private void await() {
switch (status) {
case NORMAL:
case TERMINATE:
terminate();
case TERMINATING:
} catch (IllegalThreadStateException e) {
childGone();
case CREATING:
wait();
} catch (InterruptedException e) {
void shutdownFast() {
if (p != null) {
p.destroy();
synchronized void shutdown() {
reset();
terminate();
await();
boolean force)
throws ActivationException
long currentIncarnation;
boolean groupInactive = false;
boolean failure = false;
} catch (NoSuchObjectException e) {
groupInactive = true;
detail = e;
} catch (ConnectException e) {
groupInactive = true;
failure = true;
detail = e;
} catch (ConnectIOException e) {
groupInactive = true;
failure = true;
detail = e;
} catch (InactiveGroupException e) {
groupInactive = true;
detail = e;
} catch (RemoteException e) {
detail = e;
if (groupInactive) {
} catch (UnknownGroupException e) {
throws ActivationException
await();
return group;
checkRemoved();
boolean acquired = false;
acquired = true;
if (debugExec) {
++incarnation;
} catch (IOException e) {
terminate();
throw new ActivationException(
return group;
} catch (InterruptedException e) {
terminate();
throw new ActivationException(
(removed ?
if (acquired) {
Vstartgroup();
private boolean canInterrupt = true;
private boolean shouldQuit = false;
private boolean shouldRestart = true;
Watchdog() {
setDaemon(true);
public void run() {
if (shouldQuit) {
boolean restart = false;
synchronized (GroupEntry.this) {
if (shouldQuit) {
canInterrupt = false;
reset();
childGone();
if (restart) {
void dispose() {
shouldQuit = true;
if (canInterrupt) {
interrupt();
void noRestart() {
shouldRestart = false;
p.hasMoreElements();)
return realArgv;
} catch (InvocationTargetException e) {
throw new ActivationException(
} catch (Exception e) {
throw new ActivationException(
volatile transient boolean removed = false;
boolean force,
if (removed) {
return nstub;
return nstub;
void reset() {
synchronized (log) {
} catch (Exception e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
ActLogHandler() {
return new Activation();
throws Exception
return state;
return state;
return state;
return state;
return state;
return state;
private long inc;
return state;
} catch (Exception e) {
return null;
public static class DefaultExecPolicy {
throws SecurityException
while (p.hasMoreElements()) {
} catch (AccessControlException e) {
throw new AccessControlException(
* AllPermission or any ExecPermissions/ExecOptionPermissions.
static void checkConfiguration() {
e.hasMoreElements();)
if (p instanceof AllPermission ||
p instanceof ExecPermission ||
p instanceof ExecOptionPermission)
if (p != null) {
return new Permissions();
return perms;
Permission p)
throws AccessControlException
throw new AccessControlException(
boolean stop = false;
return null;
stop = true;
args[i]));
if (!stop) {
ActivationGroupDesc.class,
String[].class);
} catch (Exception e) {
if (debugExec) {
e.printStackTrace();
if (stop == true) {
return null;
} catch (InterruptedException e) {
} catch (Exception e) {
e.printStackTrace();
return val;
wait();
} catch (InterruptedException e) {
private synchronized void Vstartgroup() {
notifyAll();
private static class ActivationServerSocketFactory
implements RMIServerSocketFactory
throws IOException
throws IOException
throws IOException
public int getLocalPort() {
synchronized (initLock) {
while (!initDone) {
public boolean isBound() {
public boolean isClosed() {
throws SocketException
throws SocketException
public int getReceiveBufferSize()
throws SocketException
private int cLast;
private byte[] currSep;
private static int lineSeparatorLength;
private PipeWriter
public void run() {
int count;
} catch (IOException e) {
throw new IOException
cLast++;
(execString));
private static synchronized int getNumExec() {
return numExecs++;