Skip to content

Commit

Permalink
Merge branch 'master' of ssh://git@git.actoron.com:20000/jadex/jadex.git
Browse files Browse the repository at this point in the history
  • Loading branch information
kj-actoron committed Feb 22, 2021
2 parents 3d03653 + 163191d commit bdd6702
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class Main
public static void main(String[] args)
{
IExternalAccess platform = Starter.createPlatform(PlatformConfigurationHandler.getDefault()).get();
//CreationInfo ci = new CreationInfo().setFilenameClass(MandelbrotAgent.class).setConfiguration("nocalcs");
CreationInfo ci = new CreationInfo().setFilenameClass(MandelbrotAgent.class).setConfiguration("pools");
CreationInfo ci = new CreationInfo().setFilenameClass(MandelbrotAgent.class).setConfiguration("nocalcs");
//CreationInfo ci = new CreationInfo().setFilenameClass(MandelbrotAgent.class).setConfiguration("pools");
platform.createComponent(ci).get();
}
}
37 changes: 23 additions & 14 deletions kernels/micro/src/main/java/jadex/micro/MicroClassReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -2531,18 +2531,33 @@ else if(isAnnotationPresent(fields[i], AgentFeature.class, cl))
{
OnService ser = getAnnotation(methods[i], OnService.class, cl);
RequiredService rs = ser.requiredservice();
String name = ser.requiredservice().name().length()>0? ser.requiredservice().name(): guessName(methods[i].getName());
RequiredServiceInfo rsis = createRequiredServiceInfo(rs, cl);
if(new ClassInfo(Object.class).equals(rsis.getType()))

//String name = ser.requiredservice().name().length()>0? ser.requiredservice().name(): guessName(methods[i].getName());
String name = ser.name();

if(name.length()==0)
name = rs.name();
if(name.length()==0)
guessName(methods[i].getName());

RequiredServiceInfo rsis = (RequiredServiceInfo)rsers.get(name);
if(rsis==null)
{
Class<?> iftype = Object.class.equals(ser.requiredservice().type())? guessParameterType(methods[i].getParameterTypes(), cl): ser.requiredservice().type();
rsis.setType(new ClassInfo(iftype));
rsis = createRequiredServiceInfo(rs, cl);

if(new ClassInfo(Object.class).equals(rsis.getType()))
{
Class<?> iftype = Object.class.equals(ser.requiredservice().type())? guessParameterType(methods[i].getParameterTypes(), cl): ser.requiredservice().type();
rsis.setType(new ClassInfo(iftype));
}

checkAndAddRequiredServiceInfo(rsis, rsers, cl);
}

ServiceInjectionInfo sii = new ServiceInjectionInfo().setMethodInfo(new MethodInfo(methods[i])).setRequiredServiceInfo(rsis);

if(ser.requiredservice().name().length()>0)
checkAndAddRequiredServiceInfo(rsis, rsers, cl);
//if(ser.requiredservice().name().length()>0)
// checkAndAddRequiredServiceInfo(rsis, rsers, cl);

if(ser.query().toBoolean()!=null)
sii.setQuery(ser.query().toBoolean());
Expand Down Expand Up @@ -2621,12 +2636,6 @@ public static void checkAndAddRequiredServiceInfo(RequiredServiceInfo rsis, Map<
if(rsis.getName()==null || rsis.getName().length()==0)
return;

//Map<String, Object> rsers = getOrCreateMap("reqservices", toset);

//RequiredServiceInfo rsis = createRequiredServiceInfo(rs, cl);
//if(rsis.getName().length()==0)
// rsis.setName(fields[i].getName());

if(rsers.containsKey(rsis.getName()))
{
RequiredServiceInfo old = (RequiredServiceInfo)rsers.get(rsis.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public static IFuture<Void> injectServices(IInternalAccess component, Object tar

String sername = (String)SJavaParser.evaluateExpressionPotentially(sernames[i], component.getModel().getAllImports(), component.getFetcher(), component.getClassLoader());

//if("secser".equals(sername))
// System.out.println("sdbgjh");
if(sername!=null && sername.indexOf("calc")!=-1)
System.out.println("calc");

for(int j=0; j<infos.length; j++)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,8 @@ public <T> ISubscriptionIntermediateFuture<T> resolveQuery(ServiceQuery<T> quer
enhanceQuery(query, true);
SlidingCuckooFilter scf = new SlidingCuckooFilter();

//System.out.println("query: "+query);

// Query remote
// ISearchQueryManagerService sqms = searchLocalService(new ServiceQuery<>(ISearchQueryManagerService.class).setMultiplicity(Multiplicity.ZERO_ONE));
// if(isRemote(query) && sqms==null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,11 +1040,11 @@ else if(models instanceof IFuture)
{
Starter.putPlatformValue(component.getId().getRoot(), Starter.DATA_COMPONENTMODELS, allres);
})
.delegateEx(ret);
.catchEx(ret);
})
.delegateEx(ret);
.catchEx(ret);
})
.delegateEx(ret);
.catchEx(ret);
return ret;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void maxResultCountAvailable(int max)
}
});
return IFuture.DONE;
}).delegateEx(ret);
}).catchEx(ret);
}

return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,6 @@ public interface IFuture<E>
/**
* Called on exception.
* @param delegate The future the exception will be delegated to.
*/
public <T> IFuture<E> delegateEx(Future<T> delegate);
* /
public <T> IFuture<E> delegateEx(Future<T> delegate);*/
}

0 comments on commit bdd6702

Please sign in to comment.