cca-spec-babel  0.8.6-unstable(developer)
Public Member Functions
gov.cca.AbstractFramework Interface Reference

This is an interface presented by a CCA-compliant framework to access its application framing capabilities. More...

List of all members.

Public Member Functions

TypeMap createTypeMap () throws CCAException
 Create an empty TypeMap.
Services getServices (in string selfInstanceName, in string selfClassName, in TypeMap selfProperties) throws CCAException
 Retrieve a Services handle to the underlying framework.
void releaseServices (in Services services) throws CCAException
 Inform framework that the Services handle is no longer needed by the caller and that the reference to its component image is to be deleted from the context of the underlying framework.
void shutdownFramework () throws CCAException
 Tell the framework it is no longer needed and to clean up after itself.
AbstractFramework createEmptyFramework () throws CCAException
 Creates a new framework instance based on the same underlying framework implementation.

Detailed Description

This is an interface presented by a CCA-compliant framework to access its application framing capabilities.

Most of the manipulation of the underlying framework is expected to be be done with the gov.cca.BuilderService Port. This class exists as a sort of bootstrap to get a Services object necessary to retrieve Port's, including BuilderService, from the underlying framework. How the interface and the underlying framework is created is entirely unspecified and is up to the devices of the programmer and the framework provider.

Example

Here it is assumed that an instance of AbstractFramework is created in the main() from some hypothetical implementation. The idea is to allow a complete swap of framework choice by changing out the specified implementation class of a framework.

  // java
  main() {
    cca.reference.Framework fwkimpl = new cca.reference.Framework();
    // change fwkimpl above to use different cca implementations when
    // AbstractFramework becomes part of the standard.
    gov.cca.AbstractFramework fwk = (gov.cca.AbstractFramework)fwkimpl;
    gov.cca.Services svc = 
	   fwk.getServices("instance0","AppDriver",null);
    // From here on, access all services, components, etc
    // through svc.
    ...
    // when done
    fwk.releaseServices(svc);
    fwk.shutdownFramework();
  }

  // c++
  int functionName() {
    ::gov::sandia::ccafe::Framework fwkimpl;
    ::gov::cca::AbstractFrameworkPtr fwk;

    fwk = fwkimpl.getStandardFramework();
    ::gov::cca::Services_Interface * svc = 0;
    svc = fwk->getServices("instance0","AppDriver",0);
    // From here on, access all services, components, etc
    // through svc.
    ...
    // when done
    fwk->releaseServices(svc);
    svc = 0;
    fwk->shutdownFramework();

    // at scope exit, all memory is automatically cleaned up.
  }
  


Member Function Documentation

Creates a new framework instance based on the same underlying framework implementation.

This does not copy the existing framework, nor are any of the user-instantiated components in the original framework available in the newly created AbstractFramework.

Exceptions:
CCAExceptionwhen one of the following conditions occur:

(1)the AbstractFramework previously had shutdownFramework() called on it, or (2)the underlying framework implementation does not permit creation of another instance.

Create an empty TypeMap.

Presumably this would be used in an ensuing call to getServices(). The "normal" method of creating typemaps is found in the Services interface. It is duplicated here to break the "chicken and egg" problem.

Services gov.cca.AbstractFramework.getServices ( in string  selfInstanceName,
in string  selfClassName,
in TypeMap  selfProperties 
) throws CCAException

Retrieve a Services handle to the underlying framework.

This interface effectively causes the calling program to appear as the image of a component inside the framework. This method may be called any number of times with different arguments, creating a new component image each time. The only proper method to destroy a Services obtained from this interface is to pass it to releaseServices.

Parameters:
selfInstanceNamethe Component instance name, as it will appear in the framework.
selfClassNamethe Component type of the calling program, as it will appear in the framework.
selfProperties(which can be null) the properties of the component image to appear.
Exceptions:
CCAExceptionin the event that selfInstanceName is already in use by another component.
Returns:
A Services object that pertains to the image of the this component. This is identical to the object passed into Component.setServices() when a component is created.

Inform framework that the Services handle is no longer needed by the caller and that the reference to its component image is to be deleted from the context of the underlying framework.

This invalidates any ComponentID's or ConnectionID's associated with the given Services' component image.

Parameters:
servicesThe result of getServices earlier obtained.
Exceptions:
CCAExceptionif the Services handle has already been released or is otherwise rendered invalid or was not obtained from getServices().

Tell the framework it is no longer needed and to clean up after itself.

Exceptions:
CCAExceptionif the framework has already been shutdown.

The documentation for this interface was generated from the following file: