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

Method Index

 o Activate()
Set this component active (Activate(...)).
 o Active()
Probe if this component is active (ActiveCompo(...)).
 o AddCompo(String)
Add a new base channel with name (AddCompo(...)).
 o Attach(String)
Attach this thread as a component to ICE (Attach(...)).
 o Detach()
Detach this thread as a component from ICE (Detach(...)).
 o finalize()
Destructor for a Component Deprecated.
 o GetSendModuleId()
Get the last send module Id (GetSentModuleId(...)).
 o Name()
Give the name of the channel.
 o Probe(int)
Probe if we could receive a Message (Probe(...)).
 o Receive(int)
Receive a Message (without timeout)
 o Receive(int, long)
Receive a Message with timeout (Receive(...)).
 o SetMinTurnId(long)
Set the minimal Turn Id for the Component on Receive (SetMinTurnId(...)).
 o SetTurnId(long)
Set the Turn Id for following messages of the Component (SetTurnId(...)).

Methods

 o 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
 o finalize
 public void finalize()
Note: finalize() is deprecated.

Destructor for a Component

Overrides:
finalize in class Object
See Also:
Detach
 o Detach
 public void Detach()
Detach this thread as a component from ICE (Detach(...)).

 o 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
 o 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
 o Receive
 public Msg Receive(int msgtag)
Receive a Message (without timeout)

See Also:
Receive
 o 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
 o 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())
 o 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
 o Active
 public boolean Active()
Probe if this component is active (ActiveCompo(...)).

Returns:
true, iff this Component is active
 o Activate
 public void Activate()
Set this component active (Activate(...)).

See Also:
Active
 o GetSendModuleId
 public String GetSendModuleId()
Get the last send module Id (GetSentModuleId(...)).

Returns:
the last send module Id
 o Name
 public String Name()
Give the name of the channel.

Returns:
Name of the component

All Packages  Class Hierarchy  This Package  Previous  Next  Index