ActivationDescSerializer(ActivationDesc actDesc){ groupID = actDesc.getGroupID(); className = actDesc.getClassName(); location = actDesc.getLocation(); data = actDesc.getData(); restart = actDesc.getRestartMode(); this.actDesc = actDesc; }
String className = desc.getClassName(); final Class cl = ClassLoading.loadClass(desc.getLocation(), className, null, false, null); final Thread t = Thread.currentThread();
ActivationDesc setActivationDesc(UID uid, ActivationDesc desc, boolean addRecord) throws ActivationException { ObjectEntry objEntry = getObjectEntry(uid); if (addRecord) activation.addLogRecord(new LogUpdateDesc(uid, desc)); ActivationDesc oldDesc = objEntry.desc; objEntry.desc = desc; if (desc.getRestartMode()) restartSet.add(uid); else restartSet.remove(uid); return oldDesc; }
new ActivationDesc(gid, ActivateWrapper.class.getName(), null,
@Override Object apply(Object state) { Activation act = (Activation) state; act.writeLock.lock(); try { act.getGroupEntry(desc.getGroupID()).registerObject(uid, desc, false); } catch (Exception e) { logger.log(Level.WARNING, "log recovery throws", e); } finally { act.writeLock.unlock(); } return state; } }
public Object run() throws InstantiationException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, ActivationException { Object[] params = new Object[] {id, desc.getData()}; Constructor constructor = cl.getDeclaredConstructor(paramTypes); constructor.setAccessible(true); try { /* * Fix for 4289544: make sure to set the * context class loader to be the class * loader of the impl class before * constructing that class. */ t.setContextClassLoader(ccl); return constructor.newInstance(params); } finally { t.setContextClassLoader(savedCcl); } } };
void registerObject(UID uid, ActivationDesc desc, boolean addRecord) throws ActivationException { checkRemoved(); if (addRecord) activation.addLogRecord(new LogRegisterObject(uid, desc)); objects.put(uid, new ObjectEntry(desc, activation)); if (desc.getRestartMode()) restartSet.add(uid); activation.idTable.put(uid, groupID); }
throw me; ActivationDesc adesc = new ActivationDesc(gid, ActivateWrapper.class.getName(), null,
@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(); } }
void unregisterObject(UID uid, boolean addRecord) throws ActivationException { ObjectEntry objEntry = getObjectEntry(uid); if (addRecord) activation.addLogRecord(new LogUnregisterObject(uid)); objEntry.removed(); objects.remove(uid); if (objEntry.desc.getRestartMode()) restartSet.remove(uid); activation.idTable.remove(uid); }
ActivationDescSerializer(GetArg arg) throws IOException, ClassNotFoundException{ this( new ActivationDesc( Valid.notNull( arg.get("groupID", null, java.rmi.activation.ActivationGroupID.class), "groupID cannot be null" ), arg.get("className", null, String.class), arg.get("location", null, String.class), arg.get("data", null, MarshalledObject.class), arg.get("restart", true) ) ); }
/** returns a ConstrainableAID */ @Override public ActivationID registerObject(ActivationDesc desc) throws ActivationException { UID uid = new UID(); writeLock.lock(); try { ActivationGroupID groupID = desc.getGroupID(); getGroupEntry(groupID).registerObject(uid, desc, true); return getAID(uid); } finally { writeLock.unlock(); } }