public Object getValueAt(int row, int col) { Object ret = null; BeliefInfo info = (BeliefInfo)beliefs.get(row); if(col==0) { ret = info.getId();//info.getType()+"#"+info.getId(); } else if(col==1) { ret = info.getValueType(); } else if(col==2) { ret = info.getValue(); if(ret instanceof String[]) { ret = SUtil.arrayToString(ret); } } return ret; }
/** * */ public static void publishToolBeliefEvent(BDIAgentInterpreter ip, MBelief mbel)//, String evtype) { if(mbel!=null && ip.hasEventTargets(PublishTarget.TOSUBSCRIBERS, PublishEventLevel.FINE)) { long time = System.currentTimeMillis();//getClockService().getTime(); MonitoringEvent mev = new MonitoringEvent(); mev.setSourceIdentifier(ip.getComponentIdentifier()); mev.setTime(time); BeliefInfo info = BeliefInfo.createBeliefInfo(ip, mbel, ip.getClassLoader()); // mev.setType(evtype+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT); mev.setType(IMonitoringEvent.EVENT_TYPE_MODIFICATION+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT); // mev.setProperty("sourcename", element.toString()); mev.setProperty("sourcetype", info.getType()); mev.setProperty("details", info); mev.setLevel(PublishEventLevel.FINE); ip.publishEvent(mev, PublishTarget.TOSUBSCRIBERS); } }
BeliefInfo oldinfo = (BeliefInfo)allbeliefs.remove(index); beliefs.remove(newinfo); newinfo.setType(oldinfo.getType()); // Hack!!! Keep capability information which is unavailable for modified events. allbeliefs.add(newinfo); if(checkCapa(newinfo.getType())) beliefs.add(newinfo); if(checkCapa(bi.getType())) beliefs.add(bi);
BeliefInfo info = BeliefInfo.createBeliefInfo(this, mbel, getClassLoader()); MonitoringEvent ev = new MonitoringEvent(getComponentIdentifier(), getComponentDescription().getCreationTime(), IMonitoringEvent.EVENT_TYPE_CREATION+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT, System.currentTimeMillis(), PublishEventLevel.FINE); ev.setSourceDescription(mbel.toString());
public Component getTableCellRendererComponent(JTable table, Object value, boolean sel, boolean foc, int row, int column) { BeliefInfo info = (BeliefInfo)beliefs.get(row); Icon icon = icons.getIcon(info.getKind()); if(icon==null) icon = icons.getIcon("belief"); setIcon(icon); return super.getTableCellRendererComponent(table, value, sel, foc, row, column); } });
return new BeliefInfo(id, kind, type, valuetype, value);
/** * */ public static void publishToolBeliefEvent(IInternalAccess ia, MBelief mbel)//, String evtype) { if(mbel!=null && ia.getComponentFeature0(IMonitoringComponentFeature.class)!=null && ia.getComponentFeature(IMonitoringComponentFeature.class).hasEventTargets(PublishTarget.TOSUBSCRIBERS, PublishEventLevel.FINE)) { long time = System.currentTimeMillis();//getClockService().getTime(); MonitoringEvent mev = new MonitoringEvent(); mev.setSourceIdentifier(ia.getComponentIdentifier()); mev.setTime(time); BeliefInfo info = BeliefInfo.createBeliefInfo(ia, mbel, ia.getClassLoader()); // mev.setType(evtype+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT); mev.setType(IMonitoringEvent.EVENT_TYPE_MODIFICATION+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT); // mev.setProperty("sourcename", element.toString()); mev.setProperty("sourcetype", info.getType()); mev.setProperty("details", info); mev.setLevel(PublishEventLevel.FINE); ia.getComponentFeature(IMonitoringComponentFeature.class).publishEvent(mev, PublishTarget.TOSUBSCRIBERS); } }
BeliefInfo oldinfo = (BeliefInfo)allbeliefs.remove(index); beliefs.remove(newinfo); newinfo.setType(oldinfo.getType()); // Hack!!! Keep capability information which is unavailable for modified events. allbeliefs.add(newinfo); if(checkCapa(newinfo.getType())) beliefs.add(newinfo); if(checkCapa(bi.getType())) beliefs.add(bi);
BeliefInfo info = BeliefInfo.createBeliefInfo(getComponent(), mbel, getComponent().getClassLoader()); MonitoringEvent ev = new MonitoringEvent(getComponent().getComponentIdentifier(), getComponent().getComponentDescription().getCreationTime(), IMonitoringEvent.EVENT_TYPE_CREATION+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT, System.currentTimeMillis(), PublishEventLevel.FINE); ev.setSourceDescription(mbel.toString());
public Component getTableCellRendererComponent(JTable table, Object value, boolean sel, boolean foc, int row, int column) { BeliefInfo info = (BeliefInfo)beliefs.get(row); Icon icon = icons.getIcon(info.getKind()); if(icon==null) icon = icons.getIcon("belief"); setIcon(icon); return super.getTableCellRendererComponent(table, value, sel, foc, row, column); } });
return new BeliefInfo(id, kind, type, valuetype, value);
/** * */ public static void publishToolBeliefEvent(IInternalAccess ia, MBelief mbel)//, String evtype) { if(mbel!=null && ia.getComponentFeature0(IMonitoringComponentFeature.class)!=null && ia.getComponentFeature(IMonitoringComponentFeature.class).hasEventTargets(PublishTarget.TOSUBSCRIBERS, PublishEventLevel.FINE)) { long time = System.currentTimeMillis();//getClockService().getTime(); MonitoringEvent mev = new MonitoringEvent(); mev.setSourceIdentifier(ia.getComponentIdentifier()); mev.setTime(time); BeliefInfo info = BeliefInfo.createBeliefInfo(ia, mbel, ia.getClassLoader()); // mev.setType(evtype+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT); mev.setType(IMonitoringEvent.EVENT_TYPE_MODIFICATION+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT); // mev.setProperty("sourcename", element.toString()); mev.setProperty("sourcetype", info.getType()); mev.setProperty("details", info); mev.setLevel(PublishEventLevel.FINE); ia.getComponentFeature(IMonitoringComponentFeature.class).publishEvent(mev, PublishTarget.TOSUBSCRIBERS); } }
public Object getValueAt(int row, int col) { Object ret = null; BeliefInfo info = (BeliefInfo)beliefs.get(row); if(col==0) { ret = info.getId();//info.getType()+"#"+info.getId(); } else if(col==1) { ret = info.getValueType(); } else if(col==2) { ret = info.getValue(); if(ret instanceof String[]) { ret = SUtil.arrayToString(ret); } } return ret; }
BeliefInfo info = BeliefInfo.createBeliefInfo(getComponent(), mbel, getComponent().getClassLoader()); MonitoringEvent ev = new MonitoringEvent(getComponent().getComponentIdentifier(), getComponent().getComponentDescription().getCreationTime(), IMonitoringEvent.EVENT_TYPE_CREATION+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT, System.currentTimeMillis(), PublishEventLevel.FINE); ev.setSourceDescription(mbel.toString());
BeliefInfo info = BeliefInfo.createBeliefInfo(getComponent(), mbel, getComponent().getClassLoader()); MonitoringEvent ev = new MonitoringEvent(getComponent().getComponentIdentifier(), getComponent().getComponentDescription().getCreationTime(), IMonitoringEvent.EVENT_TYPE_CREATION+"."+IMonitoringEvent.SOURCE_CATEGORY_FACT, System.currentTimeMillis(), PublishEventLevel.FINE); ev.setSourceDescription(mbel.toString());