Codota Logo
AbstractInterpreter
Code IndexAdd Codota to your IDE (free)

How to use
AbstractInterpreter
in
jadex.kernelbase

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: net.sourceforge.jadex/jadex-kernel-micro

/**
 *  Create the service container.
 *  @return The service conainer.
 */
public IServiceContainer createMyServiceContainer(Map args)
{
  IServiceContainer ret = microagent.createServiceContainer(args);
  if(ret==null)
    ret = super.createServiceContainer();
  return ret;
}
 
origin: net.sourceforge.jadex/jadex-kernel-micro

/**
 *  Add component fetcher to service init.
 */
protected IFuture<Void> initService(ProvidedServiceInfo info,
  IModelInfo model, IResultCommand<Object, Class<?>> componentfetcher)
{
  return super.initService(info, model, componentfetcher!=null ? componentfetcher : getComponentFetcher());
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Can be called concurrently (also during executeAction()).
 * 
 *  Get the external access for this component.
 *  The specific external access interface is kernel specific
 *  and has to be casted to its corresponding incarnation.
 *  @param listener    External access is delivered via result listener.
 */
public IExternalAccess getExternalAccess()
{
  if(access==null)
  {
    synchronized(this)
    {
      if(access==null)
      {
        access    = createExternalAccess();
      }
    }
  }
  
  return access;
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Check if threa is allowed. 
 *  
 *  There is the problem that a component is already terminated and calls come back later.
 *  In that case we allow the listeners to be called on the wrong thread.
 */
public void checkAllowedThread()
{
  assert !getComponentAdapter().isExternalThread() || IComponentDescription.STATE_TERMINATED.equals(getComponentDescription().getState());
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Create the service container.
 *  @return The service conainer.
 */
public IServiceContainer createServiceContainer()
{
  assert container==null;
  return new ComponentServiceContainer(adapter, getComponentAdapter().getDescription().getType(), getInternalAccess(), isRealtime());
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

final SubscriptionIntermediateFuture<IMonitoringEvent> ret = (SubscriptionIntermediateFuture<IMonitoringEvent>)SFuture.getNoTimeoutFuture(SubscriptionIntermediateFuture.class, getInternalAccess());
MonitoringEvent    subscribed    = new MonitoringEvent(getComponentIdentifier(), getComponentDescription().getCreationTime(), 
  IMonitoringEvent.TYPE_SUBSCRIPTION_START, System.currentTimeMillis(), PublishEventLevel.COARSE);
boolean	post = false;
addSubscription(ret, filter, emitlevel);
  List<IMonitoringEvent> evs = getCurrentStateEvents();
  if(evs!=null && evs.size()>0)
origin: net.sourceforge.jadex/jadex-kernel-component

/**
 *  Overridden to abort remaining steps on cleanup.
 */
public IFuture<Void> terminateServiceContainer()
{
  final Future<Void>	ret	= new Future<Void>();
  super.terminateServiceContainer()
    .addResultListener(new DelegationResultListener<Void>(ret)
  {
    public void customResultAvailable(Void result)
    {
      nosteps    = true;
      ComponentTerminatedException ex = new ComponentTerminatedException(getComponentAdapter().getComponentIdentifier());
      while(steps!=null && !steps.isEmpty())
      {
        Object[] step = (Object[])steps.remove(0);
        Future<Void> future = (Future<Void>)step[1];
        future.setException(ex);
      }
      ret.setResult(null);
    }
  });
  
  return ret;
}
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Add a property value.
 *  @param name The name.
 *  @param val The value.
 */
public void addProperty(String name, Object val)
{
  assert !getComponentAdapter().isExternalThread();
  
  if(properties==null)
    properties = new HashMap<String, Object>();
  properties.put(name, val);
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

  /**
   *  Get the monitoring event emit level.
   */
  public PublishEventLevel getPublishEmitLevelMonitoring()
  {
    return getComponentDescription().getMonitoring()!=null? getComponentDescription().getMonitoring(): PublishEventLevel.OFF;
//        return emitlevelmon;
  }
 
origin: net.sourceforge.jadex/jadex-kernel-micro

/**
 *  Get the value fetcher.
 */
public IValueFetcher getFetcher()
{
  assert !getComponentAdapter().isExternalThread();
  
  if(fetcher==null)
  {
    SimpleValueFetcher fetcher = new SimpleValueFetcher(super.getFetcher());
    if(microagent instanceof IPojoMicroAgent)
    {
      fetcher.setValue("$pojoagent", ((IPojoMicroAgent)microagent).getPojoAgent());
    }
    this.fetcher = fetcher;
  }
  return fetcher;
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Get a space of the application.
 *  @param name    The name of the space.
 *  @return    The space.
 */
public IExtensionInstance[] getExtensions()
{
  // 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());
  
  return extensions==null? new IExtensionInstance[0]: 
    (IExtensionInstance[])extensions.values().toArray(new IExtensionInstance[extensions.size()]);
}
 
origin: net.sourceforge.jadex/jadex-kernel-micro

/**
 *  Called from cleanupComponent.
 */
public IFuture<Void> terminateServiceContainer()
{
  final Future<Void> ret = new Future<Void>();
  IResultListener<Void>    reslis    = new IResultListener<Void>()
  {
    public void resultAvailable(Void result)
    {
      nosteps = true;
      exitState();
      ret.setResult(result);
    }
    public void exceptionOccurred(final Exception exception)
    {
      nosteps = true;
      exitState();
      ret.setException(exception);
    }
  };
  // If platform, do not schedule listener on component as execution service already terminated after terminate service container.  
  if(getComponentIdentifier().getParent()!=null)
    reslis    = createResultListener(reslis);
  super.terminateServiceContainer().addResultListener(reslis);
  return ret;
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Get a space of the application.
 *  @param name    The name of the space.
 *  @return    The space.
 */
public IExtensionInstance getExtension(final String name)
{
  assert !getComponentAdapter().isExternalThread();
  
  return extensions==null? null: (IExtensionInstance)extensions.get(name);
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

  /**
   *  Create a new context.
   */
  public AbstractInterpreter(final IComponentDescription desc, final IModelInfo model, final String config, 
    final IComponentAdapterFactory factory, final IExternalAccess parent, 
    final RequiredServiceBinding[] bindings, boolean copy, boolean realtime,
    IIntermediateResultListener<Tuple2<String, Object>> resultlistener, final Future<Void> inited)
  {
    this.config = config!=null? config: model.getConfigurationNames().length>0? 
      model.getConfigurationNames()[0]: null;
    this.model = model;
    this.parent = parent;
    this.bindings = bindings;
    this.copy = copy;
    this.realtime = realtime;
    this.emitlevelsub = PublishEventLevel.OFF;
//        this.emitlevelmon = desc.getMonitoring();
    this.resultlistener = resultlistener;
    if(factory != null)
      this.adapter = factory.createComponentAdapter(desc, model, this, parent);
    this.container = createServiceContainer();
//        this.arguments = arguments!=null? new HashMap(arguments): null; // clone arguments
    
//        System.out.println("hhh: "+desc.getName()+" "+desc.getCause());
  }
   
origin: net.sourceforge.jadex/jadex-kernel-bpmn

ret    = super.initService(info, model, componentfetcher);
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Add an extension.
 *  @param name    The argument name.
 *  @param value    The extension.
 */
public void	addExtension(String name, IExtensionInstance value)
{
  assert !getComponentAdapter().isExternalThread();
  
  if(extensions==null)
  {
    extensions = new HashMap<String, IExtensionInstance>();
  }
  extensions.put(name, value);
}
 
origin: net.sourceforge.jadex/jadex-kernel-base

  /**
   *  Add a default value for a result (if not already present).
   *  Called once for each result during init.
   *  @param name    The result name.
   *  @param value    The result value.
   */
  public void	addDefaultResult(String name, Object value)
  {
    assert !getComponentAdapter().isExternalThread();
    
//        System.out.println("add def res: "+name+" "+value);
    
    if(results==null)
    {
      results    = new HashMap<String, Object>();
    }
    results.put(name, value);
  }
   
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Get the value fetcher.
 */
public IValueFetcher getFetcher()
{
  assert !getComponentAdapter().isExternalThread();
  
  if(fetcher==null)
  {
    fetcher = new InterpreterFetcher(this);
  }
  return fetcher;
}
origin: net.sourceforge.jadex/jadex-kernel-base

/**
 *  Set a result value.
 *  @param name The result name.
 *  @param value The result value.
 */
public void setResultValue(String name, Object value)
{
  assert !getComponentAdapter().isExternalThread();
  
  // todo: store results only within listener?!
  if(results==null)
    results    = new HashMap<String, Object>();
  results.put(name, value);
  
  if(resultlistener!=null)
  {
    resultlistener.intermediateResultAvailable(new Tuple2<String, Object>(name, value));
  }
}
 
jadex.kernelbaseAbstractInterpreter

Javadoc

The abstract interpreter add state to the stateless interpreter and implements several abstract methods.

Most used methods

  • createServiceContainer
    Create the service container.
  • initService
  • terminateServiceContainer
  • addSubscription
    Add a new subscription.
  • createExternalAccess
    Create the external access instance.
  • getComponentAdapter
    Get the component adapter.
  • getComponentDescription
  • getComponentIdentifier
  • getCurrentStateEvents
  • getFetcher
    Get the value fetcher.
  • getInternalAccess
  • getPublishEmitLevelMonitoring
    Get the monitoring event emit level.
  • getInternalAccess,
  • getPublishEmitLevelMonitoring,
  • getPublishEmitLevelSubscriptions,
  • initComponents,
  • isRealtime,
  • publishLocalEvent,
  • removeSubscription,
  • startBehavior

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • Menu (java.awt)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now