/** * If shutting down, throw an ActivationException. */ private void checkShutdown() throws ActivationException { if (shuttingDown) { throw new ActivationException( "activation system is shutting down"); } }
void activeGroup(ActivationInstantiator inst, long instIncarnation) throws ActivationException { if (group != null && group.equals(inst) && incarnation == instIncarnation) { return; } else if (child != null && status != CREATING) { throw new ActivationException("group not being created"); } else if (incarnation != instIncarnation) { throw new ActivationException("invalid incarnation"); } else if (group != null) { throw new ActivationException("group already active"); } group = inst; status = NORMAL; activation.signal.signalAll(); }
synchronized (AbstractActivationGroup.class) { if (state != CREATING) { throw new ActivationException("not called from createGroup");
throw (ActivationException) ex; } else { throw new ActivationException("unexpected failure", ex);
/** * Returns <code>true</code> if the specified class (loaded from the specified location) is a * subclass of <code>ActivationGroup</code> and returns <code>false</code> otherwise. * * @return <code>true</code> if the specified class is a subclass * @throws ActivationException if the specified class could not be loaded **/ private static boolean isAssignableFrom(final String className, final String location) throws ActivationException { try { Class cl = (Class) Security.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws Exception { return RMIClassLoader.loadClass(location, className); } }); return ActivationGroup.class.isAssignableFrom(cl); } catch (PrivilegedActionException e) { throw new ActivationException("unable to load group class", e.getException()); } }
private void snapshot() throws ActivationException { try { log.snapshot(); numUpdates = 0; } catch (Exception e) { logger.log(Level.SEVERE, "log snapshot throws", e); try { system.shutdown(); } catch (RemoteException ignore) { // can't happen } throw new ActivationException("log snapshot failed", e); } }
ActiveEntry(Remote impl) throws ActivationException { this.impl = impl; try { Object proxy ; if (impl instanceof ProxyAccessor) { proxy = ((ProxyAccessor) impl).getProxy(); if (proxy == null) { throw new ActivationException( "ProxyAccessor.getProxy returned null"); } } else { proxy = impl; } this.mobj = new MarshalledInstance(proxy).convertToMarshalledObject(); } catch (IOException e) { throw new ActivationException( "failed to marshal remote object", e); } } }
throw new ActivationException("group is not active");
@Override public ActivationDesc setActivationDesc(ActivationID id, ActivationDesc desc) throws ActivationException { UID uid = getUID(id); writeLock.lock(); try { if (!getGroupID(uid).equals(desc.getGroupID())) { throw new ActivationException( "ActivationDesc contains wrong group"); } return getGroupEntry(uid).setActivationDesc(uid, desc, true); } finally { writeLock.unlock(); } }
throw new ActivationException("object activation failed after " + MAX_TRIES + " tries", detail);
} catch (NoSuchMethodException e) { throw new ActivationException( "activation constructor not defined", e); } catch (NoSuchMethodError e) { throw new ActivationException( "activation constructor not defined", e); } catch (InvocationTargetException e) { throw new ActivationException("exception constructing object", e.getTargetException()); } catch (ActivationException e) { throw e; } catch (Exception e) { throw new ActivationException("unable to activate object", e); } finally { releaseLock(id);
throw new ActivationException("group previously created"); throw e; } catch (Exception e) { throw new ActivationException("creation failed", e); } finally { if (state != ACTIVE) {
sys = (ActivationSystem) activationSystemPreparer.prepareProxy(sys); } catch (Exception e) { throw new ActivationException( "ActivationSystem @ " + host + ":" + port + " could not be obtained", e);
if (className == null || !isAssignableFrom(className, desc.getLocation())) { throw new ActivationException("group class not subclass");
sys = (ActivationSystem) activationSystemPreparer.prepareProxy(sys); } catch (Exception e) { throw new ActivationException("ActivationSystem @ " + host + ":"
throw (ActivationException) e; } else { throw new ActivationException( "unable to create activation group", e); throw new ActivationException( "timeout creating child process"); } finally {
void export() throws NoSuchObjectException, ExportException, RemoteException, UnknownGroupException, ActivationException { synchronized (AbstractActivationGroup.class) { if (state != CREATING) { throw new ActivationException("not called from createGroup"); } if (refuseCalls) { unexportObject(this, true); refuseCalls = false; } proxy = (ActivationInstantiator) exporter.export(this); try { monitor = (ActivationMonitor) monPreparer.prepareProxy( id.getSystem().activeGroup(id, proxy, incarnation)); state = CREATED; } finally { if (state != CREATED) { exporter.unexport(true); } } monPreparer = null; } }