Skip to content

Commit

Permalink
debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-actoron committed Jan 15, 2021
1 parent 98ea053 commit 1f019c2
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1590,8 +1590,8 @@ public void exceptionOccurred(Exception exception)
*/
public static IFuture<Map<String, Object>> destroyComponent(final IComponentIdentifier cid, IInternalAccess agent)
{
if(cid.toString().indexOf("Sokrates")!=-1)
System.out.println("destroy: "+cid);
if(cid.toString().indexOf("SellerAgent")!=-1)
agent.getLogger().info("destroy0: "+cid);
// if(cid.getParent()==null)
// System.out.println("---- !!!! ----- Killing platform ---- !!!! ----- "+cid.getName());
// System.out.println("Terminating component: "+cid.getName());
Expand All @@ -1608,8 +1608,12 @@ public static IFuture<Map<String, Object>> destroyComponent(final IComponentIden
Future<Map<String, Object>> tmp;

CmsState state = getState(agent.getId());
if(cid.toString().indexOf("SellerAgent")!=-1)
agent.getLogger().info("destroy1: "+cid);
try(IAutoLock l = state.writeLock())
{
if(cid.toString().indexOf("SellerAgent")!=-1)
agent.getLogger().info("destroy2: "+cid);
CmsComponentState compstate = state.getComponent(cid);
contains = compstate.getCleanupFuture() != null;
tmp = contains? (Future<Map<String, Object>>)compstate.getCleanupFuture(): new Future<Map<String, Object>>();
Expand All @@ -1635,7 +1639,13 @@ public static IFuture<Map<String, Object>> destroyComponent(final IComponentIden
final Future<Map<String, Object>> ret = tmp;

if(!contains && !locked && inited)
{
if(cid.toString().indexOf("SellerAgent")!=-1)
agent.getLogger().info("destroy3: "+cid);
destroyComponent(cid, ret, agent);
}
if(cid.toString().indexOf("SellerAgent")!=-1)
agent.getLogger().info("destroy4 (contains, locked, inited): "+cid+" ("+contains+", "+locked+", "+inited+")");

if(cid.toString().indexOf("Sokrates")!=-1)
{
Expand Down

0 comments on commit 1f019c2

Please sign in to comment.