public void initialize() throws Exception { // Load the local context counter Long contextCounterL = (Long)transaction.load( CTX_COUNTER); if (contextCounterL == null) { contextCounter = 0; } else { contextCounter = contextCounterL.longValue(); } // Load the context index nameToIdIndex = (Hashtable)transaction.load(CTX_INDEX); if (nameToIdIndex == null) { nameToIdIndex = new Hashtable(); } }
public void initialize() throws Exception { // Load the local context counter Long contextCounterL = (Long)transaction.load( CTX_COUNTER); if (contextCounterL == null) { contextCounter = 0; } else { contextCounter = contextCounterL.longValue(); } // Load the context index nameToIdIndex = (Hashtable)transaction.load(CTX_INDEX); if (nameToIdIndex == null) { nameToIdIndex = new Hashtable(); } }
/** * Restores the object state from the persistent storage. */ static AgentIdStamp load() throws IOException, ClassNotFoundException { return (AgentIdStamp) AgentServer.getTransaction().load("AgentIdStamp"); }
/** * Restores the object state from the persistent storage. */ static AgentIdStamp load() throws IOException, ClassNotFoundException { return (AgentIdStamp) AgentServer.getTransaction().load("AgentIdStamp"); }
public static UserAgentArrivalState load(String id) throws Exception { // TODO: as we know the type, the method 'loadByteArray' would be more efficient UserAgentArrivalState res = (UserAgentArrivalState) AgentServer.getTransaction().load(id); res.id = id; res.modified = false; return res; }
public static QueueArrivalState load(String id) throws Exception { // TODO: as we know the type, the method 'loadByteArray' would be more efficient QueueArrivalState res = (QueueArrivalState) AgentServer.getTransaction().load(id); res.id = id; res.modified = false; return res; }
/** * Builds object from persistent image. * * @return loaded object or null if no persistent image exists * * @exception IOException * when accessing the stored image * @exception ClassNotFoundException * if the corresponding image class may not be found */ static ServiceManager load() throws IOException, ClassNotFoundException { return (ServiceManager) AgentServer.getTransaction().load("serviceManager"); }
/** * Builds object from persistent image. * * @return loaded object or null if no persistent image exists * * @exception IOException * when accessing the stored image * @exception ClassNotFoundException * if the corresponding image class may not be found */ static ServiceManager load() throws IOException, ClassNotFoundException { return (ServiceManager) AgentServer.getTransaction().load("serviceManager"); }
void readSavedConf() { try { servers = (Map<String, JMSModule>) AgentServer.getTransaction().load(SAVE_FILE_NAME); Iterator<JMSModule> iter = servers.values().iterator(); while (iter.hasNext()) { iter.next().startLiveConnection(); } } catch (Exception exc) { logger.log(BasicLevel.ERROR, "Error while loading persisted servers", exc); servers = new HashMap<String, JMSModule>(); } }
@Override public MessageIdList loadMessageIdList(String listId) throws Exception { // TODO: as we know the type, the method 'loadByteArray' would be more efficient MessageIdListImpl res = (MessageIdListImpl) AgentServer.getTransaction().load(listId); if (res != null) { res.setListId(listId); } return res; }
/** * Restores the object state from the persistent storage. * * @exception IOException * when accessing the stored image * @exception ClassNotFoundException * if the stored image class may not be found */ static Message load(String name) throws IOException, ClassNotFoundException { Message msg = (Message) AgentServer.getTransaction().load(name); if (msg.not == null) { // AF: cela n'a aucun sens !! String messageId = StringId.toStringId('N', '_', msg.dest, msg.stamp, -1); msg.not = (Notification) AgentServer.getTransaction().load(messageId); msg.not.messageId = messageId; msg.not.detachable = true; msg.not.detached = false; } msg.not.persistent = true; return msg; }
/** * Restores the object state from the persistent storage. * * @exception IOException * when accessing the stored image * @exception ClassNotFoundException * if the stored image class may not be found */ static Message load(String name) throws IOException, ClassNotFoundException { Message msg = (Message) AgentServer.getTransaction().load(name); if (msg.not == null) { // AF: cela n'a aucun sens !! String messageId = StringId.toStringId('N', '_', msg.dest, msg.stamp, -1); msg.not = (Notification) AgentServer.getTransaction().load(messageId); msg.not.messageId = messageId; msg.not.detachable = true; msg.not.detached = false; } msg.not.persistent = true; return msg; }
/** * Restores the object state from the persistent storage. * * @exception IOException * when accessing the stored image * @exception ClassNotFoundException * if the stored image class may not be found */ final static Agent load(AgentId id) throws IOException, ClassNotFoundException { Agent ag = (Agent) AgentServer.getTransaction().load(id.toString()); if (ag != null) { ag.id = id; ag.deployed = true; } return ag; }
/** * Restores the object state from the persistent storage. * * @exception IOException * when accessing the stored image * @exception ClassNotFoundException * if the stored image class may not be found */ final static Agent load(AgentId id) throws IOException, ClassNotFoundException { Agent ag = (Agent) AgentServer.getTransaction().load(id.toString()); if (ag != null) { ag.id = id; ag.deployed = true; } return ag; }
public void agentInitialize(boolean firstTime) throws Exception { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "HARequestManager.agentInitialize(" + firstTime + ')'); Integer counter = (Integer)AgentServer.getTransaction().load( HA_REQUEST_COUNTER); if (counter == null) { requestCounter = 0; } else { requestCounter = counter.intValue(); } requests = new Hashtable(); manager.agentInitialize(firstTime); }
public static Message load(String txname) throws IOException, ClassNotFoundException { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "Message.load:" + txname); Message msg = (Message) AgentServer.getTransaction().load(txname); msg.txname = txname; return msg; }
public static QueueDeliveryTable load(String txName) throws Exception { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "QueueDeliveryTable.load() " + txName); // TODO: as we know the type, the method 'loadByteArray' would be more efficient QueueDeliveryTable res = (QueueDeliveryTable) AgentServer.getTransaction().load(txName); res.txName = txName; return res; }
public static Message load(String txname) throws IOException, ClassNotFoundException { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "Message.load:" + txname); Message msg = (Message) AgentServer.getTransaction().load(txname); msg.txname = txname; return msg; }
/** Loads all persisted messages. */ public static Vector loadAll(String msgTxname) { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "MessagePersistenceModule.loadAll() " + msgTxname); Vector messages = new Vector(); // Retrieving the names of the persistence message previously saved. Transaction tx = AgentServer.getTransaction(); String[] names = tx.getList(msgTxname); // Retrieving the messages individually persisted. for (int i = 0; i < names.length; i++) { if (names[i].charAt(names[i].length() - 1) != 'B') { try { Message msg = (Message) tx.load(names[i]); msg.txname = names[i]; if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "loadAll: names[" + i + "] = " + msg); messages.add(msg); } catch (Exception exc) { logger.log(BasicLevel.ERROR, "Message named [" + names[i] + "] could not be loaded", exc); } } } return messages; }
/** Loads all persisted messages. */ public static Vector loadAll(String msgTxname) { if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "Message.loadAll() " + msgTxname); Vector messages = new Vector(); // Retrieving the names of the persistence message previously saved. Transaction tx = AgentServer.getTransaction(); String[] names = tx.getList(msgTxname); // Retrieving the messages individually persisted. for (int i = 0; i < names.length; i++) { if (names[i].charAt(names[i].length() - 1) != 'B') { try { Message msg = (Message) tx.load(names[i]); msg.txname = names[i]; if (logger.isLoggable(BasicLevel.DEBUG)) logger.log(BasicLevel.DEBUG, "loadAll: names[" + i + "] = " + msg.txname); messages.add(msg); } catch (Exception exc) { logger.log(BasicLevel.ERROR, "Message named [" + names[i] + "] could not be loaded", exc); } } } return messages; }