java.mtsb
Class Component
java.lang.Object
|
+--java.mtsb.Component
-
public class Component
-
extends java.lang.Object
-
The component class is characterised by the message the component can receive
and the events the component can propagate. The propagation of events is
implemented by the event() method of this class. This method is invoked
by the descendant classes after the reception of a message that is considered
relevant to the environment. In this way, the throwing of events is transparent
to the programmer and there is no need to redefine it. Events are delegated
to a binding class (USP class, described at LocalUSP.doc) which implements
the dynamic linking of components; therefore components propagate events
to unknown connectors.
The component class is the root of the component hierarchy; consequently
MTS components will be descendants of it.
| Constructor Summary |
Component(java.lang.String
instancename)
|
Component(java.lang.String
instancename, LocalUSP usp)
Constructor
of the class. |
| Method Summary |
| void |
event(java.mtsb.ClassEvent
e)
This method
propagates an event to a Connector throw the USP. |
| void |
event(java.lang.String
type, java.lang.Object[] args)
|
| java.mtsb.CID |
getCID()
|
| java.lang.String |
getServiceParameter(java.lang.String
name)
This method
retrieves the value of a parameter of a running service. |
| boolean |
hasType(java.lang.String
type)
This method
returns true if the component is of type of the argument |
| void |
setInstanceName(java.lang.String
name)
|
| void |
setLocalUSP(LocalUSP
usp)
|
| Methods inherited from class java.lang.Object |
| equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
usp
public LocalUSP usp
type
public java.lang.String type
name
public java.lang.String name
url
public java.net.URL url
ident
public int ident
Component
public Component(java.lang.String instancename,
LocalUSP usp)
throws java.lang.Exception
-
Constructor of the class. Creates a component and inits the components
ident and the link to the middleware platform. Each component has a unique
global address defined by its CID class. This address will be used by connectors
for sending response messages.
Component
public Component(java.lang.String instancename)
throws java.lang.Exception
setLocalUSP
public void setLocalUSP(LocalUSP usp)
throws java.lang.Exception
setInstanceName
public void setInstanceName(java.lang.String name)
getCID
public java.mtsb.CID getCID()
event
public void event(java.mtsb.ClassEvent e)
-
This method propagates an event to a Connector throw the USP. The argument(s)
describe(s) the event by an object ClassEvent or by the type of the event
and its arguments
event
public void event(java.lang.String type,
java.lang.Object[] args)
hasType
public boolean hasType(java.lang.String type)
-
This method returns true if the component is of type of the argument
getServiceParameter
public java.lang.String getServiceParameter(java.lang.String name)
-
This method retrieves the value of a parameter of a running service.