Difference between revisions of "ExecutionEngine InvokableProfile"

From Gcube Wiki
Jump to: navigation, search
(New page: =Java Object= As a concrete example, lets assume we want to profile the following class <source lang=java> public class Calculator implements IExecutionContextEnabled { private int salt...)
 
(Eclipse Plug-in)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Java Object=
+
=Eclipse Plug-in=
 +
The construction of a profile for a callable object involves the synthesis of a, potentially complex and large, XML document. To automate this procedure, a plugin for the Eclipse IDE has been created, that bases its operation on annotations within the code to generate the Invocable Profile. This plug-in of course can only be used to create Invocable Profiles for Java Objects and Web Services and not for Shell Scripts. The annotations are only used during the construction of the Invocable profile, and need not be present at runtime at the byte code that the [[ExecutionEngine | Execution Engine]] will invoke, during the execution of an [[ExecutionEngine#Execution_Plan | Execution Plan]] that involves this callable.
  
As a concrete example, lets assume we want to profile the following class
+
The annotations defined are the following:
 +
*For Java Objects
 +
**MadgikPojoInvocable
 +
**:Decorates the class definition.
 +
**MadgikPojoConstructor
 +
**:Decorates the constructors that should be visible by the [[ExecutionEngine | Execution Engine]].
 +
**MadgikPojoMethod
 +
**:Decorates the methods that should be visible by the [[ExecutionEngine | Execution Engine]].
 +
**MadgikPojoArgument
 +
**:Decorates all arguments of constructors or methods that are visible by the [[ExecutionEngine | Execution Engine]].
 +
*For Web Services
 +
**MadgikWSInvocable
 +
**:Decorates the Web Service class definition.
 +
**MadgikWSMethod
 +
**:Decorates the methods that should be visible by the [[ExecutionEngine | Execution Engine]].
 +
**MadgikWSArgument
 +
**:Decorates all arguments of methods that are visible by the [[ExecutionEngine | Execution Engine]].
  
<source lang=java>
+
All of these annotations define parameters, which must be defined or set to their default values.
public class Calculator implements IExecutionContextEnabled {
+
private int salt = 0;
+
private IExecutionContext Context = null;
+
  
public Calculator(){}
+
Once all the needed methods, arguments, constructors, and objects are fully decorated, and the plugin installed, the context menu of the Java file that has been decorated can be used to generate the Invocable Profile.
public Calculator(int salt) {this.salt = salt;}
+
public static int GetProposedSalt(){return 10;}
+
public int add(int []parts) {
+
int count=0;
+
for(int i=0;i<parts.length;i+=1) {count+=parts[i];}
+
return count;
+
}
+
public int add(int [][][]parts) {
+
int count=0;
+
for(int i=0;i<parts.length;i+=1) { for(int q=0;q<parts[i].length;q+=1) { count+=this.add(parts[i][q]); } }
+
return count;
+
}
+
public int[] add(int [][]parts) {
+
int []res=new int[parts.length];
+
for(int i=0;i<parts.length;i+=1) {
+
int count=0;
+
for(int q=0;q<parts[i].length;q+=1) { count+=parts[i][q]; }
+
res[i]=count;
+
}
+
return res;
+
}
+
public int add(CalculatorHolder []holders) {
+
int count=0;
+
for(int i=0;i<holders.length;i+=1) { count+=(holders[i].X+holders[i].Y); }
+
return count;
+
}
+
public CalculatorHolder[] add(CalculatorHolder [][]holders) {
+
CalculatorHolder []res=new CalculatorHolder[holders.length];
+
for(int i=0;i<holders.length;i+=1)
+
{
+
int count=0;
+
for(int q=0;q<holders[i].length;q+=1){ count+=(holders[i][q].X+holders[i][q].Y); }
+
res[i]=new CalculatorHolder();
+
res[i].Result=count;
+
}
+
return res;
+
}
+
public CalculatorHolder[][] random() {
+
CalculatorHolder[][] ret=new CalculatorHolder[3][3];
+
ret[0][0]=new CalculatorHolder(1);
+
ret[0][1]=new CalculatorHolder(2);
+
ret[0][2]=new CalculatorHolder(3);
+
ret[1][0]=new CalculatorHolder(4);
+
ret[1][1]=new CalculatorHolder(5);
+
ret[1][2]=new CalculatorHolder(6);
+
ret[2][0]=new CalculatorHolder(7);
+
ret[2][1]=new CalculatorHolder(8);
+
ret[2][2]=new CalculatorHolder(9);
+
return ret;
+
}
+
public int add(int x, Integer y) {
+
if (this.Context != null) this.Context.Report("in the process of adding");
+
return x + y;
+
}
+
public int minus(int x, Integer y){
+
if (this.Context != null) this.Context.Report("in the process of subtracting");
+
return x - y;
+
}
+
public int multiply(int x, Integer y) {
+
if (this.Context != null) this.Context.Report("in the process of multiplying");
+
return x * y;
+
}
+
public int multiplySalted(int x, Integer y) {
+
if (this.Context != null) this.Context.Report("in the process of multiplying with salt");
+
return x * y * this.salt;
+
}
+
public CalculatorHolder multiplySaltedHolder(CalculatorHolder Holder) {
+
if (this.Context != null) this.Context.Report("in the process of multiplying with salt with holder info");
+
Holder.Result = Holder.X * Holder.Y * Holder.Salt;
+
return Holder;
+
}
+
public IExecutionContext GetExecutionContext() { return this.Context; }
+
public void SetExecutionContext(IExecutionContext Context) { this.Context = Context; }
+
}
+
</source>
+
  
The respective Invokable Profile for this Java Object could be the following
+
The following screenshot displays this context menu, and the commands it offers.
  
<source lang=xml>
+
[[Image:ExecutionEngine_Decoration_ContextMenu.png]]
<?xml version="1.0" encoding="UTF-8"?>
+
<execprf:InvocableProfile xmlns:execprf="http://profile.execution.madgik.di.uoa.gr" type="Pojo">
+
  <execprf:item>
+
      <execprf:className value="gr.uoa.di.madgik.callables.test.Calculator"/>
+
      <execprf:context supported="true">
+
        <execprf:type value="Simple"/>
+
        <execprf:keepAlive value="false"/>
+
        <execprf:reportsProgress value="true"/>
+
        <execprf:gRSProxy value="false"/>
+
      </execprf:context>
+
  </execprf:item>
+
  <execprf:calls>
+
      <execprf:call type="Simple">
+
        <execprf:method name="gr.uoa.di.madgik.callables.test.Calculator"/>
+
        <execprf:signature>public gr.uoa.di.madgik.callables.test.Calculator()</execprf:signature>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="gr.uoa.di.madgik.callables.test.Calculator"/>
+
        <execprf:signature>public gr.uoa.di.madgik.callables.test.Calculator(int)</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="salt"/>
+
            <execprf:token value="[execprfBeginToken]salt[execprfEndToken]"/>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="minus"/>
+
        <execprf:signature>public int gr.uoa.di.madgik.callables.test.Calculator.minus(int,java.lang.Integer)</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="x"/>
+
            <execprf:token value="[execprfBeginToken]x[execprfEndToken]"/>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="1"/>
+
            <execprf:name value="y"/>
+
            <execprf:token value="[execprfBeginToken]y[execprfEndToken]"/>
+
            <execprf:type value="java.lang.Integer"/>
+
            <execprf:engineType value="IntegerClass"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="GetProposedSalt"/>
+
        <execprf:signature>public static int gr.uoa.di.madgik.callables.test.Calculator.GetProposedSalt()</execprf:signature>
+
        <execprf:return>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="multiplySalted"/>
+
        <execprf:signature>public int gr.uoa.di.madgik.callables.test.Calculator.multiplySalted(int,java.lang.Integer)</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="x"/>
+
            <execprf:token value="[execprfBeginToken]x[execprfEndToken]"/>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="1"/>
+
            <execprf:name value="y"/>
+
            <execprf:token value="[execprfBeginToken]y[execprfEndToken]"/>
+
            <execprf:type value="java.lang.Integer"/>
+
            <execprf:engineType value="IntegerClass"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="multiplySaltedHolder"/>
+
        <execprf:signature>public gr.uoa.di.madgik.callables.test.CalculatorHolder gr.uoa.di.madgik.callables.test.Calculator.multiplySaltedHolder(gr.uoa.di.madgik.callables.test.CalculatorHolder)</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="Holder"/>
+
            <execprf:token value="[execprfBeginToken]Holder[execprfEndToken]"/>
+
            <execprf:type value="gr.uoa.di.madgik.callables.test.CalculatorHolder"/>
+
            <execprf:engineType value="Convertable"/>
+
            <execprf:converter value="gr.uoa.di.madgik.execution.test.CalculatorHolderConverter"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="gr.uoa.di.madgik.callables.test.CalculatorHolder"/>
+
            <execprf:engineType value="Convertable"/>
+
            <execprf:converter value="gr.uoa.di.madgik.execution.test.CalculatorHolderConverter"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="add"/>
+
        <execprf:signature>public int gr.uoa.di.madgik.callables.test.Calculator.add(int[])</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="parts"/>
+
            <execprf:token value="[execprfBeginToken]parts[execprfEndToken]"/>
+
            <execprf:type value="[I"/>
+
            <execprf:engineType value="[IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="add"/>
+
        <execprf:signature>public int gr.uoa.di.madgik.callables.test.Calculator.add(int[][][])</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="parts"/>
+
            <execprf:token value="[execprfBeginToken]parts[execprfEndToken]"/>
+
            <execprf:type value="[[[I"/>
+
            <execprf:engineType value="[[[IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="add"/>
+
        <execprf:signature>public int[] gr.uoa.di.madgik.callables.test.Calculator.add(int[][])</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="parts"/>
+
            <execprf:token value="[execprfBeginToken]parts[execprfEndToken]"/>
+
            <execprf:type value="[[I"/>
+
            <execprf:engineType value="[[IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="[I"/>
+
            <execprf:engineType value="[IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="add"/>
+
        <execprf:signature>public int gr.uoa.di.madgik.callables.test.Calculator.add(gr.uoa.di.madgik.callables.test.CalculatorHolder[])</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="holders"/>
+
            <execprf:token value="[execprfBeginToken]holders[execprfEndToken]"/>
+
            <execprf:type value="[Lgr.uoa.di.madgik.callables.test.CalculatorHolder;"/>
+
            <execprf:engineType value="[Convertable"/>
+
            <execprf:converter value="gr.uoa.di.madgik.execution.test.CalculatorHolderConverter"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="add"/>
+
        <execprf:signature>public gr.uoa.di.madgik.callables.test.CalculatorHolder[] gr.uoa.di.madgik.callables.test.Calculator.add(gr.uoa.di.madgik.callables.test.CalculatorHolder[][])</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="holders"/>
+
            <execprf:token value="[execprfBeginToken]holders[execprfEndToken]"/>
+
            <execprf:type value="[[Lgr.uoa.di.madgik.callables.test.CalculatorHolder;"/>
+
            <execprf:engineType value="[[Convertable"/>
+
            <execprf:converter value="gr.uoa.di.madgik.execution.test.CalculatorHolderConverter"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="[Lgr.uoa.di.madgik.callables.test.CalculatorHolder;"/>
+
            <execprf:engineType value="[Convertable"/>
+
            <execprf:converter value="gr.uoa.di.madgik.execution.test.CalculatorHolderConverter"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="add"/>
+
        <execprf:signature>public int gr.uoa.di.madgik.callables.test.Calculator.add(int,java.lang.Integer)</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="x"/>
+
            <execprf:token value="[execprfBeginToken]x[execprfEndToken]"/>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="1"/>
+
            <execprf:name value="y"/>
+
            <execprf:token value="[execprfBeginToken]y[execprfEndToken]"/>
+
            <execprf:type value="java.lang.Integer"/>
+
            <execprf:engineType value="IntegerClass"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="random"/>
+
        <execprf:signature>public gr.uoa.di.madgik.callables.test.CalculatorHolder[][] gr.uoa.di.madgik.callables.test.Calculator.random()</execprf:signature>
+
        <execprf:return>
+
            <execprf:type value="[[Lgr.uoa.di.madgik.callables.test.CalculatorHolder;"/>
+
            <execprf:engineType value="[[Convertable"/>
+
            <execprf:converter value="gr.uoa.di.madgik.execution.test.CalculatorHolderConverter"/>
+
        </execprf:return>
+
      </execprf:call>
+
      <execprf:call type="Simple">
+
        <execprf:method name="multiply"/>
+
        <execprf:signature>public int gr.uoa.di.madgik.callables.test.Calculator.multiply(int,java.lang.Integer)</execprf:signature>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="0"/>
+
            <execprf:name value="x"/>
+
            <execprf:token value="[execprfBeginToken]x[execprfEndToken]"/>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:argument type="Simple">
+
            <execprf:order value="1"/>
+
            <execprf:name value="y"/>
+
            <execprf:token value="[execprfBeginToken]y[execprfEndToken]"/>
+
            <execprf:type value="java.lang.Integer"/>
+
            <execprf:engineType value="IntegerClass"/>
+
            <execprf:converter value="none"/>
+
        </execprf:argument>
+
        <execprf:return>
+
            <execprf:type value="int"/>
+
            <execprf:engineType value="IntegerPrimitive"/>
+
            <execprf:converter value="none"/>
+
        </execprf:return>
+
      </execprf:call>
+
  </execprf:calls>
+
</execprf:InvocableProfile>
+
</source>
+
  
Moving into a more complex example let's assume we want to profile the following class
+
The output of the processing, which is the Invocable Profile, is displayed in a new Console, or dumped in a file.
  
<source lang=java>
+
[[Image:ExecutionEngine_Decoration_Profile.png]]
public class ReflectablesOperator
+
 
{
+
In cases of errors or warnings during the processing, the Java file is marked respectively, and the Problems list is updated with the description of the problem. These errors can be cleared either by correcting the error and reprocessing the decorations, or by selecting the ''Clear Warnings and Errors'' from the context menu.
public ReflectablesOperator(){}
+
 
public PrimitiveContainer ProduceReflectable() {
+
[[Image:ExecutionEngine_Decoration_Error.png]]
PrimitiveContainer cont=new PrimitiveContainer();
+
cont.setBooleanClassField(true);
+
cont.setBooleanPrimitiveField(false);
+
cont.setDoubleClassField(4.6);
+
cont.setDoublePrimitiveField(5.2);
+
cont.setFloatClassField(2.4f);
+
cont.setFloatPrimitiveField(3.6f);
+
cont.setIntegerClassField(3);
+
cont.setIntegerPrimitiveField(4);
+
cont.setStringField("Hello world");
+
cont.setPoxyLocatorField(new LocalProxyLocator());
+
cont.setStoreLocatorField(new LocalStoreLocator());
+
return cont;
+
}
+
public PrimitiveContainer[] ArrayProduceReflectable() {
+
PrimitiveContainer cont=this.ProduceReflectable();
+
PrimitiveContainer[] arr=new PrimitiveContainer[]{cont,cont,cont};
+
return arr;
+
}
+
public String ConsumeReflectable(PrimitiveContainer cont) {return cont.toString();}
+
public String ArrayConsumeReflectable(PrimitiveContainer[] cont) {
+
StringBuilder buf=new StringBuilder();
+
buf.append("<array>");
+
for(PrimitiveContainer cont1 : cont) { buf.append(cont1.toString()); }
+
buf.append("</array>");
+
return buf.toString();
+
}
+
public String ConsumeReflectable(SubPrimitiveContainer cont) { return cont.toString(); }
+
public String ArrayConsumeReflectable(SubPrimitiveContainer[] cont)
+
{
+
StringBuilder buf=new StringBuilder();
+
buf.append("<array>");
+
for(SubPrimitiveContainer cont1 : cont) { buf.append(cont1.toString()); }
+
buf.append("</array>");
+
return buf.toString();
+
}
+
public ArrayOfPrimitiveContainer ProduceArrayofPrimitives() {
+
ArrayOfPrimitiveContainer cont=new ArrayOfPrimitiveContainer();
+
cont.setIntegerPrimitiveArray(new int[]{1,2,3,4,5,6,7,8,9});
+
cont.setIntegerPrimitiveMultiArray(new int[][][][]{ { { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} } },
+
                                                                      { { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} } },
+
                                                                      { { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} } } });
+
return cont;
+
}
+
public ArrayOfPrimitiveContainer[] ArrayProduceArrayofPrimitives()
+
{
+
ArrayOfPrimitiveContainer cont=new ArrayOfPrimitiveContainer();
+
cont.setIntegerPrimitiveArray(new int[]{1,2,3,4,5,6,7,8,9});
+
cont.setIntegerPrimitiveMultiArray(new int[][][][]{ { { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} } },
+
                                                                      { { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} } },
+
                                                                      { { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} },
+
                                                                      { {1,2,3},{1,2,3},{1,2,3} } } });
+
return new ArrayOfPrimitiveContainer[]{cont,cont,cont};
+
}
+
public String ConsumeArrayofPrimitives(ArrayOfPrimitiveContainer cont){ return cont.toString(); }
+
public String ArrayConsumeArrayofPrimitives(ArrayOfPrimitiveContainer []cont) {
+
StringBuilder buf=new StringBuilder();
+
buf.append("<array>");
+
for(ArrayOfPrimitiveContainer cont1 : cont) { buf.append(cont1.toString()); }
+
buf.append("</array>");
+
return buf.toString();
+
}
+
public ArrayOfContainers ProduceArrayofContainers() {
+
PrimitiveContainer cont=this.ProduceReflectable();
+
ArrayOfContainers cont2=new ArrayOfContainers();
+
cont2.setCont(cont);
+
cont2.setOneDContainers(new PrimitiveContainer[]{cont,cont,cont});
+
cont2.setMultiDContainers(new PrimitiveContainer[][][][]{ { { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} },
+
                                                                            { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} },
+
                                                                            { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} } } ,
+
                                                                            { { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} },
+
                                                                            { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} },
+
                                                                            { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} } }});
+
return cont2;
+
}
+
public ArrayOfContainers []ArrayProduceArrayofContainers()
+
{
+
PrimitiveContainer cont=this.ProduceReflectable();
+
ArrayOfContainers cont2=new ArrayOfContainers();
+
cont2.setCont(cont);
+
cont2.setOneDContainers(new PrimitiveContainer[]{cont,cont,cont});
+
cont2.setMultiDContainers(new PrimitiveContainer[][][][]{ { { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} },
+
                                                                            { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} },
+
                                                                            { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} } } ,
+
                                                                            { { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} },
+
                                                                            { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} },
+
                                                                            { {cont,cont,cont},{cont,cont,cont},{cont,cont,cont} } }});
+
return new ArrayOfContainers[]{cont2,cont2,cont2};
+
}
+
public String ConsumeArrayofContainers(ArrayOfContainers cont) { return cont.toString(); }
+
public String ArrayConsumeArrayofContainers(ArrayOfContainers []cont) {
+
StringBuilder buf=new StringBuilder();
+
buf.append("<array>");
+
for(ArrayOfContainers cont1 : cont) { buf.append(cont1.toString()); }
+
buf.append("</array>");
+
return buf.toString();
+
}
+
public String ConsumeArrayofSubContainers(ArrayOfSubContainers cont) { return cont.toString(); }
+
public String ArrayConsumeArrayofSubContainers(ArrayOfSubContainers []cont) {
+
StringBuilder buf=new StringBuilder();
+
buf.append("<array>");
+
for(ArrayOfSubContainers cont1 : cont) { buf.append(cont1.toString()); }
+
buf.append("</array>");
+
return buf.toString();
+
}
+
}
+
</source>
+

Latest revision as of 08:52, 27 November 2013

Eclipse Plug-in

The construction of a profile for a callable object involves the synthesis of a, potentially complex and large, XML document. To automate this procedure, a plugin for the Eclipse IDE has been created, that bases its operation on annotations within the code to generate the Invocable Profile. This plug-in of course can only be used to create Invocable Profiles for Java Objects and Web Services and not for Shell Scripts. The annotations are only used during the construction of the Invocable profile, and need not be present at runtime at the byte code that the Execution Engine will invoke, during the execution of an Execution Plan that involves this callable.

The annotations defined are the following:

  • For Java Objects
    • MadgikPojoInvocable
      Decorates the class definition.
    • MadgikPojoConstructor
      Decorates the constructors that should be visible by the Execution Engine.
    • MadgikPojoMethod
      Decorates the methods that should be visible by the Execution Engine.
    • MadgikPojoArgument
      Decorates all arguments of constructors or methods that are visible by the Execution Engine.
  • For Web Services
    • MadgikWSInvocable
      Decorates the Web Service class definition.
    • MadgikWSMethod
      Decorates the methods that should be visible by the Execution Engine.
    • MadgikWSArgument
      Decorates all arguments of methods that are visible by the Execution Engine.

All of these annotations define parameters, which must be defined or set to their default values.

Once all the needed methods, arguments, constructors, and objects are fully decorated, and the plugin installed, the context menu of the Java file that has been decorated can be used to generate the Invocable Profile.

The following screenshot displays this context menu, and the commands it offers.

ExecutionEngine Decoration ContextMenu.png

The output of the processing, which is the Invocable Profile, is displayed in a new Console, or dumped in a file.

ExecutionEngine Decoration Profile.png

In cases of errors or warnings during the processing, the Java file is marked respectively, and the Problems list is updated with the description of the problem. These errors can be cleared either by correcting the error and reprocessing the decorations, or by selecting the Clear Warnings and Errors from the context menu.

ExecutionEngine Decoration Error.png