congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
StatelessAbstractInterpreter
Code IndexAdd Tabnine to your IDE (free)

How to use
StatelessAbstractInterpreter
in
jadex.kernelbase

Best Java code snippets using jadex.kernelbase.StatelessAbstractInterpreter (Showing top 20 results out of 315)

origin: net.sourceforge.jadex/jadex-kernel-base

  /**
   *  Create a service proxy for registering a provided service.
   */
  public IInternalService	createInternalService(Object service, Class<?> type)
  {
//        boolean moni = getComponentDescription().getMonitoring()!=null? getComponentDescription().getMonitoring().booleanValue(): false;
    PublishEventLevel elm = getComponentDescription().getMonitoring()!=null? getComponentDescription().getMonitoring(): null;
    // todo: remove this? currently the level cannot be turned on due to missing interceptor
    boolean moni = elm!=null && !PublishEventLevel.OFF.equals(elm); 
    
    IInternalService    is    = BasicServiceInvocationHandler.createProvidedServiceProxy(
      getInternalAccess(), getComponentAdapter(), service, null,
      type, BasicServiceInvocationHandler.PROXYTYPE_DECOUPLED,
      null, isCopy(), isRealtime(),
      getModel().getResourceIdentifier(), moni, null);
    
    return is;
  }
 
origin: net.sourceforge.jadex/jadex-kernel-base

  public void customResultAvailable(Void result)
  {
    initProvidedServices(i+1, services, model)
      .addResultListener(createResultListener(new DelegationResultListener<Void>((Future<Void>)ret)));
  }
}));
origin: net.sourceforge.jadex/jadex-kernel-base

  public void customResultAvailable(Void result)
  {
    // Start service container.
    startServiceContainer().addResultListener(createResultListener(new DelegationResultListener(ret)));
  }
}));
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *    Create an external access.
 */
public ExternalAccess(StatelessAbstractInterpreter interpreter)
{
  this.interpreter = interpreter;
  this.adapter = interpreter.getComponentAdapter();
  this.tostring = interpreter.getComponentIdentifier().getLocalName();
  this.provider = interpreter.getServiceContainer();
}
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Get a raw reference to a provided service implementation.
 */
public Object getRawService(Class type)
{
  assert !getComponentAdapter().isExternalThread();
  
  IService[] sers = getServiceContainer().getProvidedServices(type);
  return convertRawService(sers[0]);
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

assert !getComponentAdapter().isExternalThread();
      getClassLoader()))+":virtual", info.getType().getType(getClassLoader()));
    IServiceIdentifier sid = BasicService.createServiceIdentifier(getExternalAccess().getServiceProvider().getId(), 
      rsi.getName(), rsi.getType().getType(getClassLoader()), BasicServiceInvocationHandler.class, getModel().getResourceIdentifier());
    final IInternalService service = BasicServiceInvocationHandler.createDelegationProvidedServiceProxy(
      getInternalAccess(), getComponentAdapter(), sid, rsi, impl.getBinding(), getClassLoader(), isRealtime());
    getServiceContainer().addService(service, info).addResultListener(createResultListener(new DelegationResultListener<Void>(ret)));
    Object ser = createServiceImplementation(info, model);
            ics[i] = (IServiceInvocationInterceptor)SJavaParser.evaluateExpression(ins[i].getValue(), model.getAllImports(), getFetcher(), getClassLoader());
            ics[i] = (IServiceInvocationInterceptor)ins[i].getClazz().getType(getClassLoader(), model.getAllImports()).newInstance();
      final Class<?> type = info.getType().getType(getClassLoader());
      addService(info.getName(), type, info.getImplementation().getProxytype(), ics, ser, info, componentfetcher)
        .addResultListener(new ExceptionDelegationResultListener<IInternalService, Void>(ret)
origin: net.sourceforge.jadex/jadex-kernel-base

assert !getComponentAdapter().isExternalThread();
      Class<?> clazz = nfprop.getClazz().getType(getClassLoader());
      INFProperty<?, ?> nfp = AbstractNFProperty.createProperty(clazz, getInternalAccess(), null, null);
      addNFProperty(nfp);
      getLogger().warning("Property creation problem: "+e);
        Class<?> clazz = unexp.getClazz()!=null? unexp.getClazz().getType(getClassLoader(), model.getAllImports()): null;
        Object tmp;
        if(unexp.getValue()==null || unexp.getValue().length()==0 && clazz!=null)
          tmp = SJavaParser.evaluateExpression(unexp.getValue(), model.getAllImports(), getFetcher(), getClassLoader());
            ((IFuture)val).addResultListener(createResultListener(new DefaultResultListener()
          addProperty(name, val);
origin: net.sourceforge.jadex/jadex-kernel-base

assert !getComponentAdapter().isExternalThread();
    addArgument(entry.getKey(), entry.getValue());
  for(int i=0; i<upes.length; i++)
    addArgument(upes[i].getName(), SJavaParser.getParsedValue(upes[i], model.getAllImports(), getFetcher(), getClassLoader()));
    done.add(upes[i].getName());
    addArgument(margs[i].getName(),
      SJavaParser.getParsedValue(margs[i].getDefaultValue(), model.getAllImports(), getFetcher(), getClassLoader()));
setResultValue(IComponentIdentifier.RESULTCID, getComponentIdentifier());
  for(int i=0; i<upes.length; i++)
    addDefaultResult(upes[i].getName(), SJavaParser.getParsedValue(upes[i], model.getAllImports(), getFetcher(), getClassLoader()));
    done.add(upes[i].getName());
    addDefaultResult(res[i].getName(), 
      SJavaParser.getParsedValue(res[i].getDefaultValue(), model.getAllImports(), getFetcher(), getClassLoader()));
origin: net.sourceforge.jadex/jadex-kernel-base

assert !getComponentAdapter().isExternalThread();
for(int i=0; i<ms.length; i++)
  ms[i]    = new RequiredServiceInfo(getServicePrefix()+ms[i].getName(), ms[i].getType().getType(getClassLoader()), ms[i].isMultiple(), 
    ms[i].getMultiplexType()==null? null: ms[i].getMultiplexType().getType(getClassLoader()), ms[i].getDefaultBinding(), ms[i].getNFRProperties());
  sermap.put(ms[i].getName(), ms[i]);
    RequiredServiceInfo rsi = (RequiredServiceInfo)sermap.get(getServicePrefix()+cs[i].getName());
    RequiredServiceInfo newrsi = new RequiredServiceInfo(rsi.getName(), rsi.getType().getType(getClassLoader()), rsi.isMultiple(), 
      ms[i].getMultiplexType()==null? null: ms[i].getMultiplexType().getType(getClassLoader()), new RequiredServiceBinding(cs[i].getDefaultBinding()), ms[i].getNFRProperties());
    sermap.put(rsi.getName(), newrsi);
RequiredServiceBinding[]    bindings    = getBindings();
if(bindings!=null)
    RequiredServiceInfo newrsi = new RequiredServiceInfo(rsi.getName(), rsi.getType().getType(getClassLoader()), rsi.isMultiple(), 
      rsi.getMultiplexType()==null? null: rsi.getMultiplexType().getType(getClassLoader()), new RequiredServiceBinding(bindings[i]), ms[i].getNFRProperties());
    sermap.put(rsi.getName(), newrsi);
getServiceContainer().addRequiredServiceInfos(rservices);
for(RequiredServiceInfo rsi: rservices)
    INFMixedPropertyProvider nfpp = getServiceContainer().getRequiredServicePropertyProvider(null); // null for unbound
      Class<?> clazz = nfprop.getClazz().getType(getClassLoader());
      INFProperty<?, ?> nfp = AbstractNFProperty.createProperty(clazz, getInternalAccess(), null, nfprop.getMethodInfo());
      if(mi==null)
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Create a result listener which is executed as an component step.
 *  @param The original listener to be called.
 *  @return The listener.
 */
public <T> IIntermediateResultListener<T> createResultListener(IIntermediateResultListener<T> listener)
{
  return new IntermediateComponentResultListener<T>(listener, getComponentAdapter());
}
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Get the number of components to start.
 *  @return The number.
 */
public int getNumber(ComponentInstanceInfo component, IModelInfo model)
{
  assert !getComponentAdapter().isExternalThread();
  
  Object ret = component.getNumber()!=null? SJavaParser.evaluateExpression(component.getNumber(), model.getAllImports(), getFetcher(), getClassLoader()): null;
  return ret instanceof Integer? ((Integer)ret).intValue(): 1;
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

assert !getComponentAdapter().isExternalThread();
  for(int i=0; i<ps.length; i++)
    Object key = ps[i].getName()!=null? ps[i].getName(): ps[i].getType().getType(getClassLoader());
    if(sermap.put(key, ps[i])!=null)
      throw new RuntimeException("Services with same type must have different name.");  // Is catched and set to ret below
    for(int i=0; i<cs.length; i++)
      Object key = cs[i].getName()!=null? cs[i].getName(): cs[i].getType().getType(getClassLoader());
      ProvidedServiceInfo psi = (ProvidedServiceInfo)sermap.get(key);
      ProvidedServiceInfo newpsi= new ProvidedServiceInfo(psi.getName(), psi.getType().getType(getClassLoader()), 
        new ProvidedServiceImplementation(cs[i].getImplementation()), psi.getPublish());
      sermap.put(key, newpsi);
  initProvidedServices(0, services, model).addResultListener(createResultListener(new DelegationResultListener<Void>(ret)
origin: net.sourceforge.jadex/jadex-kernel-base

assert !getComponentAdapter().isExternalThread();
  int num = getNumber(components[i], model);
  IResultListener<IComponentIdentifier> crl = new CollectionResultListener<IComponentIdentifier>(num, false, 
    createResultListener(new ExceptionDelegationResultListener<Collection<IComponentIdentifier>, Void>(fut)
      cms.createComponent(getName(components[i], model, j+1), type.getName(),
        new CreationInfo(components[i].getConfiguration(), getArguments(components[i], model), getComponentAdapter().getComponentIdentifier(),
        suspend, master, daemon, autoshutdown, monitoring, synchronous, model.getAllImports(), bindings, null), null).addResultListener(crl);
origin: net.sourceforge.jadex/jadex-kernel-base

assert !getComponentAdapter().isExternalThread();
IFuture<IClockService> fut = SServiceProvider.getService(getServiceContainer(), IClockService.class, RequiredServiceInfo.SCOPE_PLATFORM);
fut.addResultListener(createResultListener(new ExceptionDelegationResultListener<IClockService, Void>(ret)
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Terminate all extensions.
 */
public IFuture<Void> terminateExtensions()
{
  // Hack!!! When init fails , terminateExtensions() can not be called on component thread
  // as component already terminated.
  assert !getComponentAdapter().isExternalThread() || IComponentDescription.STATE_TERMINATED.equals(getComponentDescription().getState());
  
  Future<Void> ret = new Future<Void>();
  IExtensionInstance[] exts = getExtensions();
  CounterResultListener<Void> lis = new CounterResultListener<Void>(exts.length, false, new DelegationResultListener<Void>(ret));
  for(int i=0; i<exts.length; i++)
  {
    exts[i].terminate().addResultListener(lis);
  }
  return ret;
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

assert !getComponentAdapter().isExternalThread();
  initArguments(model, config, arguments).addResultListener(
    createResultListener(new DelegationResultListener<Void>(fut)
  fut.addResultListener(createResultListener(new DelegationResultListener<Void>(iret)
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Start the services.
 */
public IFuture startServiceContainer()
{
  assert !getComponentAdapter().isExternalThread();
  
  return getServiceContainer().start();
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

startEndSteps().addResultListener(createResultListener(new DelegationResultListener<Void>(ret)
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Init the extensions.
 */
public IFuture<Void> initExtensions(IModelInfo model, String config)
{
  assert !getComponentAdapter().isExternalThread();
  
  final Future<Void> ret = new Future<Void>();
  
  if(config!=null)
  {
    ConfigurationInfo conf = model.getConfiguration(config);
    final IExtensionInfo[] exts = conf.getExtensions();
    if(exts.length>0)
    {
      initExtension(exts, 0).addResultListener(new DelegationResultListener<Void>(ret));
    }
    else
    {
      ret.setResult(null);
    }
  }
  else
  {
    ret.setResult(null);
  }
  
  return ret;
}
 
origin: net.sourceforge.jadex/jadex-kernel-bdi

/**
 *  Start the services.
 */
public IFuture startServiceContainer()
{
  // Overriden to do nothing when this is called for a capability.
  // Hack!!! Container started, but capability services added later.
  return initcapa==model.getHandle() ? super.startServiceContainer() : IFuture.DONE;
}
jadex.kernelbaseStatelessAbstractInterpreter

Javadoc

Base class for all kinds of interpreters. Implements the IComponentInstance interface and is responsible for realizing the outer structure of active components.

Most used methods

  • getComponentAdapter
    Get the component adapter.
  • initProvidedServices
    Init the services.
  • startEndSteps
    Start the end steps of the component. Called as part of cleanup behavior.
  • startServiceContainer
    Start the services.
  • addArgument
    Add a value for an argument (if not already present). Called once for each argument during init.
  • addDefaultResult
    Add a default value for a result (if not already present). Called once for each result during init.
  • addExtension
    Add an extension instance.
  • addNFProperty
  • addProperty
    Add a property value.
  • addService
    Add a service to the component.
  • convertRawService
    Convert to raw service.
  • createChild
    Create a subcomponent.
  • convertRawService,
  • createChild,
  • createComponent,
  • createResultListener,
  • createServiceImplementation,
  • getArguments,
  • getBindings,
  • getChildren,
  • getClassLoader,
  • getComponentDescription

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • startActivity (Activity)
  • getSharedPreferences (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Path (java.nio.file)
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now