/** * Get the component id. */ public IComponentIdentifier getComponentIdentifier() { return desc!=null? desc.getName(): null; }
/** * Called when a stream was sent to the component. * (Called from message transport). * (Is it ok to call on external thread?). */ public void receiveStream(IConnection con) { if(IComponentDescription.STATE_TERMINATED.equals(desc.getState()) || exception!=null) throw new ComponentTerminatedException(desc.getName()); component.streamArrived(con); }
public IFuture<Void> execute(IInternalAccess ia) { // System.out.println("created: "+desc.getName()); // ComponentChangeEvent event = new ComponentChangeEvent(IComponentChangeEvent.EVENT_TYPE_CREATION, TYPE_COMPONENT, model.getFullName(), // desc.getName().getName(), getComponentIdentifier(), desc.getCreationTime(), desc); // notifyListeners(event); if(hasEventTargets(PublishTarget.TOALL, PublishEventLevel.COARSE)) { MonitoringEvent me = new MonitoringEvent(desc.getName(), desc.getCreationTime(), MonitoringEvent.TYPE_COMPONENT_CREATED, desc.getCause(), desc.getCreationTime(), PublishEventLevel.COARSE); me.setProperty("details", desc); // for extensions only publishEvent(me, PublishTarget.TOALL) .addResultListener(new DelegationResultListener<Void>(ret)); } else { ret.setResult(null); } return IFuture.DONE; } });
/** * Called from application component, when a component was added. * @param cid The id of the added component. */ public synchronized void componentAdded(IComponentDescription desc)//, String type) { if(groups!=null) { for(Iterator<Group> it=groups.values().iterator(); it.hasNext(); ) { Group group = it.next(); String type = desc.getLocalType(); String[] roles = group.getRolesForType(type); for(int r=0; roles!=null && r<roles.length; r++) { group.assignRole(desc.getName(), roles[r]); } } } }
/** * Set the description. */ public void setDescription(IComponentDescription desc) { getTextField("Name").setText(desc.getName().getName()); getTextField("Type").setText(desc.getType()); getTextField("Model name").setText(desc.getModelName()); getTextField("Creator").setText(desc.getCreator()!=null? desc.getCreator().getName(): "n/a"); getTextField("Ownership").setText(desc.getOwnership()); getTextField("State").setText(desc.getState()); String gid = desc.getResourceIdentifier().getGlobalIdentifier()!=null? desc.getResourceIdentifier().getGlobalIdentifier().getResourceId(): "n/a"; ILocalResourceIdentifier lid = desc.getResourceIdentifier().getLocalIdentifier(); getTextField("Resource Identifier").setText(gid==null? "n/a": gid); getTextField("(global / local)").setText(lid==null? "n/a": lid.toString()); // getTextField("Processing state").setText(desc.getProcessingState()); getCheckBox("Master").setSelected(desc.getMaster()==null? false: desc.getMaster().booleanValue()); getCheckBox("Daemon").setSelected(desc.getDaemon()==null? false: desc.getDaemon().booleanValue()); getCheckBox("Auto shutdown").setSelected(desc.getAutoShutdown()==null? false: desc.getAutoShutdown().booleanValue()); JTable list = (JTable)getComponent("Addresses"); String[] addresses = desc.getName().getAddresses(); DefaultTableModel dtm = new DefaultTableModel(); dtm.addColumn("Addresses", addresses!=null?addresses:SUtil.EMPTY_STRING_ARRAY); list.setModel(dtm); } }
if(adesc!=null && adesc.getName()!=null) CMSComponentDescription ad = (CMSComponentDescription)getDescription(adesc.getName()); if(ad!=null && ad.getName().equals(adesc.getName())) (adesc.getOwnership()==null || adesc.getOwnership().equals(test.getOwnership())) && (adesc.getType()==null || adesc.getType().equals(test.getType())) && (adesc.getState()==null || adesc.getState().equals(test.getState())) && (adesc.getModelName()==null || adesc.getModelName().equals(test.getModelName())))
if(!priostep && stepfuture==null && !IComponentDescription.STATE_SUSPENDED.equals(getComponent().getComponentDescription().getState()) && getComponent().getComponentDescription().getBreakpoints().length>0) if(isAtBreakpoint(getComponent().getComponentDescription().getBreakpoints())) if((IComponentDescription.STATE_ACTIVE.equals(getComponent().getComponentDescription().getState()))) cms.suspendComponent(getComponent().getComponentDescription().getName()); if(IComponentDescription.STATE_ACTIVE.equals(getComponent().getComponentDescription().getState()) || stepfuture!=null)
/** * Measure the value. */ public Long measureValue() { return System.currentTimeMillis()-comp.getComponentDescription().getCreationTime(); } }
public void run() { // System.out.println("update: "+desc); pause.setEnabled(!IComponentDescription.STATE_SUSPENDED.equals(desc.getState())); step.setEnabled(IComponentDescription.STATE_SUSPENDED.equals(desc.getState())); // && IComponentDescription.PROCESSINGSTATE_READY.equals(desc.getProcessingState())); run.setEnabled(IComponentDescription.STATE_SUSPENDED.equals(desc.getState())); } });
public void actionPerformed(ActionEvent e) { TreePath[] paths = comptree.getTree().getSelectionPaths(); for(int i=0; paths!=null && i<paths.length; i++) { if(paths[i].getLastPathComponent() instanceof IActiveComponentTreeNode && BDIAgentFactory.FILETYPE_BDIAGENT.equals(((IActiveComponentTreeNode)paths[i].getLastPathComponent()).getDescription().getType())) { IActiveComponentTreeNode node = (IActiveComponentTreeNode)paths[i].getLastPathComponent(); IComponentDescription desc = node.getDescription(); RuleProfilerPanel panel = new RuleProfilerPanel(getJCC().getPlatformAccess().getServiceProvider(), desc.getName()); // SHelp.setupHelp(panel, getHelpID()); detail.add(panel, desc); comptree.getModel().fireNodeChanged(node); } } } };
public void run() { addStep(new StepInfo(step, ret, null, getComponentDescription().getCause().createNext()));//step.toString()))); }
if(!IComponentDescription.STATE_TERMINATED.equals(desc.getState())) if(!dostep && !IComponentDescription.STATE_SUSPENDED.equals(desc.getState())) if(component.isAtBreakpoint(desc.getBreakpoints())) if(!breakpoint_triggered && !extexecuted && (!IComponentDescription.STATE_SUSPENDED.equals(desc.getState()) || dostep)) if(!IComponentDescription.STATE_SUSPENDED.equals(desc.getState())) if(component.isAtBreakpoint(desc.getBreakpoints())) this.componentthread = null; ret = (again && !IComponentDescription.STATE_SUSPENDED.equals(desc.getState())) || extexecuted;
public void run() { if(BDIAgentFactory.FILETYPE_BDIAGENT.equals(ad.getType())) { if(cards.isAvailable(ad)) { detail.remove(cards.getComponent(ad)); } } } });
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int column) { TableSorter sorter = (TableSorter)list.getModel(); boolean selected = SUtil.arrayContains(description.getBreakpoints(), breakpoints.get(sorter.modelIndex(rowIndex))); JPanel ret = new JPanel(new BorderLayout()); JCheckBox but = new JCheckBox((String)null, selected); ret.add(but, BorderLayout.CENTER); ret.setToolTipText("Enable/disable breakpoint."); return ret; }
/** * Get the local type name of this component as defined in the parent. * @return The type of this component type. */ public String getLocalType() { return getComponent().getComponentDescription().getLocalType(); }
if(adesc!=null && adesc.getName()!=null) CMSComponentDescription ad = (CMSComponentDescription)getDescription(adesc.getName()); if(ad!=null && ad.getName().equals(adesc.getName())) (adesc.getOwnership()==null || adesc.getOwnership().equals(test.getOwnership())) && (adesc.getType()==null || adesc.getType().equals(test.getType())) && (adesc.getState()==null || adesc.getState().equals(test.getState())) && (adesc.getModelName()==null || adesc.getModelName().equals(test.getModelName())))
/** * Create a thread event (creation, modification, termination). */ public IMonitoringEvent createThreadEvent(String type, ProcessThread thread) { MonitoringEvent event = new MonitoringEvent(getComponentIdentifier(), getComponentDescription().getCreationTime(), type+"."+TYPE_THREAD, System.currentTimeMillis(), PublishEventLevel.FINE); event.setProperty("thread_id", thread.getId()); if(!type.startsWith(IMonitoringEvent.EVENT_TYPE_DISPOSAL)) event.setProperty("details", createProcessThreadInfo(thread)); return event; // return new ComponentChangeEvent(type, TYPE_THREAD, thread.getClass().getName(), // thread.getId(), getComponentIdentifier(), getComponentDescription().getCreationTime(), // IComponentChangeEvent.EVENT_TYPE_DISPOSAL.equals(type) ? null : createProcessThreadInfo(thread)); }
public void run() { // System.out.println("update: "+desc); pause.setEnabled(!IComponentDescription.STATE_SUSPENDED.equals(desc.getState())); step.setEnabled(IComponentDescription.STATE_SUSPENDED.equals(desc.getState())); // && IComponentDescription.PROCESSINGSTATE_READY.equals(desc.getProcessingState())); run.setEnabled(IComponentDescription.STATE_SUSPENDED.equals(desc.getState())); } });
if(!IComponentDescription.STATE_TERMINATED.equals(desc.getState())) if(!dostep && !IComponentDescription.STATE_SUSPENDED.equals(desc.getState())) if(component.isAtBreakpoint(desc.getBreakpoints())) if(!breakpoint_triggered && !extexecuted && !notifexecuted && (!IComponentDescription.STATE_SUSPENDED.equals(desc.getState()) || dostep)) if(!IComponentDescription.STATE_SUSPENDED.equals(desc.getState())) if(component.isAtBreakpoint(desc.getBreakpoints())) ret = (again && !IComponentDescription.STATE_SUSPENDED.equals(desc.getState())) || extexecuted || notifexecuted;