jadex.application
Class ApplicationComponentFactory

java.lang.Object
  extended by jadex.bridge.service.BasicService
      extended by jadex.application.ApplicationComponentFactory
All Implemented Interfaces:
IComponentFactory, IInternalService, IService

public class ApplicationComponentFactory
extends BasicService
implements IComponentFactory

Factory for default contexts. No special properties supported, yet.


Field Summary
static String FILETYPE_APPLICATION
          The application component file type.
protected static UIDefaults icons
          The image icons.
protected  ILibraryServiceListener libservicelistener
          The library service listener
protected  ApplicationModelLoader loader
          The application model loader.
protected  IServiceProvider provider
          The provider.
 
Fields inherited from class jadex.bridge.service.BasicService
idcnt, properties, providerid, shutdowned, sid, started, type
 
Fields inherited from interface jadex.bridge.service.IService
EMPTY_SERVICES
 
Constructor Summary
ApplicationComponentFactory(IServiceProvider provider)
          Create a new application factory.
ApplicationComponentFactory(String providerid)
          Create a new application factory for startup.
 
Method Summary
 IFuture<Tuple2<IComponentInstance,IComponentAdapter>> createComponentInstance(IComponentDescription desc, IComponentAdapterFactory factory, IModelInfo modelinfo, String config, Map arguments, IExternalAccess parent, RequiredServiceBinding[] bindings, boolean copy, Future<Tuple2<IComponentInstance,IComponentAdapter>> ret)
          Create a component instance.
 IFuture<String> getComponentType(String model, String[] imports, ClassLoader classloader)
          Get the component type of a model.
 IFuture<Icon> getComponentTypeIcon(String type)
          Get a default icon for a file type.
 String[] getComponentTypes()
          Get the names of ADF file types supported by this factory.
 Map getProperties(String type)
          Get the properties.
 IFuture<Boolean> isLoadable(String model, String[] imports, ClassLoader classloader)
          Test if a model can be loaded by the factory.
 IFuture<Boolean> isStartable(String model, String[] imports, ClassLoader classloader)
          Test if a model is startable (e.g. an component).
 IFuture<IModelInfo> loadModel(String model, String[] imports, ClassLoader classloader)
          Load a model.
 IFuture<Void> shutdownService()
          Shutdown the service.
 IFuture<Void> startService()
          Start the service.
 
Methods inherited from class jadex.bridge.service.BasicService
createServiceIdentifier, createServiceIdentifier, equals, generateServiceName, getPropertyMap, getServiceIdentifier, isValid, setPropertyMap
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILETYPE_APPLICATION

public static final String FILETYPE_APPLICATION
The application component file type.

See Also:
Constant Field Values

icons

protected static final UIDefaults icons
The image icons.


loader

protected ApplicationModelLoader loader
The application model loader.


provider

protected IServiceProvider provider
The provider.


libservicelistener

protected ILibraryServiceListener libservicelistener
The library service listener

Constructor Detail

ApplicationComponentFactory

public ApplicationComponentFactory(String providerid)
Create a new application factory for startup.

Parameters:
platform - The platform.
mappings - The XML reader mappings of supported spaces (if any).

ApplicationComponentFactory

public ApplicationComponentFactory(IServiceProvider provider)
Create a new application factory.

Parameters:
platform - The platform.
mappings - The XML reader mappings of supported spaces (if any).
Method Detail

startService

public IFuture<Void> startService()
Start the service.

Specified by:
startService in interface IInternalService
Overrides:
startService in class BasicService

shutdownService

public IFuture<Void> shutdownService()
Shutdown the service.

Specified by:
shutdownService in interface IInternalService
Overrides:
shutdownService in class BasicService
Parameters:
listener - The listener.

loadModel

public IFuture<IModelInfo> loadModel(String model,
                                     String[] imports,
                                     ClassLoader classloader)
Load a model.

Specified by:
loadModel in interface IComponentFactory
Parameters:
model - The model (e.g. file name).
The - imports (if any).
Returns:
The loaded model.

createComponentInstance

public IFuture<Tuple2<IComponentInstance,IComponentAdapter>> createComponentInstance(IComponentDescription desc,
                                                                                     IComponentAdapterFactory factory,
                                                                                     IModelInfo modelinfo,
                                                                                     String config,
                                                                                     Map arguments,
                                                                                     IExternalAccess parent,
                                                                                     RequiredServiceBinding[] bindings,
                                                                                     boolean copy,
                                                                                     Future<Tuple2<IComponentInstance,IComponentAdapter>> ret)
Create a component instance.

Specified by:
createComponentInstance in interface IComponentFactory
Parameters:
adapter - The component adapter.
model - The component model.
config - The name of the configuration (or null for default configuration)
arguments - The arguments for the component as name/value pairs.
parent - The parent component (if any).
Returns:
An instance of a component.

isLoadable

public IFuture<Boolean> isLoadable(String model,
                                   String[] imports,
                                   ClassLoader classloader)
Test if a model can be loaded by the factory.

Specified by:
isLoadable in interface IComponentFactory
Parameters:
model - The model (e.g. file name).
The - imports (if any).
Returns:
True, if model can be loaded.

isStartable

public IFuture<Boolean> isStartable(String model,
                                    String[] imports,
                                    ClassLoader classloader)
Test if a model is startable (e.g. an component).

Specified by:
isStartable in interface IComponentFactory
Parameters:
model - The model (e.g. file name).
The - imports (if any).
Returns:
True, if startable (and loadable).

getComponentTypes

public String[] getComponentTypes()
Get the names of ADF file types supported by this factory.

Specified by:
getComponentTypes in interface IComponentFactory

getComponentTypeIcon

public IFuture<Icon> getComponentTypeIcon(String type)
Get a default icon for a file type.

Specified by:
getComponentTypeIcon in interface IComponentFactory

getComponentType

public IFuture<String> getComponentType(String model,
                                        String[] imports,
                                        ClassLoader classloader)
Get the component type of a model.

Specified by:
getComponentType in interface IComponentFactory
Parameters:
model - The model (e.g. file name).
The - imports (if any).

getProperties

public Map getProperties(String type)
Get the properties. Arbitrary properties that can e.g. be used to define kernel-specific settings to configure tools.

Specified by:
getProperties in interface IComponentFactory
Parameters:
type - The component type.
Returns:
The properties or null, if the component type is not supported by this factory.


Copyright © 2011. All Rights Reserved.