/** * 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 { }
/** * Create a service implementation. */ protected ProvidedServiceImplementation createImplementation(Implementation impl) { return new ProvidedServiceImplementation(!impl.value().equals(Object.class)? impl.value(): null, impl.expression().length()>0? impl.expression(): null, impl.proxytype(), createBinding(impl.binding()), createUnparsedExpressions(impl.interceptors())); }
/** * 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 { }
/** * Create a service implementation. */ protected ProvidedServiceImplementation createImplementation(Implementation impl, Class<?> cma) { Class<?> cl = impl.value(); String exp = impl.expression().length()>0? impl.expression(): null; // If not specified (Object is default) or if user accidentally used pojo class -> ignore if(cl.equals(Object.class)) { cl = null; } else if(cl.equals(cma)) { cl = null; exp = "$pojoagent!=null? $pojoagent: $component"; System.out.println("Warning: ignoring implementation class because agent is service implementation"); } return new ProvidedServiceImplementation(cl, exp, impl.proxytype(), createBinding(impl.binding()), createUnparsedExpressions(impl.interceptors())); }
/** * Default monitoring agent. */ @Agent @ProvidedServices(@ProvidedService(type=IMonitoringService.class, implementation=@Implementation(MonitoringService.class))) public class MonitoringAgent { }
Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; if(inters.length>0) RequiredServiceBinding bind = createBinding(im.binding()); 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(),
/** * 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 { }
Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; if(inters.length>0) Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; if(inters.length>0) RequiredServiceBinding bind = createBinding(im.binding()); 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(),
/** * Agent that publishes the rs publication service. */ @Agent @ProvidedServices( { @ProvidedService(name="publish_rs", type=IPublishService.class, implementation=@Implementation(DefaultRestServicePublishService.class)) }) public class RSPublishAgent { }
Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; if(inters.length>0) RequiredServiceBinding bind = createBinding(im.binding()); 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(),
/** * Agent that publishes the ws publication service. */ @Agent @ProvidedServices( { @ProvidedService(name="publish_ws", type=IPublishService.class, implementation=@Implementation(DefaultWebServicePublishService.class)) }) public class WSPublishAgent { }
Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; if(inters.length>0) Value[] inters = im.interceptors(); UnparsedExpression[] interceptors = null; if(inters.length>0) RequiredServiceBinding bind = createBinding(im.binding()); 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(),
/** * 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 { }
/** * 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 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 { }
/** * */ @Agent @ProvidedServices(@ProvidedService(type=ITransportAddressService.class, implementation=@Implementation(TransportAddressService.class))) @Properties(value=@NameValue(name="system", value="true")) public class TransportAddressAgent { }
/** * Agent that provides the simulation service. */ @Agent @ProvidedServices(@ProvidedService(type=ISimulationService.class, implementation=@Implementation(SimulationService.class))) @Properties(value=@NameValue(name="system", value="true")) public class SimulationAgent { }
/** * Default monitoring agent. */ @Agent @ProvidedServices(@ProvidedService(type=IMonitoringService.class, implementation=@Implementation(MonitoringService.class))) @Properties(value=@NameValue(name="system", value="true")) public class MonitoringAgent { }