public void exceptionOccurred(Exception exception) { sending = false; if(!(exception instanceof ComponentTerminatedException)) { // exception.printStackTrace(); agent.getLogger().info("Sending awareness info to server...failed: "+exception); } } });
/** * Let the awareness now that the transport was disconnected from an address. * @param address The relay address. */ public IFuture<Void> disconnected(String address) { agent.getLogger().info("Awareness disconnected: "+address); // Todo: remove discovery infos received from awareness return IFuture.DONE; }
public void exceptionOccurred(Exception exception) { sending = false; if(!(exception instanceof ComponentTerminatedException)) { agent.getLogger().info("Sending awareness info to server...failed: "+exception); } } });
public void resultAvailable(Void result) { agent.getLogger().info("Sending awareness info to server...success"); }
public void resultAvailable(Void result) { agent.getLogger().info("Sending awareness info to server...success"); }
/** * Let the awareness now that the transport connected to an address. * @param address The relay address. */ public IFuture<Void> connected(String address) { agent.getLogger().info("Awareness connected: "+address); sendInfo(false); return IFuture.DONE; }
/** * Let the awareness know that the transport connected to an address. * @param address The relay address. */ public IFuture<Void> connected(String address) { agent.getLogger().info("Awareness connected: "+address); sendInfo(false); return IFuture.DONE; }
public void exceptionOccurred(Exception exception) { if(!(exception instanceof ComponentTerminatedException)) agent.getMicroAgent().getLogger().warning("Awareness agent problem, could not get threadpool service: "+exception); // exception.printStackTrace(); ret.setExceptionIfUndone(exception); } });
public void exceptionOccurred(Exception exception) { if(!(exception instanceof ComponentTerminatedException)) agent.getMicroAgent().getLogger().warning("Awareness agent problem, could not get threadpool service: "+exception); // exception.printStackTrace(); ret.setExceptionIfUndone(exception); } });
public void exceptionOccurred(Exception exception) { collectInjectedResults(); nosteps = true; exitState(); StringWriter sw = new StringWriter(); exception.printStackTrace(new PrintWriter(sw)); microagent.getLogger().severe(microagent.getComponentIdentifier()+", "+microagent.getModel().getFullName()+": Exception during cleanup: "+sw); ret.setResult(null); } }));
getAgent().getMicroAgent().getLogger().warning("Message receival error: "+e);
public void entryDeleted(DiscoveryEntry entry) { // If master is lost, try to become master // If master is lost, try to become master String mid = entry.getInfo().getMasterId(); String mymid = getMyMasterId(); // System.out.println("mid:_"+mid+" "+mymid); if(mid!=null && mid.equals(mymid)) { // System.out.println("Master deleted."); try { initNetworkRessource(); } catch (Exception e) { getMicroAgent().getLogger().warning("Receive problem: "+e); // e.printStackTrace(); } } } };
public void entryDeleted(DiscoveryEntry entry) { // If master is lost, try to become master // If master is lost, try to become master String mid = entry.getInfo().getMasterId(); String mymid = getMyMasterId(); // System.out.println("mid:_"+mid+" "+mymid); if(mid!=null && mid.equals(mymid)) { // System.out.println("Master deleted."); try { initNetworkRessource(); } catch (Exception e) { getMicroAgent().getLogger().warning("Receive problem: "+e); // e.printStackTrace(); } } } };
public void resultAvailable(IAwarenessManagementService ms) { ms.addAwarenessInfo(info).addResultListener(new DefaultResultListener<Boolean>(getMicroAgent().getLogger()) { public void resultAvailable(Boolean result) { // nothing to do } public void exceptionOccurred(Exception exception) { if(!(exception instanceof ComponentTerminatedException)) super.exceptionOccurred(exception); } }); }
public void resultAvailable(IAwarenessManagementService ms) { ms.addAwarenessInfo(info).addResultListener(new DefaultResultListener<Boolean>(getMicroAgent().getLogger()) { public void resultAvailable(Boolean result) { // nothing to do } public void exceptionOccurred(Exception exception) { if(!(exception instanceof ComponentTerminatedException)) super.exceptionOccurred(exception); } }); }
public void resultAvailable(AwarenessInfo info) { InetAddress address = SUtil.getInetAddress(); // AwarenessInfo info = createAwarenessInfo(AwarenessInfo.STATE_ONLINE, createMasterId()); // byte[] data = DiscoveryState.encodeObject(info, getMicroAgent().getModel().getClassLoader()); byte[] data = DiscoveryAgent.encodeObject(info, getDefaultCodecs(), getMicroAgent().getClassLoader()); ((BroadcastSendHandler)sender).send(data, address, port); // System.out.println("local slave at: "+SUtil.getInet4Address()+" "+socket.getLocalPort()); getMicroAgent().getLogger().info("local slave at: "+SUtil.getInetAddress()+" "+socket.getLocalPort()); }
getAgent().getMicroAgent().getLogger().warning("Send to remotes problem:_"+e);
public void resultAvailable(AwarenessInfo info) { InetAddress address = SUtil.getInetAddress(); // AwarenessInfo info = createAwarenessInfo(AwarenessInfo.STATE_ONLINE, createMasterId()); // byte[] data = DiscoveryState.encodeObject(info, getMicroAgent().getModel().getClassLoader()); byte[] data = DiscoveryAgent.encodeObject(info, getDefaultCodecs(), getMicroAgent().getClassLoader()); ((BroadcastSendHandler)sender).send(data, address, port); // System.out.println("local slave at: "+SUtil.getInet4Address()+" "+socket.getLocalPort()); getMicroAgent().getLogger().info("local slave at: "+SUtil.getInetAddress()+" "+socket.getLocalPort()); }
/** * Method to send messages. */ public void send(AwarenessInfo info) { try { byte[] data = DiscoveryAgent.encodeObject(info, getAgent().getDefaultCodecs(), getAgent().getMicroAgent().getClassLoader()); Object[] ai = getAgent().getAddressInfo(); send(data, (InetAddress)ai[0], ((Integer)ai[1]).intValue()); // System.out.println(getComponentIdentifier()+" sent '"+info+"' ("+data.length+" bytes)"+" "+port+" "+address); } catch(Exception e) { getAgent().getMicroAgent().getLogger().warning("Could not send awareness message: "+e); // e.printStackTrace(); } }
/** * Method to send messages. */ public void send(AwarenessInfo info) { try { byte[] data = DiscoveryAgent.encodeObject(info, getAgent().getDefaultCodecs(), getAgent().getMicroAgent().getClassLoader()); Object[] ai = getAgent().getAddressInfo(); send(data, (InetAddress)ai[0], ((Integer)ai[1]).intValue()); // System.out.println(getComponentIdentifier()+" sent '"+info+"' ("+data.length+" bytes)"+" "+port+" "+address); } catch(Exception e) { getAgent().getMicroAgent().getLogger().warning("Could not send awareness message: "+e); // e.printStackTrace(); } }