Package jadex.bdiv3

Class BDIClassReader


  • public class BDIClassReader
    extends MicroClassReader
    Reads micro agent classes and generates a model from metainfo and annotations.
    • Constructor Detail

      • BDIClassReader

        public BDIClassReader​(BDIModelLoader loader)
        Create a new bdi class reader.
    • Method Detail

      • setGenerator

        public void setGenerator​(IBDIClassGenerator gen)
        Set the generator.
        Parameters:
        gen - the gen to set
      • createDummyClassLoader

        protected MicroClassReader.DummyClassLoader createDummyClassLoader​(java.lang.ClassLoader original,
                                                                           java.lang.ClassLoader parent,
                                                                           java.util.List<java.net.URL> urls)
        Create a throw away class loader.
      • fillBDIModelFromAnnotations

        protected void fillBDIModelFromAnnotations​(BDIModel bdimodel,
                                                   java.lang.String model,
                                                   java.lang.Class<?> cma,
                                                   java.lang.ClassLoader cl,
                                                   IResourceIdentifier rid,
                                                   IComponentIdentifier root,
                                                   java.util.List<IComponentFeatureFactory> features)
        Fill the model details using annotation. // called with dummy classloader (that was used to load cma first time)
      • buildPlanTrigger

        protected MTrigger buildPlanTrigger​(BDIModel bdimodel,
                                            java.lang.String name,
                                            Trigger trigger,
                                            java.lang.ClassLoader cl,
                                            java.util.Map<ClassInfo,​java.util.List<Tuple2<MGoal,​java.lang.String>>> pubs)
      • getMGoal

        protected MGoal getMGoal​(BDIModel model,
                                 Goal goal,
                                 java.lang.Class<?> gcl,
                                 java.lang.ClassLoader cl,
                                 java.util.Map<ClassInfo,​java.util.List<Tuple2<MGoal,​java.lang.String>>> pubs)
      • createMGoal

        protected MGoal createMGoal​(BDIModel model,
                                    Goal goal,
                                    java.lang.Class<?> gcl,
                                    java.lang.ClassLoader cl,
                                    java.util.Map<ClassInfo,​java.util.List<Tuple2<MGoal,​java.lang.String>>> pubs)
      • createMethodCondition

        protected MCondition createMethodCondition​(MParameterElement mpelem,
                                                   java.lang.String condtype,
                                                   java.lang.String[] evs,
                                                   RawEvent[] rawevs,
                                                   java.lang.String[] paramevs,
                                                   BDIModel model,
                                                   java.lang.reflect.Method m,
                                                   java.lang.ClassLoader cl)
      • readAnnotationEvents

        public static java.util.List<jadex.rules.eca.EventType> readAnnotationEvents​(MCapability capa,
                                                                                     java.lang.annotation.Annotation[][] annos,
                                                                                     java.lang.ClassLoader cl)
        Read the annotation events from method annotations.
      • getMicroAgentClass

        protected java.lang.Class getMicroAgentClass​(java.lang.String clname,
                                                     java.lang.String[] imports,
                                                     java.lang.ClassLoader classloader)
        Get the mirco agent class.
        Overrides:
        getMicroAgentClass in class MicroClassReader
      • createConfigBeliefsList

        protected java.util.List<MConfigBeliefElement> createConfigBeliefsList​(NameValue[] values)
        Create config beliefs.
      • createConfigParamElementsList

        protected java.util.List<MConfigParameterElement> createConfigParamElementsList​(NameValue[] values)
        Create config parameter elements.
      • initBDIModelAfterClassLoading

        protected void initBDIModelAfterClassLoading​(BDIModel model,
                                                     java.lang.ClassLoader cl)
        Do model initialization that can only be done after class reading.