synchronized void registerObject(ActivationID id, ActivationDesc desc, boolean addRecord) throws UnknownGroupException, ActivationException { checkRemoved(); objects.put(id, new ObjectEntry(desc)); if (desc.getRestartMode() == true) { restartSet.add(id); } // table insertion must take place before log update idTable.put(id, groupID); if (addRecord) { addLogRecord(new LogRegisterObject(id, desc)); } }
synchronized ActivationDesc setActivationDesc(ActivationID id, ActivationDesc desc, boolean addRecord) throws UnknownObjectException, UnknownGroupException, ActivationException { ObjectEntry objEntry = getObjectEntry(id); ActivationDesc oldDesc = objEntry.desc; objEntry.desc = desc; if (desc.getRestartMode() == true) { restartSet.add(id); } else { restartSet.remove(id); } // restart information should be recorded before log update if (addRecord) { addLogRecord(new LogUpdateDesc(id, desc)); } return oldDesc; }
/** * Create the object activation id and put this id-descriptor combination into * the group map. The new ID will only be created if this description has not * already been registered, otherwise the id of the registered description * will be returned. */ public ActivationID registerObject(ActivationDesc desc) throws ActivationException, UnknownGroupException, RemoteException { ActivationID id = (ActivationID) descriptions.getKey(desc); if (id == null) { id = new ActivationID(this); descriptions.put(id, desc); } if (debug) System.out.println("Register object " + id +":"+desc+" this "+this); return id; }
/** * Returns the Remote Stub for the given activatable class. */ public static RemoteStub getStub(ActivationDesc desc, ActivationID aid) throws StubNotFoundException { String cn = desc.getClassName(); String stubName = ""; //$NON-NLS-1$ try { Class cl = RMIClassLoader.loadClass(desc.getLocation(), cn); Class rcl = RMIUtil.getRemoteClass(cl); stubName = rcl.getName() + "_Stub"; //$NON-NLS-1$ Class stubClass = RMIClassLoader.loadClass((String) null, stubName); Constructor constructor = stubClass.getConstructor(new Class[] { RemoteRef.class }); RemoteStub stub = (RemoteStub) constructor.newInstance(new Object[] { new ActivatableRef(aid, null) }); return stub; } catch (Exception ex) { // rmi.68=Stub {0} not found. throw new StubNotFoundException(Messages.getString("rmi.68", stubName), //$NON-NLS-1$ //$NON-NLS-2$ ex); } }
/** * This method is absent in Java Remote Method Invocation * specification. * * @param aID * @throws UnknownObjectException if <code>ActivationID</code> * is not registered * @throws ActivationException for general failure * @throws RemoteException if remote call fails */ public ActivationDesc getActivationDesc(ActivationID aID) throws UnknownObjectException { waitStartup(); ActivationGroupID agid = (ActivationGroupID) groupIDByActivationID .get(aID); ActivationGroupInfo info = (ActivationGroupInfo) groupInfoByGroupId .get(agid); ActivationDesc adesc = info.getActivationDesc(aID); if (adesc == null) { // rmi.31=No ActivationDesc for ActivationID {0} throw new UnknownObjectException(Messages.getString("rmi.31", aID)); //$NON-NLS-1$ } return adesc; }
public ActivationID registerObject(ActivationDesc adesc) { waitStartup(); // rmi.log.4B=ActivationSystemImpl.registerObject(): rLog.log(commonDebugLevel,Messages.getString("rmi.log.4B")); //$NON-NLS-1$ ActivationGroupID agid = adesc.getGroupID(); // rmi.log.4C=agid : {0} rLog.log(commonDebugLevel, Messages.getString("rmi.log.4C", agid)); //$NON-NLS-1$ // rmi.log.4D=Activator stub = {0} rLog.log(commonDebugLevel, Messages.getString("rmi.log.4D", thisStub)); //$NON-NLS-1$ ActivationID aid = new ActivationID((Activator) thisStub); // rmi.log.4E=aid : {0} rLog.log(commonDebugLevel, Messages.getString("rmi.log.4E", aid)); //$NON-NLS-1$ // rmi.log.4C=agid : {0} rLog.log(commonDebugLevel, Messages.getString("rmi.log.4C", agid)); //$NON-NLS-1$ ActivationGroupInfo info = (ActivationGroupInfo) groupInfoByGroupId .get(agid); // rmi.log.50=ActivationGroupInfo = {0} rLog.log(commonDebugLevel, Messages.getString("rmi.log.50", info)); //$NON-NLS-1$ info.registerObject(aid, adesc); // rmi.log.51=Activation desc was added. rLog.log(commonDebugLevel, Messages.getString("rmi.log.51")); //$NON-NLS-1$ return aid; }
public synchronized void registerObject(ActivationID id, ActivationDesc desc) { groupIDByActivationID.put(id, agid); ObjectInfo oi = new ObjectInfo(id, desc); objectInfoByActivationID.put(id, oi); if (!restoreLock) { writeDelta(Delta.PUT, "object", id, desc); //$NON-NLS-1$ // rmi.log.5D=New delta was generated. rLog.log(persistenceDebugLevel, Messages .getString("rmi.log.5D")); //$NON-NLS-1$ } }