public IFuture<T> execute(Void args) { return agent.scheduleStep(new IComponentStep<T>() { public IFuture<T> execute(IInternalAccess ia) { return ia.getComponentFeature(IRequiredServicesFeature.class).getRequiredService(reqservicename); } }); } };
/** * Get the rms component identifier. * @return The rms component identifier. */ public IComponentIdentifier getRMSComponentIdentifier() { return component.getComponentIdentifier(); }
public void windowClosing(WindowEvent e) { agent.killComponent(); } });
/** * Test if agent is a buyer. */ public static boolean isBuyer(IExternalAccess agent) { return agent.getModel().getName().indexOf("Buyer")!=-1; } }
/** * Get the local CMS. * @return The local CMS. */ public IFuture<IComponentManagementService> getLocalCMS() { IFuture<IComponentManagementService> ret = SServiceProvider.getService(access.getServiceProvider(), IComponentManagementService.class, RequiredServiceInfo.SCOPE_PLATFORM); return ret; }
/** * Create a new remote service management service. */ public RemoteServiceManagementService(IExternalAccess component, ILibraryService libservice, final IMarshalService marshal, final IMessageService msgservice)//, boolean binarymode) { super(component.getServiceProvider().getId(), IRemoteServiceManagementService.class, null); // System.out.println("binary: "+binarymode); this.component = component; this.rrm = new RemoteReferenceModule(this, libservice, marshal); this.waitingcalls = new HashMap<String, WaitingCallInfo>(); this.processingcalls = new HashMap<String, Object>(); this.terminationcommands = new LRU<String, Runnable>(100); this.timer = new Timer(true); this.marshal = marshal; this.msgservice = msgservice; ((MessageService)msgservice).setContentCodecInfo(component.getComponentIdentifier(), getCodecInfo()); }
/** * Log a warning on a component. */ public static IFuture<Void> logWarning(final String msg, IExternalAccess exta) { return exta.scheduleImmediate(new IComponentStep<Void>() { public IFuture<Void> execute(IInternalAccess ia) { ia.getLogger().warning(msg); return IFuture.DONE; } }); }
/** * Test if agent is a buyer. */ public static boolean isBuyer(IExternalAccess agent) { return agent.getModel().getName().indexOf("Buyer")!=-1; } }
/** * Create a new invocation handler. */ public DelegationInterceptor(IInternalAccess ia, RequiredServiceInfo info, RequiredServiceBinding binding, IRequiredServiceFetcher fetcher, IServiceIdentifier sid, boolean realtime) { this.ea = ia.getExternalAccess(); this.info = info; this.binding = binding; this.fetcher = fetcher!=null? fetcher: new DefaultServiceFetcher(ea.getServiceProvider(), ia, realtime); this.sid = sid; }
/** * Create a new remote service management service. */ public RemoteServiceManagementService(IExternalAccess component, ILibraryService libservice, final IMarshalService marshal, final IMessageService msgservice)//, boolean binarymode) { super(component.getServiceProvider().getId(), IRemoteServiceManagementService.class, null); // System.out.println("binary: "+binarymode); this.component = component; this.rrm = new RemoteReferenceModule(this, libservice, marshal); this.waitingcalls = new HashMap<String, WaitingCallInfo>(); this.processingcalls = new HashMap<String, Object>(); this.terminationcommands = new LRU<String, List<Runnable>>(1000); this.timer = new Timer(true); this.marshal = marshal; this.msgservice = msgservice; ((MessageService)msgservice).setContentCodecInfo(component.getComponentIdentifier(), getCodecInfo()); }
public static void addConsoleListener(IExternalAccess platformaccess, final String id, final IRemoteChangeListener rcl) { platformaccess.scheduleImmediate(new IComponentStep<Void>() { @Classname("installListener") public IFuture<Void> execute(IInternalAccess ia) { ConsoleListener cl = new ConsoleListener(id, ia, rcl); SUtil.addSystemOutListener(cl); SUtil.addSystemErrListener(cl); return IFuture.DONE; } }); }
public void resultAvailable(IExternalAccess exta) { exta.scheduleStep(new IComponentStep<Void>() { public IFuture<Void> execute(IInternalAccess ia) { parenta = (IInternalExecutionFeature)ia.getComponentFeature(IExecutionFeature.class); parenta.addSubcomponent(ExecutionComponentFeature.this); parenta.wakeup(); return IFuture.DONE; } }); }
/** * Create marshal service. */ public MarshalService(IExternalAccess access) { super(access.getComponentIdentifier(), IMarshalService.class, null); this.access = access; }
public void customResultAvailable(IExternalAccess ea) { // System.err.println("Model class loader: "+ea.getModel().getName()+", "+ea.getModel().getClassLoader()); // classloadercache.put(ci.getParent(), ea.getModel().getClassLoader()); ret.setResult(ea.getModel().getResourceIdentifier()); } });
public void actionPerformed(ActionEvent e) { SServiceProvider.getService(agent.getServiceProvider(), IDaemonService.class, RequiredServiceInfo.SCOPE_PLATFORM) .addResultListener(new SwingDefaultResultListener<IDaemonService>() { public void customResultAvailable(IDaemonService result) { IDaemonService ds = (IDaemonService)result; int[] rows = (int[])platformt.getSelectedRows(); for(int i=0; i<rows.length; i++) { IComponentIdentifier cid = (IComponentIdentifier)ptm.getObjectForRow(rows[i]); ds.shutdownPlatform(cid); } } }); } });
public void windowClosing(WindowEvent e) { agent.killComponent(); } });
public static void removeConsoleListener(IExternalAccess platformaccess, final String id) { platformaccess.scheduleImmediate(new IComponentStep<Void>() { @Classname("removeListener") public IFuture<Void> execute(IInternalAccess ia) { ConsoleListener cl = new ConsoleListener(id, ia, null); SUtil.removeSystemOutListener(cl); SUtil.removeSystemErrListener(cl); return IFuture.DONE; } }); }
public static void removeConsoleListener(IExternalAccess platformaccess, final String id) { platformaccess.scheduleStep(new ImmediateComponentStep<Void>() { @Classname("removeListener") public IFuture<Void> execute(IInternalAccess ia) { ConsoleListener cl = new ConsoleListener(id, ia, null); SUtil.removeSystemOutListener(cl); SUtil.removeSystemErrListener(cl); return IFuture.DONE; } }); }
/** * Build an id to be used for remote listener (de-)registration. * @param cid The remote component id. * @return An id for remote listener (de-)registration. */ protected String buildId(final IComponentIdentifier cid) { return "cmslistener_"+hashCode()+"_"+access.getComponentIdentifier().toString()+"_"+cid; } }
public void customResultAvailable(IExternalAccess ea) { // System.err.println("Model class loader: "+ea.getModel().getName()+", "+ea.getModel().getClassLoader()); // classloadercache.put(ci.getParent(), ea.getModel().getClassLoader()); ret.setResult(ea.getModel().getResourceIdentifier()); } }));