/** * Calculator component that provides all services by itself. */ @Description("This agent is a minimal calculator.") @ProvidedServices({ //@ProvidedService(type=IAddService.class, expression="new AddService($component)"), @ProvidedService(type=IAddService.class, implementation=@Implementation(PojoAddService.class)), @ProvidedService(type=ISubService.class, implementation=@Implementation(expression="new SubService($component)")) }) @Agent public class CalculatorAgent { }
for(int j=0; j<provs.length; j++) Implementation im = provs[j].implementation(); Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; ProvidedServiceImplementation impl = new ProvidedServiceImplementation(!im.value().equals(Object.class)? im.value(): null, im.expression().length()>0? im.expression(): null, im.proxytype(), bind, interceptors); Publish p = provs[j].publish(); PublishInfo pi = p.publishid().length()==0? null: new PublishInfo(p.publishid(), p.publishtype(), p.publishscope(), p.multi(), p.mapping(), SNameValue.createUnparsedExpressions(p.properties())); NameValue[] props = provs[j].properties(); List<UnparsedExpression> serprops = (props != null && props.length > 0) ? new ArrayList<UnparsedExpression>(Arrays.asList(SNameValue.createUnparsedExpressions(props))) : null; psis[j] = new ProvidedServiceInfo(provs[j].name().length()>0? provs[j].name(): null, provs[j].type(), impl, provs[j].scope(), pi, serprops); configinfo.setProvidedServices(psis);
Implementation im = vals[i].implementation(); Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; Publish p = vals[i].publish(); NameValue[] props = p.properties(); UnparsedExpression[] exps = createUnparsedExpressions(props); ProvidedServiceInfo psis = new ProvidedServiceInfo(vals[i].name().length()>0? vals[i].name(): null, vals[i].type(), impl, pi); if(vals[i].name().length()==0 || !psers.containsKey(vals[i].name())) psers.put(vals[i].name().length()==0? ("#"+cnt++): vals[i].name(), psis); if(!configinfo.hasProvidedService(provs[j].name())) Implementation im = provs[j].implementation(); Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; ProvidedServiceImplementation impl = new ProvidedServiceImplementation(!im.value().equals(Object.class)? im.value(): null, im.expression().length()>0? im.expression(): null, im.proxytype(), bind, interceptors); Publish p = provs[j].publish(); PublishInfo pi = p.publishid().length()==0? null: new PublishInfo(p.publishid(), p.publishtype(), p.mapping(), createUnparsedExpressions(p.properties())); ProvidedServiceInfo psi = new ProvidedServiceInfo(provs[j].name().length()>0? provs[j].name(): null, provs[j].type(), impl, pi);
Implementation im = vals[i].implementation(); Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; Publish p = vals[i].publish(); NameValue[] props = p.properties(); UnparsedExpression[] exps = SNameValue.createUnparsedExpressions(props); props = vals[i].properties(); List<UnparsedExpression> serprops = (props != null && props.length > 0) ? new ArrayList<UnparsedExpression>(Arrays.asList(SNameValue.createUnparsedExpressions(props))) : null; ProvidedServiceInfo psis = new ProvidedServiceInfo(vals[i].name().length()>0? vals[i].name(): null, vals[i].type(), impl, vals[i].scope(), pi, serprops); if(vals[i].name().length()==0 || !psers.containsKey(vals[i].name())) psers.put(vals[i].name().length()==0? ("#"+cnt++): vals[i].name(), psis); if(!configinfo.hasProvidedService(provs[j].name())) Implementation im = provs[j].implementation(); Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; ProvidedServiceImplementation impl = new ProvidedServiceImplementation(!im.value().equals(Object.class)? im.value(): null, im.expression().length()>0? im.expression(): null, im.proxytype(), bind, interceptors); Publish p = provs[j].publish(); PublishInfo pi = p.publishid().length()==0? null: new PublishInfo(p.publishid(), p.publishtype(), p.publishscope(), p.multi(), p.mapping(), SNameValue.createUnparsedExpressions(p.properties()));
for(int j=0; j<provs.length; j++) Implementation im = provs[j].implementation(); Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; ProvidedServiceImplementation impl = new ProvidedServiceImplementation(!im.value().equals(Object.class)? im.value(): null, im.expression().length()>0? im.expression(): null, im.proxytype(), bind, interceptors); Publish p = provs[j].publish(); PublishInfo pi = p.publishid().length()==0? null: new PublishInfo(p.publishid(), p.publishtype(), p.mapping(), createUnparsedExpressions(p.properties())); psis[j] = new ProvidedServiceInfo(provs[j].name().length()>0? provs[j].name(): null, provs[j].type(), impl, pi); configinfo.setProvidedServices(psis);
/** * Micro kernel. */ @Imports("jadex.commons.*") @ProvidedServices({@ProvidedService(type=IComponentFactory.class, implementation=@Implementation( expression="new MicroAgentFactory($component.getServiceProvider(), SUtil.createHashMap(new String[]{\"debugger.panels\"},new Object[]{\"jadex.tools.debugger.micro.MicroDebuggerPanel\"}))")) }) public class KernelMicroAgent extends MicroAgent { }
/** * Default monitoring agent. */ @Agent @ProvidedServices(@ProvidedService(type=IMonitoringService.class, implementation=@Implementation(MonitoringService.class))) public class MonitoringAgent { }
/** * Agent that provides a service only within the own platform. */ @Agent @ProvidedServices(@ProvidedService(type = IMessageService.class, implementation = @Implementation(MessageService.class), scope = RequiredServiceInfo.SCOPE_PLATFORM)) public class SecondAgent { }
@Agent @Service @ProvidedServices(@ProvidedService(type = ITestService.class)) public class ProviderAgent implements ITestService { }
/** * Agent that publishes the rs publication service. */ @Agent @ProvidedServices( { @ProvidedService(name="publish_rs", type=IPublishService.class, implementation=@Implementation(DefaultRestServicePublishService.class)) }) public class RSPublishAgent { }
/** * Agent that publishes the ws publication service. */ @Agent @ProvidedServices( { @ProvidedService(name="publish_ws", type=IPublishService.class, implementation=@Implementation(DefaultWebServicePublishService.class)) }) public class WSPublishAgent { }
@Agent @Service @ProvidedServices(@ProvidedService(type=IInfoService.class)) public class MicroProviderAgent implements IInfoService { /** * Get some info. * @return Some info. */ public IFuture<String> getInfo() { return new Future<String>("some info"); } }
@Agent @Service @ProvidedServices(@ProvidedService(type=IInfoService.class)) public class PojoProviderAgent implements IInfoService { /** * Get some info. * @return Some info. */ public IFuture<String> getInfo() { return new Future<String>("some info"); } }
/** * Agent that provides the example service. */ @Agent @Service @ProvidedServices(@ProvidedService(type=IExampleService.class))//, scope=RequiredServiceInfo.SCOPE_APPLICATION)) public class ProviderAgent implements IExampleService { /** * An example method. */ public IFuture<String> getInfo() { return new Future<String>("info"); } }
/** * Agent that provides the example service. */ @Agent @Service @ProvidedServices(@ProvidedService(type=IExampleService.class, scope=RequiredServiceInfo.SCOPE_APPLICATION)) public class ProviderAgent implements IExampleService { /** * An example method. */ public IFuture<String> getInfo() { return new Future<String>("info"); } }
/** * Component kernel. */ @Properties({ @NameValue(name="kernel.types", value="new String[] { \"component.xml\"}") }) @ProvidedServices({ @ProvidedService(type=IComponentFactory.class, implementation=@Implementation(expression="new jadex.component.ComponentComponentFactory($component.getServiceProvider())")) }) public class KernelComponentAgent extends MicroAgent { }
/** * Chat micro agent. */ @Description("This agent offers a chat service.") @ProvidedServices({ @ProvidedService(name="chat", type=IChatService.class, implementation=@Implementation(ChatService.class)), @ProvidedService(type=IChatGuiService.class, implementation=@Implementation(expression="$component.getRawService(\"chat\")")) }) @RequiredServices( @RequiredService(name="chatservices", type=IChatService.class, multiple=true, binding=@Binding(dynamic=true, scope=Binding.SCOPE_GLOBAL)) ) public class ChatAgent extends MicroAgent { }
/** * Chat micro agent with a registry service. */ @Description("This agent provides a registry service.") @Agent @ProvidedServices(@ProvidedService(type=IRegistryServiceE3.class, implementation=@Implementation(RegistryServiceE3.class))) public class RegistryE3Agent { }
/** * Component kernel. */ @Properties(@NameValue(name="kernel.types", value="new String[]{\"BDI.class\"}")) @ProvidedServices({ @ProvidedService(type=IComponentFactory.class, implementation=@Implementation( // expression="new jadex.bdiv3.BDIAgentFactory($component.getServiceProvider())")) expression="new jadex.bdiv3.BDIAgentFactory($component.getServiceProvider(), jadex.commons.SUtil.createHashMap(new String[]{\"debugger.panels\"},new Object[]{\"jadex.tools.debugger.bdiv3.BDIViewerDebuggerPanel\"}))")) }) public class KernelBDIV3Agent extends MicroAgent { }
@Agent @Service @ProvidedServices({ @ProvidedService(type=IInjectionTestService.class, implementation = @Implementation(InjectionTestService.class)) }) public class ProviderAgent { }