Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
The Common Component Architecture consists of three types of entities: Ports, Components, and Frameworks. This architecture, as with any other architecture, is a model of a socio-technical system. Technically, components are the basic units of software that are composed together to form applications. Instances of Components are created and managed within a Framework which also provides the basic services that components use to operate and communicate with other components. Ports are the fully abstract interfaces on components which are managed by the framework in the composition process.
Socially, a component is a piece of code owned by a small, tightly-knit group of authors. A port is an agreement among several such author groups. What is left, standard-compliant frameworks, are the unglamorous roads paid for by everyone to enable component exchange and reuse. By adopting CCA standards for ports, components and frameworks, the many isolated, self-contained coding projects in the parallel computing world can more easily integrate their software products and increase the ratio of productive scientific coding effort to infrastructure coding effort.
The philosophy of the CCA working group is to precisely define:
The goal is to provide a standard way that a component can be built so that it may be reused in any number of CCA compliant frameworks. What makes a framework CCA compliant is that it implements the framework interfaces described below.
A CCA component is an entity that is defined by two types of public surface features: "provides" ports and "uses" ports.
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
"Provides" Ports are the set of public interfaces that the
component implements which can be referenced and "used" by other components. The name "provides" Port refers to
its function and not its type: a "provides" Port must inherit from
the class "Port". A component may have zero or more "provides"
Ports. A "provides" Port can also be thought of as a "service" that
is "provided" to other components or to the framework. The member
functions of a provides-port may be thought of as "handler"
functions that are executed by the component on behalf of the
component's "users". In some cases, the provided interfaces are
implemented by the component object and, in other cases the provided
interfaces are implemented by another object instantiated by the
component. In the case that a component is providing ports to two
or more other "user" components, there is no prescribed schedule in
which the external invocations are served. It is up to the
component implementation to determine this. Each component should
come with a "data sheet" that defines any special runtime execution
behavior that is required for its correct execution.
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
A "uses" Port can be viewed as a connection point on the surface of the component where the framework can attach (connect) references to "provides" Port's provided by other components or by the containing framework itself. The name "uses" Port again refers to its function and not its type: a "uses" Port must inherit from the class "Port". Viewed from the inside of the component, a "uses" Port is an object that implements the capability the component needs to use. The component makes calls on a "uses" Port reference to "use" the "provided" capabilities. A component may have zero or more "uses" Ports.
Depending on the framework, one or more "provides" Ports may be
connected to a single "Uses" Port and a "provides" Port may be
"provided" to one or more "uses" Ports. In general, if a "uses"
Port has a member function that returns a value, the number of
providers may be restricted to be one.
In frameworks that support "direct connect",
for those connections that are restricted to be one-to-one, the
framework may actually supply the provides port object reference
"directly" as the connected uses port. In these cases there is only
one function call between a user and a provider, affording the least
amount of overhead possible.
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
The ports on a component are each identified with a string name
which is unique among all Uses- and Provides-Ports within that
component instance. Each port implements a specific functional
interface. A standard CCA interface, called PortInfo, describes the
binding between the port's name and its interface type.
The Scientific IDL (SIDL) [B1] is being used to prototype the CCA specification. Corresponding C++ and Java specifications are being simultaneously developed. The SIDL specification of PortInfo is given by:
package gov.cca{
interface PortInfo{
string getType();
string getName();
string getProperty(string name);
};
...
};
PortInfo binds a text string name of a port with the the fully
qualified name of the service interface it implements. Port
interfaces are specified in SIDL and then translated to the target
component implementation language. For example, a port of type
FooInterface from the module gov.doe.llnl.foostuff and
that has a single member function foo that takes an integer and
returns a float might be defined in SIDL as
package gov.doe.llnl.foostuff{
interface FooInterface extends Port{
float foo(in integer x);
};
};
A SIDL compiler will translate this specification into a Java interface, a C++ abstract class or a set of C or FORTRAN77 functions.
An implementation of PortInfo is provided by each CCA compliant
framework via the Services interface examined in the next section.
A Java programmer, wishing to describe a port with name "myFooPort", and type FooInterface would create a PortInfo object by a call of the form:
String[] properties = {"key1", "value1",
"key2", "value2" }
PortInfo p = svc.createPortInfo("myFooPort",
"gov.doe.llnl.foostuff.FooInterface",
properties);
where "svc" is a reference to the framework provided Services
object.
Properties provide information to the framework beyond what
port types will convey.
Since the name space is shared within a particular port type, users
and port implementation authors should be careful to qualify their
properties with appropriate prefixes. For example the CCA working
group reserves the prefix "gov.cca" for all of its properties. For
example, a property fooProperty that orignated with the CCA
working group itself
might look like:
String[] properties = {"gov.cca.fooProperty", "42",
"key2", "value2"
}
After the PortInfo object has been created, it is read only; no properties or attributes may be changed. In languages that do not have garbage collection (e.g. C++), the memory for the PortInfo object belongs to the component that calls createPortInfo() until the PortInfo object is subsequently returned to the framework through an addProvides or registerUses call.
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
When a component is instantiated by the framework, it is provided with
an object that implements the component's primary interface to the
framework.
This is called the "Services" object and it is used by the component
to tell the framework about the ports that it provides and uses. It is
also through ports that the component is allowed access to the
standard services provided by the framework for the component's use.
The SIDL interface to the Services object is given by
package gov.cca {
...
interface Services {
Port getPort(in string name);
PortInfo createPortInfo(in string name, in string type, array<string, 1> properties);
void registerUsesPort(in PortInfo name_and_type);
void unregisterUsesPort(in string name);
void addProvidesPort(in Port providesPort, in PortInfo name);
void removeProvidesPort(in string name);
void releasePort(in string name);
ComponentID getComponentID();
};
};
"Provides" Ports are provided by the component. The component may
implement the "provides" Port itself or it may allocate an object that
implements the provides port. In either case, to tell the framework
that a specific provides port is available, the component must call
addProvidesPort( ) with the reference to the port instance and
a PortInfo describing its type and name and type that is local
only to the current component instance.
Uses-Ports are named and specified by the component, but manufactured or otherwise obtained by the framework. To tell the framework that the component plans to use a port of a particular name and type it calls: registerUsesPort(). The registerUsesPort() method registers a port request with the component's containing framework.
To obtain the actual reference to the 'uses" Port (or its proxy), the component calls getPort() with the port name. If that "uses" Port has not been previously registered with a call to registerUsesPort(), the getPort() call will throw an exception. If the connection has not yet been made, the getPort() operation will suspend until the connection is completed OR it will return with a null reference. A good component programmer will always check the returned value of getPort().
When a uses port has been used by the component, it should call releasePort(). This allows the framework the ability to provide a runtime substitution of one provider for another.
To simplify the design of future service additions, it is necessary
to extract a form of proxy reference to a component that will allow
other components and services know about the port names and types the
component has. The getComponentID() function returns an
object of type:
package gov.cca{
interface ComponentID{
String toString();
};
};
Note that a ComponentID object cannot be used to modify the component or access framework specific implementation details. This object, when serialized, can reside in instance registries and it is the handle that can be used by services that are implemented as CCA components to refer to other components. A component is allowed to access its own ComponentID which it may then pass to services or components that implement services.
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
There are two things that are required for an object to be a CCA component:
package gov.cca{
interface Component {
void setServices(in Services cc);
};
The setServices() function is called by the framework after the
component has been instantiated. During the setServices()
invocation, the component
usually saves the passed reference to the services object as a private
instance variable. Prior to returning from the setServices()
call, the
component must instantiate and add all its initial "provides" Ports
and register all its initial "uses" Ports using this instance
variable. Components may dynamically add new Ports later.
During the first setServices() call, a Component component should NOT attempt to use any of the ports registered via registerUsesPorts() within the setServices() invocation. There is an exception to this rule is for "well-known framework service" Ports, as explained further in the next section. Use of non-framework ports is brittle since it is almost certain that the connections to other components will not have been completed before the component returns from the setServices() method. Depending on the component's containing framework, this behavior may give rise to unexpected NULL returns or unexpected execution flow due to a blocking call to getPort().
The way the framework notifies a component to shut down is to call
the setServices() with a null value for the Services object.
This provides a way for the component to shut down gracefully. When
such an invocation of setServices completes, it is safe for the
framework to delete or garbage collect the component. A component is
not required, or expected, to handle a setServices call
asynchronously. That is, if the
framework is executing some other call on the component it will wait
until the component returns control before it attempts to call
setServices(NULL).
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
Experimental frameworks such as CCAT[3] and CCAFFEINE[4] demonstrate the need to standardize some basic, well-known services that components or component users may routinely provide or need. These various services can be accessed by a component through the basic uses Port mechanisms, but the implementation of these services may require supporting code from the framework implementations. Two such port standards adopted by the forum to date are:
package gov.cca.ports {
interface GoPort extends Port {
int go();
};
interface ConnectionEventService extends Port {
// Subscribe the listener, l, to a type of event.
void addConnectionEventListener(int connectionEventType, ConnectionEventListener l);
};
};
The go() function is called by the framework (at the direction
of a GUI user, the application writer, or another component) to perform
part or all of a
computation. This computation can succeed, fail, or fail in a way that
leaves the component in a permanently wounded state. In the case
of a permanent failure, it is not acceptable that a component
should take upon itself shutting down the application as a whole
with an exit(), stop(), abort(), or uncatchable exception.
In parallel
framework implementations, the go() call is made identically on
each member of the component's parallel cohort. Components can provide
more than one GoPort, so long as each has a unique name.
During the first setServices() call, a Component
may use addConnectionEventListener()
to indicate that it needs to be notified when connections are
being made or broken. Typically, components need this notification
so that they may manage internal resources (especially memory)
associated with connections. The event object delivered to the
listener, l, includes information about the port being affected.
While handling connection events, the component may call any function
on its Services interface or other Ports without restriction. Additional
specification details for the ConnectionEventService and its
associated abstract interfaces are found in the bindings.
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
Below we list the SIDL spec described above and the
equivalent bindings in C++ and Java.
package gov.cca {
interface Port {
};
interface PortInfo{
/** Returns the type of the Port referred to by this PortInfo: corresponds to the
class or interface name for this Port.*/
string getType();
/** Returns the instance name for this Port. This name must be unique within the
scope of a CCA component.*/
string getName();
/** Returns the string value for this property, or null if it is nonexistent. */
string getProperty(string name);
};
interface Services {
/** Ask for a previously registered Port; will return a Port or generate an error. */
Port getPort(in string name);
/** Ask for a previously registered Port and return that Port if it is
available or return null otherwise. */
Port getPortNonblocking(in string name);
/** Creates a PortInfo to be used in subsequent calls to describe a Port. */
PortInfo createPortInfo(in string name,
in string type,
array<string, 1> properties );
/** Register a request for a Port that will be retrieved subsequently
with a call to getPort(). */
void registerUsesPort(in PortInfo name_and_type);
/** Notify the framework that a Port, previously registered by this component,
is no longer needed. */
void unregisterUsesPort(in string name);
/** Exports a Port implemented by this component to the framework.
This Port is now available for the framework to connect to other components. */
void addProvidesPort(in Port inPort, in PortInfo name);
/** Notifies the framework that a previously exported Port is no longer
available for use. */
void removeProvidesPort(in string name);
/** Notifies the framework that this component is finished with this Port.
releasePort() method calls exactly match getPort() mehtod calls. After
releasePort() is invoked all references to the released Port become invalid. */
void releasePort(in string name);
/** Get a reference to the component to which this Services object belongs. */
ComponentID getComponentID();
};
interface Component {
/** Obtain Services handle, through which the component communicates with the
framework. */
This is the one method that every CCA Component must implement. */
void setServices(in Services svc);
};
interface ComponentID{
/** Produce a string that, within the current framework, uniquely defines
this component reference. */
string toString();
};
}; // end package gov.cca
package gov.cca.ports {
interface GoPort{
/** Execute some encapsulated functionality on the component.
@return 0 if ok, -1 if internal error but component may be used further,
-2 if error so severe that component cannot be further used safely.
*/
};
interface ConnectionEventService extends Port{
/** Sign up to be told about connection activity.
@param connectionEventType must be one of the integer values defined in
ConnectionEvent. */
void addConnectionEventListener(int connectionEventType, ConnectionEventListener l);
/** Ignore future ConnectionEvents of the given type.
@param connectionEventType must be one of the integer values defined in
ConnectionEvent. */
void removeConnectionEventListener(int connectionEventType, ConnectionEventListener l)();
};
interface ConnectionEventListener {
/** Called on all listeners when a connection is made or broken. */
void connectionActivity(ConnectionEvent evt);
};
interface ConnectionEvent {
/** Returns the integer from those enumerated that describes the event.
The semantics are noted before
each member of the enum/static constant. We can add in different
types of connect/disconnect as multiports and
explicit local/global/sync/async semantics are agreed to in the future.
At present we assume that:
# All instances in a component cohort (often thought of as a single
"parallel component") receive all the events
and in the same order, but not necessarily globally synchronously.
# For disconnections, within a process the events are delivered first
to the using component then (if necessary) to the providing component.
# For connections, within a process the events are delivered first
to the providing component then (if necessary) to the using component.
Clearly some of the assumptions above may not suit a component
instance in which multiple execution threads act on a
single instance of the gov::cca::Services object (SMP). The Services
specification is ambiguous as to whether such a component is even allowed.
When this is clarified, additional members of the enum may arise,
in which case the assumptions here apply only to
ConnectPending, Connected, DisconnectPending, Disconnected types.
*/
int getEventType();
/** Returns the PortInfo of the affected Port. */
PortInfo getPortInfo();
/** The minimum kinds of events needed. List to be extended in the future.
as clearly SMP architectures and threads may violate the simple assumptions.
*/
enumeration Type {
Error = -1; // Someone got their hands on a bogus event object somehow.
ALL = 0; // Component wants to receive all event notices. ALL itself never received.
ConnectPending = 1; // A connection is about to be attempted.
Connected = 2; // A connection has been made.
DisconnectPending = 3; // A disconnection is about to be attempted.
Disconnected = 4; // A disconnection has been made.
};
};
}; // end package gov.cca.ports
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
package gov.cca;
/** A tag interface to identify an interface capable of being exported to
or imported from a CCA component. */
public interface Port {
}
/** An interface that describes a Port. */
public interface PortInfo{
/** Returns the type of the Port referred to by this PortInfo: corresponds to the
class or interface name for this Port.*/
public String getType();
/** Returns the instance name for this Port. This name must be unique within the
scope of a CCA component.*/
public String getName();
/** Returns the string value for this property, or null if it is nonexistent. */
public String getProperty(String name);
}
/** Framework services handle, through which the component
communicates with the framework. */
public interface Services {
/** Creates a PortInfo to be used in subsequent calls to describe a Port. */
public PortInfo createPortInfo(String name, String type, String[] properties);
/** Ask for a previously registered Port; will return a Port or generate an error. */
public Port getPort(String name);
/** Ask for a previously registered Port and return that Port if it is
available or return null otherwise. */
Port getPortNonblocking(String name);
/** Notifies the framework that this component is finished with this Port.
releasePort() method calls exactly match getPort() method calls. After
releasePort() is invoked all references to the released Port become invalid. */
public void releasePort(String name);
/** Register a request for a Port that will be retrieved subsequently
with a call to getPort(). */
public void registerUsesPort(PortInfo name_and_type);
/** Notify the framework that a Port, previously registered by this component,
is no longer desired. */
public void unregisterUsesPort(String name);
/** Exports a Port implemented by this component to the framework.
This Port is now available for the framework to connect to other components. */
public void addProvidesPort(Port inPort, PortInfo name);
/** Notifies the framework that a previously exported Port is no longer
available for use. */
public void removeProvidesPort(String name);
/** Get a reference to the component to which this Services object belongs. */
public ComponentID getComponentID();
}
/** The CCA object model: the interface that all CCA components must implement. */
public interface Component {
/** Obtain Services handle, through which the component and framework communicate.
This is the one method that every CCA Component must implement. */
public void setServices(Services svc);
}
/** A reference to a CCA component. */
public interface ComponentID{
/** Produce a string that, within the current framework, that uniquely defines
this component reference. */
public String toString();
}
package gov.cca.ports;
public interface GoPort extends Port {
/** Make the component do its thing. Return 0/-1/-2 for ok, bad, terminal. */
public int go();
}
/** A service to alert a component as when connections are made or broken; it is
reasonable to expect this service to be immediately available and fetchable during
a setServices call. This service interface is compatible with a direct-connected
framework.
@see Component
*/
public interface ConnectionEventService extends Port {
/** Sign up to be told about connection activity.
@param connectionEventType must be one of the integer values defined in
@see ConnectionEvent
*/
public void addConnectionEventListener(int connectionEventType, ConnectionEventListener l);
/** Ignore future ConnectionEvents of the given type.
Removing a non-added listener is not an error.
@param connectionEventType must be one of the integer values defined in
@see ConnectionEvent
*/
public void removeConnectionEventListener(int connectionEventType, ConnectionEventListener l);
}
/** This is the interface that a component must provide
in order to be notified of ConnectionEvents. */
public interface ConnectionEventListener {
/** Delivered to listeners when a connection is made or broken. */
public void connectionActivity(ConnectionEvent evt);
}
/** Base event interface components wishing to know about their connectedness
(used or provided ports) must listen for.
*/
public interface ConnectionEvent {
/** Somebody lost their cookies. Should never be deliberately sent
or received.
*/
public static final int Error = -1;
/** The enumerated value type for a listener to indicate it wants all
notices. Never delivered to a listener.
*/
public static final int ALL = 0;
/** A connection may soon be made. */
public static final int ConnectPending = 1;
/** A connection recently made. */
public static final int Connected = 2;
/** A connection may soon be unmade. */
public static final int DisconnectPending = 3;
/** A connection recently unmade. */
public static final int Disconnected = 4;
/** Returns the integer from those defined that describes the event.
The semantics are noted before
each member of the enum/static constant. We can add in different
types of connect/disconnect as multiports and
explicit local/global/sync/async semantics are agreed to in the future.
At present we assume that:
# all instances in a component cohort (often thought of as a single
"parallel component") receive all the events
and in the same order, but not necessarily globally synchronously.
# for disconnections, within a process the events are delivered first
to the using component then to the providing component.
# for connections, within a process the events are delivered first
to the providing component then to the using component.
Clearly some of the assumptions above may not suit a component
instance in which multiple execution threads act on a
single instance of the gov::cca::Services object (SMP). The Services
specification is ambiguous as to whether such a component is even allowed.
When this is clarified, additional members of the enum may arise,
in which case the assumptions here apply only to
ConnectPending, Connected, DisconnectPending, Disconnected types.
*/
public int getEventType();
/** Get the PortInfo of the affected Port. */
public PortInfo getPortInfo();
}
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
/** The use of certain recent C++ language features, specifically
templates and the Standard Template Library
cannot be mandated by the CCA interface specifications. These features
are not sufficiently portable to the computing systems of interest to
scientists in the Department of Energy. Use of these C++ features
in component implementations or framework implementations is not
prohibited, however, as not all components may have a strong
portability requirement.
*/
#define CCA_CONST
/// Use of the C/C++ const modifier at compile time is not allowed in the
/// standard, as it is unenforceable. It is nonetheless a nice mnemonic to
/// assist communication among scientific programmers.
namespace gov { namespace cca {
/** A minimal class to make containers work in C++. */
class Object{
public:
virtual ~Object(){}
/// A type-safe implementation of a C++ CCA framework uses
/// dynamic_cast<>() heavily; Object replaces (void *).
};
/** A tag interface to identify an interface capable of being exported to
or imported from a CCA component. */
class Port : public virtual Object {
public:
virtual ~Port(){}
};
/** An interface that describes a Port. */
class PortInfo : public virtual Object {
public:
virtual ~PortInfo(){}
/** Returns the type for this Port. This string is identical to the
class or interface name of the port. */
virtual CCA_CONST char* getType() CCA_CONST = 0;
/** Returns the instance name for this Port. This name must be unique within the
scope of a CCA component.*/
virtual CCA_CONST char* getName() CCA_CONST = 0;
/** Returns the string value for this property, or 0 if it is nonexistent. */
CCA_CONST char* getProperty(char* name) = 0;
};
/** Framework services handle, through which the component communicates
with the framework. */
class Services : public virtual Object {
public:
virtual ~Services(){}
/** Creates a PortInfo to be used in subsequent calls to describe a Port. */
virtual PortInfo* createPortInfo(CCA_CONST char *name, CCA_CONST char *type, CCA_CONST char** properties);
/** Ask for a previously registered Port; will return a Port or generate an error. */
virtual Port* getPort(CCA_CONST char *name)=0;
/** Ask for a previously registered Port and return that Port if it is
available or return NULL(0) otherwise. */
virtual Port* getPortNonblocking(CCA_CONST char *name);
/** Free's the port indicated by the instance name for modification
by the component's containing framework. After this call the
port will not be valid for use until getPort() is called
again.*/
virtual void releasePort(CCA_CONST char *name) = 0;
/** Component notifys the framework of a port that can be used by
this component. */
virtual void registerUsesPort(PortInfo *name_and_type) =0;
/** Notify the framework that a Port, previously registered by this component,
is no longer desired. */
virtual void unregisterUsesPort(CCA_CONST char *name)=0;
/** Exports a Port implemented by this component to the framework.
This Port is now available for the framework to connect to other components. */
virtual void addProvidesPort(Port *inPort,
PortInfo *name)=0;
/** Notifies the framework that a previously exported Port is no longer
available for use. */
void removeProvidesPort(CCA_CONST char *name)=0;
/** Get a reference to the component which this Services object belongs. */
virtual ComponentID* getComponentID() = 0;
};
/** Component object model that all Components must implement. */
class Component : public virtual CCA_Object {
public:
virtual ~Component(){}
/** The components containing framework provides services through
the CCAServices interface. */
virtual void setServices(Services *cc)=0;
};
class ComponentID : public virtual Object {
public:
virtual ~ComponentID() {}
/** Produce a string that, within the current framework,
that uniquely defines this component reference. */
char* toString()=0;
};
class GoPort : public virtual Port {
/** Execute some encapsulated functionality on the component.
A just-do-it port. Tremendously useful.
The canonical string type-name for this port is "gov.cca.GoPort".
*/
public:
/** obligatory vdtor */
virtual ~GoPort(){}
/** Make the component do its thing.
The component does not throw c++ exceptions except in the
form of returning -2.
@return
# 0 if did ok
# -1 if had problem,
# -2 if had problem bad enough to shoot
the component in the head or exit the framework.
*/
virtual int go() = 0;
};
class ConnectionEventService : public virtual Port {
public:
/** obligatory vdtor */
virtual ~ConnectionEventService(){}
/** Sign up to be told about connection activity.
@param connectionEventType must be one of the integer values defined in
ConnectionEvent. */
virtual void addConnectionEventListener(enum ConnectionEvent::Type type, ConnectionEventListener *l) = 0;
/** Ignore future ConnectionEvents of the given type.
@param connectionEventType must be one of the integer values defined in
ConnectionEvent. */
virtual void removeConnectionEventListener(int connectionEventType, ConnectionEventListener *l)() = 0;
};
class ConnectionEventListener {
public:
/** obligatory vdtor */
virtual ~ConnectionEventListener(){}
/** Called on all listeners when a connection is made or broken. */
virtual void connectionActivity(ConnectionEvent *evt) = 0;
};
class ConnectionEvent {
/** Returns the value from those enumerated that describes the event.
The semantics are noted before
each member of the enum. We can add in different
types of connect/disconnect as multiports and
explicit local/global/sync/async semantics are agreed to in the future.
At present we assume that:
# All instances in a component cohort (often thought of as a single
"parallel component") receive all the events
and in the same order, but not necessarily globally synchronously.
# For disconnections, within a process the events are delivered first
to the using component then (if necessary) to the providing component.
# For connections, within a process the events are delivered first
to the providing component then (if necessary) to the using component.
Clearly some of the assumptions above may not suit a component
instance in which multiple execution threads act on a
single instance of the gov::cca::Services object (SMP). The Services
specification is ambiguous as to whether such a component is even allowed.
When this is clarified, additional members of the enum may arise,
in which case the assumptions here apply only to
ConnectPending, Connected, DisconnectPending, Disconnected types.
*/
virtual enum Type getEventType() = 0;
/** Returns the PortInfo of the affected Port. */
virtual PortInfo *getPortInfo() = 0;
/** The minimum kinds of events needed. List to be extended in the future.
as clearly SMP architectures and threads may violate the simple assumptions.
*/
enum Type {
Error = -1; // Someone got their hands on a bogus event object somehow.
ALL = 0; // Component wants to receive all event notices. ALL itself never received.
ConnectPending = 1; // A connection is about to be attempted.
Connected = 2; // A connection has been made.
DisconnectPending = 3; // A disconnection is about to be attempted.
Disconnected = 4; // A disconnection has been made.
};
};
} }// end namespace gov.cca
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
Java example of a component that stamps a
string with the date. It is a complete implementation of a CCA
component that uses a port to receive a string and another port to get
the data. The component exports a port to produce a time stamped
string.
TimeStamper.java
- a component for stamping the time on the end of a string.
StringConsumerPort.java - a Port for handling strings.
TimeProducerPort.java - a Port for getting the date and time.
The javadoc for the above along with the Java CCA spec itself can be found here.
C++ example of the same Java example above.
TimeStamper.h - the header a component for stamping the time on the end of a string.
TimeStamper.cxx - a component for stamping the time on the end of a string.
StringConsumerPort.h - a Port for handling strings.
TimeProducerPort.h - a Port for getting the date and time.
The doc++ for the above along with the C++ CCA spec itself can be found here. However, neither is up to date with the most recent amendments. This will be remedied soon.
Overview | Provided Ports | Uses Ports | PortInfo | CCA Services | Component Interface | Well-known Ports | Interfaces | SIDL | C++ Mapping | Java Mapping | Examples | Other specs and impls
[A1] Armstrong, R.C., D. Gannon, A. Geist, K. Keahey, S. Kohn, L.
McInnes, S. Parker, and B. Smolinski, "Toward a Common Component
Architecture for High-Performance Parallel Computing", HPDC '99,
Redondo Beach, CA, 4-6 Aug 1999.[WWW]
[B1] Cleary, A., S. Kohn, S.G. Smith, and B.
Smolinski,"Language Interoperability Mechanisms for High-Performance
Scientific Applications ," Proceedings of the SIAM Workshop on
Object-Oriented Methods for Interoperable Scientific and Engineering
Computing, Yorktown Heights, NY, October 21-23, 1998. Also available
as LLNL technical report UCRL-JC-131823. [PDF][WWW]
[3] Gannon, et al
http://www.extreme.indiana.edu/ccat (as of 3/2001).
[4] Allan & Armstrong
http://z.ca.sandia.gov/~cca-forum/ccafe.html (as of 3/2001).