public void execute() { if (!configured) { configure(); } if (!consumerSubscription.isEmpty()) { // System.out.println("Calling addConsumerPGs() for "+getAgentIdentifier()); addConsumerPGs(consumerSubscription); } }
protected void rehydrate() { configure(); if (logger.isDebugEnabled()) { logger.debug("Rehydrated - configured " + configured); } if (configured) { // rehook handlers Enumeration consumers = consumerSubscription.elements(); Asset asset, proto; // boolean success; Vector good_prototypes = new Vector(); while (consumers.hasMoreElements()) { asset = (Asset) consumers.nextElement(); if (asset instanceof AggregateAsset) { proto = ((AggregateAsset) asset).getAsset(); } else { proto = asset.getPrototype(); } if (proto == null) { if (logger.isErrorEnabled()) { logger.error("no prototype for " + asset); } } if ((proto != null) && (!good_prototypes.contains(proto))) { TypeIdentificationPG tip = asset.getTypeIdentificationPG(); if (tip != null) { String type_id = tip.getTypeIdentification(); if (type_id != null) { getLDM().cachePrototype(type_id, proto); good_prototypes.add(proto); if (logger.isDebugEnabled()) { logger.debug("Rehydrated asset " + asset + " w/ proto " + proto); } } else { if (logger.isErrorEnabled()) { logger.error("cannot rehydrate " + proto + " no typeId"); } } } else { if (logger.isErrorEnabled()) { logger.error("cannot rehydrate " + proto + " no typeIdPG"); } } } } // end while loop addConsumerPGs(consumerSubscription); } }