All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bridge.IExternalAccess Maven / Gradle / Ivy

Go to download

Jadex bridge is a base package for kernels and platforms, i.e., it is used by both and provides commonly used interfaces and classes for active components and their management.

There is a newer version: 4.0.267
Show newest version
package jadex.bridge;

import jadex.bridge.component.IExternalArgumentsResultsFeature;
import jadex.bridge.component.IExternalExecutionFeature;
import jadex.bridge.component.IExternalMonitoringComponentFeature;
import jadex.bridge.component.IExternalNFPropertyComponentFeature;
import jadex.bridge.component.IExternalSubcomponentsFeature;
import jadex.bridge.modelinfo.IModelInfo;
import jadex.bridge.service.annotation.Reference;
import jadex.bridge.service.annotation.Service;
import jadex.bridge.service.annotation.Tag;
import jadex.bridge.service.annotation.Tags;
import jadex.bridge.service.component.IExternalProvidedServicesFeature;
import jadex.bridge.service.component.IExternalRequiredServicesFeature;
import jadex.commons.future.IFuture;

/**
 *  The interface for accessing components from the outside.
 *  
 *  Methods may be called from any thread, but the result listener will not be scheduled back to the calling thread!
 */
@Reference
@Service
//@Tags(value="$component.getId().getRoot().equals($component.getId())? \"PLATFORM\": null")
@Tags(@Tag(include="$component.getId().getRoot().equals($component.getId())", value=IExternalAccess.PLATFORM_INTERNAL))
public interface IExternalAccess extends IExternalExecutionFeature, IExternalArgumentsResultsFeature, 
	IExternalProvidedServicesFeature, IExternalRequiredServicesFeature, IExternalSubcomponentsFeature, 
	IExternalMonitoringComponentFeature, IExternalNFPropertyComponentFeature //extends INFPropertyProvider//extends IRemotable
{
	public static final String PLATFORM = "platform";
	public static final String PLATFORM_INTERNAL = "\"platform\"";
	
	//-------- cache --------
	
	/**
	 *  Get the model of the component.
	 *  @return	The model.
	 */
	public IFuture getModelAsync();
	
	/**
	 *  Get the id of the component.
	 *  @return	The component id.
	 */
	public IComponentIdentifier getId();
	
	/**
	 *  Get a feature of the component.
	 *  @param feature	The type of the feature.
	 *  @return The feature instance.
	 */
	public  T getExternalFeature(Class type);
	
//	/**
//	 *  Test if current thread is an external thread.
//	 *  @return True if the current thread is not the component thread.
//	 */
//	public boolean isExternalThread();
	
	
//	/**
//	 *  Get the component description.
//	 *  @return	The component description.
//	 */
//	// Todo: hack??? should be internal to CMS!?
//	public IFuture getDescription();
//	
//	/**
//	 *  Get the component description.
//	 *  @return	The component description.
//	 */
//	// Todo: hack??? should be internal to CMS!?
//	public IFuture getDescription(IComponentIdentifier cid);
	
//	/**
//	 *  Schedule a step of the component.
//	 *  May safely be called from external threads.
//	 *  @param step	Code to be executed as a step of the component.
//	 *  @return The result of the step.
//	 */
//	public  IFuture scheduleStep(IComponentStep step);
//	
//	/**
//	 *  Schedule a step of the component.
//	 *  May safely be called from external threads.
//	 *  @param step	Code to be executed as a step of the component.
//	 *  @return The result of the step.
//	 */
//	public  IFuture scheduleStep(int priority, IComponentStep step);
	
//	/**
//	 *  Execute some code on the component's thread.
//	 *  Unlike scheduleStep(), the action will also be executed
//	 *  while the component is suspended.
//	 *  @param action	Code to be executed on the component's thread.
//	 *  @return The result of the step.
//	 */
//	public 	IFuture scheduleImmediate(IComponentStep step);
	
//	/**
//	 *  Wait for some time and execute a component step afterwards.
//	 */
//	public  IFuture waitForDelay(long delay, IComponentStep step, boolean realtime);
//
//	/**
//	 *  Wait for some time and execute a component step afterwards.
//	 */
//	public  IFuture waitForDelay(long delay, IComponentStep step);

	//-------- normal --------
		
//	/**
//	 *  Create a subcomponent.
//	 *  @param component The instance info.
//	 */
//	public IFuture createChild(final ComponentInstanceInfo component);
	
//	/**
//	 *  Kill the component.
//	 */
//	public IFuture> killComponent();
//	
//	/**
//	 *  Kill the component.
//	 *  @param e The failure reason, if any.
//	 */
//	public IFuture> killComponent(Exception e);
//	
//	/**
//	 *  Kill the component.
//	 *  @param e The failure reason, if any.
//	 */
//	public IFuture> killComponent(IComponentIdentifier cid);
	
//	/**
//	 *  Suspend the execution of an component.
//	 *  @param componentid The component identifier.
//	 */
//	public IFuture suspendComponent(IComponentIdentifier componentid);
//	
//	/**
//	 *  Resume the execution of an component.
//	 *  @param componentid The component identifier.
//	 */
//	public IFuture resumeComponent(IComponentIdentifier componentid);
	
//	/**
//	 *  Get the children (if any) component identifiers.
//	 *  @param type The local child type.
//	 *  @param parent The parent (null for this).
//	 *  @return The children component identifiers.
//	 */
//	public IFuture getChildren(String type, IComponentIdentifier parent);
	
//	/**
//	 *  Get the model name of a component type.
//	 *  @param ctype The component type.
//	 *  @return The model name of this component type.
//	 */
//	public IFuture getFileName(String ctype);
//	
//	/**
//	 *  Get the local type name of this component as defined in the parent.
//	 *  @return The type of this component type.
//	 */
//	public String getLocalType();

//	/**
//	 *  Subscribe to component events.
//	 *  @param filter An optional filter.
//	 *  @param initial True, for receiving the current state.
//	 */
////	@Timeout(Timeout.NONE)
//	public ISubscriptionIntermediateFuture subscribeToEvents(IFilter filter, boolean initial, PublishEventLevel elm);
	
//	/**
//	 *  Subscribe to receive results.
//	 */
//	public ISubscriptionIntermediateFuture> subscribeToResults();
	
//	/**
//	 *  Get the component results.
//	 *  @return The results.
//	 */
//	public IFuture> getResults();
//	
//	/**
//	 *  Get the arguments.
//	 *  @return The arguments.
//	 */
//	public IFuture> getArguments();
	
	//-------- exclude --------
	
//	/**
//	 *  Get a space of the application.
//	 *  @param name	The name of the space.
//	 *  @return	The space.
//	 */
//	public IFuture getExtension(final String name);
	
	// todo: do we want this? should getArg() deliver only args supplied from
	// outside or also values that are default/initial values in the model.
	// problem: this would require to store the arguments for the whole lifetime of the component.
	/**
	 *  Get argument value.
	 *  @param name The argument name.
	 *  @return The argument value.
	 * /
	public Object getArgumentValue(String name);*/
	
//	/**
//	 *  Test if current thread is external thread.
//	 *  @return True if the current thread is not the component thread.
//	 */
//	public IFuture isExternalThread();
//	
//	/**
//	 *  Check if the component is directly available.
//	 *  An external access becomes invalid, when a component
//	 *  is persisted or terminated.
//	 */
//	public boolean	isValid();
	
//	/**
//	 *  Get an external interface feature.
//	 *  @param type The interface type of the feature.
//	 *  @return The feature.
//	 */
//	public  T getExternalComponentFeature(Class type);

	//-------- methods for searching --------
//	
//	/**
//	 *  Search for matching services and provide first result.
//	 *  @param query	The search query.
//	 *  @return Future providing the corresponding service or ServiceNotFoundException when not found.
//	 */
//	public  IFuture searchService(ServiceQuery query);
//	
//	/**
//	 *  Search for all matching services.
//	 *  @param query	The search query.
//	 *  @return Future providing the corresponding services or ServiceNotFoundException when not found.
//	 */
//	public   ITerminableIntermediateFuture searchServices(ServiceQuery query);
	
	//-------- query methods --------

//	/**
//	 *  Add a service query.
//	 *  Continuously searches for matching services.
//	 *  @param query	The search query.
//	 *  @return Future providing the corresponding service or ServiceNotFoundException when not found.
//	 */
//	public  ISubscriptionIntermediateFuture addQuery(ServiceQuery query);
	
//	/**
//	 *  Add a new component as subcomponent of this component.
//	 *  @param component The model or pojo of the component.
//	 */
//	public IFuture createComponent(Object component, CreationInfo info, IResultListener>> resultlistener);
//	
//	/**
//	 *  Add a new component as subcomponent of this component.
//	 *  @param component The model or pojo of the component.
//	 */
//	public ISubscriptionIntermediateFuture createComponentWithResults(Object component, CreationInfo info);
//	
//	/**
//	 *  Create a new component on the platform.
//	 *  @param name The component name or null for automatic generation.
//	 *  @param model The model identifier (e.g. file name).
//	 *  @param info Additional start information such as parent component or arguments (optional).
//	 *  @return The id of the component and the results after the component has been killed.
//	 */
//	public ITuple2Future> createComponent(Object component, CreationInfo info);
	
//	/**
//	 *  Get the external access for a component id.
//	 *  @param cid The component id.
//	 *  @return The external access.
//	 */
//	public IFuture getExternalAccess(IComponentIdentifier cid);
	
//	/**
//	 *  Execute a step of a suspended component.
//	 *  @param componentid The component identifier.
//	 *  @param listener Called when the step is finished (result will be the component description).
//	 */
//	public IFuture stepComponent(IComponentIdentifier componentid, String stepinfo);
//	
//	/**
//	 *  Set breakpoints for a component.
//	 *  Replaces existing breakpoints.
//	 *  To add/remove breakpoints, use current breakpoints from component description as a base.
//	 *  @param componentid The component identifier.
//	 *  @param breakpoints The new breakpoints (if any).
//	 */
//	public IFuture setComponentBreakpoints(IComponentIdentifier componentid, String[] breakpoints);
	
//	/**
//	 *  Add a component listener for a specific component.
//	 *  The listener is registered for component changes.
//	 *  @param cid	The component to be listened.
//	 */
//	public ISubscriptionIntermediateFuture listenToComponent(IComponentIdentifier cid);
//	
//	/**
//	 * Search for components matching the given description.
//	 * @return An array of matching component descriptions.
//	 */
//	public IFuture searchComponents(IComponentDescription adesc, ISearchConstraints con);

//	/**
//	 *  Search for components matching the given description.
//	 *  @return An array of matching component descriptions.
//	 */
//	public IFuture searchComponents(IComponentDescription adesc, ISearchConstraints con, boolean remote);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy