All Packages Class Hierarchy This Package Previous Next Index
Class Ice.Component
java.lang.Object
|
+----Ice.Component
- public final class Component
- extends Object
The Component Class
A Component is the main object of the ICE-Communication. Every program
(thread) which wants to communicate with other components has to have at
least one Component-Object (describing itsself to ICE) and a base channel
(to describe the component which it wants to communicate with).
This class does not contain a public Constructor and has therefore to be
instantiated by the static method Attach (for compatibiltity reasons with
other ICE-Interfaces). A base channel to another component is added by the
AddCompo-method of an instantiated Component.
- Version:
- 1.0, 03 Dec 1997
- Author:
- Volker Weber
-
Activate()
- Set this component active
(Activate(...)).
-
Active()
- Probe if this component is active
(ActiveCompo(...)).
-
AddCompo(String)
- Add a new base channel with name
(AddCompo(...)).
-
Attach(String)
- Attach this thread as a component to ICE
(Attach(...)).
-
Detach()
- Detach this thread as a component from ICE
(Detach(...)).
-
finalize()
- Destructor for a Component
Deprecated.
-
GetSendModuleId()
- Get the last send module Id
(GetSentModuleId(...)).
-
Name()
- Give the name of the channel.
-
Probe(int)
- Probe if we could receive a Message
(Probe(...)).
-
Receive(int)
- Receive a Message (without timeout)
-
Receive(int, long)
- Receive a Message with timeout
(Receive(...)).
-
SetMinTurnId(long)
- Set the minimal Turn Id for the Component on Receive
(SetMinTurnId(...)).
-
SetTurnId(long)
- Set the Turn Id for following messages of the Component
(SetTurnId(...)).
Attach
public static Component Attach(String name)
- Attach this thread as a component to ICE
(Attach(...)).
This method has to be used to construct a Component-Object.
A component should be detached if it is not longer needed. Java claims
to do a finalization of unneeded objects, but does not do it at a
System.exit(). Therefore it is more clean to detach.
- Parameters:
- name - name of the Component to attach
- Returns:
- new Component-Object
- See Also:
- Detach
finalize
public void finalize()
- Note: finalize() is deprecated.
- Destructor for a Component
- Overrides:
- finalize in class Object
- See Also:
- Detach
Detach
public void Detach()
- Detach this thread as a component from ICE
(Detach(...)).
AddCompo
public Channel AddCompo(String name)
- Add a new base channel with name
(AddCompo(...)).
As a side-effect this component is set active.
- Parameters:
- name - name of a component to connect to
- Returns:
- new Channel-Object for a base channel
- See Also:
- Activate
Receive
public Msg Receive(int msgtag,
long timeout)
- Receive a Message with timeout
(Receive(...)).
- Parameters:
- msgtag - The message tag for receiving
- timeout - A timeout for receive in milliseconds (iff negative
Receive has no timeout)
- Returns:
- A received Ice.Msg (or null if a message could not be received;
cause of - for instance - a timeout occurs)
- See Also:
- NONE, ANY, NOTAG, CMPTAG
Receive
public Msg Receive(int msgtag)
- Receive a Message (without timeout)
- See Also:
- Receive
SetTurnId
public void SetTurnId(long turn_Id)
- Set the Turn Id for following messages of the Component
(SetTurnId(...)).
- Parameters:
- turn_Id - turn Id to be set for messages send from this component
SetMinTurnId
public void SetMinTurnId(long turn_Id)
- Set the minimal Turn Id for the Component on Receive
(SetMinTurnId(...)).
- Parameters:
- turn_Id - minimal turn Id for the component to receive (regardless
of Component.Receive() or Channel.Receive())
Probe
public boolean Probe(int msgtag)
- Probe if we could receive a Message
(Probe(...)).
- Parameters:
- msgtag - A message tag for receiving
- Returns:
- true, iff we could receive a message
- See Also:
- NONE, ANY, NOTAG, CMPTAG
Active
public boolean Active()
- Probe if this component is active
(ActiveCompo(...)).
- Returns:
- true, iff this Component is active
Activate
public void Activate()
- Set this component active
(Activate(...)).
- See Also:
- Active
GetSendModuleId
public String GetSendModuleId()
- Get the last send module Id
(GetSentModuleId(...)).
- Returns:
- the last send module Id
Name
public String Name()
- Give the name of the channel.
- Returns:
- Name of the component
All Packages Class Hierarchy This Package Previous Next Index