/** * Create a new interceptor. */ public MethodCallListenerInterceptor(IInternalAccess component, IServiceIdentifier sid) { super(component); this.sid = sid; this.container = component.getServiceContainer(); }
/** * Property was removed and should be disposed. */ public IFuture<Void> dispose() { comp.getServiceContainer().removeMethodInvocationListener(sid, method, listener); return IFuture.DONE; } }
/** * Property was removed and should be disposed. */ public IFuture<Void> dispose() { comp.getServiceContainer().removeMethodInvocationListener(sid, method, listener); return IFuture.DONE; } }
/** * Property was removed and should be disposed. */ public IFuture<Void> dispose() { comp.getServiceContainer().removeMethodInvocationListener(sid, method, listener); return IFuture.DONE; } }
/** * Search for available chat services. * @return The currently available remote services. */ public IIntermediateFuture<IChatService> findUsers() { IIntermediateFuture<IChatService> ret = agent.getServiceContainer().getRequiredServices("chatservices"); return ret; }
/** * Create a new agent factory. */ // Constructor used by GPMN factory. public BDIAgentFactory(Map<String, Object> props, IInternalAccess component) { // super(component.getServiceContainer().getId(), IComponentFactory.class, props); super(component.getServiceContainer().getId(), IComponentFactory.class, null); this.myprops = props; this.component = component; }
/** * Property was removed and should be disposed. */ public IFuture<Void> dispose() { comp.getServiceContainer().removeMethodInvocationListener(sid, method, listener); return super.dispose(); } }
/** * Create a new execution control. */ public SimulationService(IInternalAccess access, Map properties) { super(access.getServiceContainer().getId(), ISimulationService.class, properties); this.access = access; this.mode = MODE_NORMAL; this.startoninit = true; this.listeners = SCollection.createArrayList(); }
/** * Create a settings service. * @param prefix The settings file prefix to be used (if any). * Uses name from service provider, if no prefix is given. */ public SettingsService(IInternalAccess access, boolean saveonexit) { super(access.getServiceContainer().getId(), ISettingsService.class, null); this.access = access; this.providers = new LinkedHashMap(); this.saveonexit = saveonexit; filename = access.getComponentIdentifier().getPlatformPrefix() + SETTINGS_EXTENSION; }
/** * Start the service. */ public IFuture<Void> startService(IInternalAccess component, IResourceIdentifier rid) { this.provider = component.getServiceContainer(); this.providerid = provider.getId(); createServiceIdentifier("BootstrapFactory", IComponentFactory.class, rid, IComponentFactory.class); return startService(); }
/** * Start the service. */ public IFuture<Void> startService(IInternalAccess component, IResourceIdentifier rid) { this.provider = component.getServiceContainer(); this.providerid = provider.getId(); createServiceIdentifier("BootstrapFactory", IComponentFactory.class, rid, IComponentFactory.class); return startService(); }
/** * Start the service. */ public IFuture<Void> startService(IInternalAccess component, IResourceIdentifier rid) { this.provider = component.getServiceContainer(); this.providerid = provider.getId(); createServiceIdentifier("Bootstrap Factory", IComponentFactory.class, rid, IComponentFactory.class); return startService(); }
/** * Create a new invocation handler. */ public MultiServiceInvocationHandler(IInternalAccess agent, String reqname, Class<?> muxservicetype) { this.agent = agent; this.reqname = reqname; RequiredServiceInfo reqs = agent.getServiceContainer().getRequiredServiceInfo(reqname); if(reqs==null) throw new RuntimeException("Required service not found: "+reqname); this.servicetype = reqs.getType().getType(agent.getClassLoader()); this.muxservicetype = muxservicetype; }
/** * Start the service. */ public IFuture<Void> startService(IInternalAccess component, IResourceIdentifier rid) { this.provider = component.getServiceContainer(); this.providerid = provider.getId(); createServiceIdentifier("BootstrapFactory", IComponentFactory.class, rid, IComponentFactory.class); return startService(); }
/** * Start the service. */ public IFuture<Void> startService(IInternalAccess component, IResourceIdentifier rid) { this.component = component; this.providerid = component.getServiceContainer().getId(); createServiceIdentifier("BootstrapFactory", IComponentFactory.class, rid, IComponentFactory.class); return startService(); }
/** * Start the service. */ public IFuture<Void> startService(IInternalAccess component, IResourceIdentifier rid) { this.provider = component.getServiceContainer(); this.providerid = provider.getId(); createServiceIdentifier("BootstrapFactory", IComponentFactory.class, rid, IComponentFactory.class); return startService(); }
/** * Get the settings service. */ public IFuture<ISettingsService> getSettingsService() { final Future<ISettingsService> ret = new Future<ISettingsService>(); IFuture<ISettingsService> fut = component.getServiceContainer().searchService(ISettingsService.class, RequiredServiceInfo.SCOPE_PLATFORM); fut.addResultListener(new DelegationResultListener<ISettingsService>(ret) { public void exceptionOccurred(Exception exception) { ret.setResult(null); } }); return ret; }
/** * Get the settings service. */ public IFuture<ISettingsService> getSettingsService() { final Future<ISettingsService> ret = new Future<ISettingsService>(); IFuture<ISettingsService> fut = component.getServiceContainer().searchService(ISettingsService.class, RequiredServiceInfo.SCOPE_PLATFORM); fut.addResultListener(new DelegationResultListener<ISettingsService>(ret) { public void exceptionOccurred(Exception exception) { ret.setResult(null); } }); return ret; }
/** * Execute the interceptor. * @param context The invocation context. */ public IFuture<Void> execute(ServiceInvocationContext sic) { // INFMixedPropertyProvider res = component.getRequiredServicePropertyProvider((IServiceIdentifier)sic.getArgumentArray()[0]); INFMixedPropertyProvider res = getComponent().getServiceContainer().getRequiredServicePropertyProvider(sid); sic.setResult(new Future<INFMixedPropertyProvider>(res)); return IFuture.DONE; } }
/** * Get the resource identifier for an url. */ protected IFuture<IResourceIdentifier> internalGetResourceIdentifier(final URL url) { final Future<IResourceIdentifier> ret = new Future<IResourceIdentifier>(); component.getServiceContainer().searchService(IDependencyService.class, RequiredServiceInfo.SCOPE_PLATFORM) .addResultListener(component.createResultListener(new ExceptionDelegationResultListener<IDependencyService, IResourceIdentifier>(ret) { public void customResultAvailable(IDependencyService drs) { drs.getResourceIdentifier(url).addResultListener(new DelegationResultListener<IResourceIdentifier>(ret)); } })); return ret; }